[![Stargazers][stars-shield]][stars-url] [![MIT License][license-shield]][license-url] [![Release][release-shield]][release-url]
๐ An super fast, lightweight and SEO friendly blog made by Astro ๐
English
ยท
็ฎไฝไธญๆ
ยท
ๆฅๆฌ่ช
Table of Contents
The image shown here is a index-page for laptop-size, click here to see more detailed screenshot for this application.
- [โ] Minimal styling
- [โ] Mobile responsive
- [โ] 100/100 Lighthouse performance
- [โ] SEO-friendly with canonical URLs and OpenGraph data
- [โ] Sitemap support
- [โ] RSS Feed support
- [โ] Markdown & MDX support
- [โ] Syntax highlighting
- [โ] Image optimization
- [โ] Table of contents
- [โ] Dark mode
- [โ] Reading Time
- [โ] Pagefind static search library integration
- [โ] Related posts
- [โ] Share posts (Linkedin, twitter)
- [โ] Draft mode
- [โ] Copy code block
- [โ] CMS in the repository (Tina CMS)
- [โ] Pagination
- [โ] ViewTransition (new)
- [โ] Disqus comments (new)
- Add post author
- Add customization with colors
- Add filters for reading time, date...
- More sharing options
- Internationalization (i18n)
- ASTRO + Typescript - Astro is the all-in-one web framework designed for speed.
- Tailwind CSS + Tailwind-Merge + clsx - Tailwind CSS is a utility-first CSS framework.
- Tabler Icons - A open source SVG icons.
- Eslint - ESLint is an open source project that helps you find and fix problems.
- Prettier - Code formatter.
- Search Library - Static search library integration.
- Motion - Motion One is the smallest fully-featured animation library for the web.
- Tina CMS - CMS.
- NodeJS v20 LTS above
-
Clone or fork the repository:
-
Install dependencies:
cd nano-blog
pnpm install
- Run the development server:
pnpm start
- Edit the configuration file src/data/site.config.ts for the basic blog metadata.
- Update the astro.config.mjs file at the root of the project with your own domain.
- Modify the files in the /public folder:
- favicon
- robots.txt -> update the Sitemap url to your own domain
- open-graph -> the open-graph is the image that will be displayed when sharing the blog link. For posts, the preview image is the post cover.
- Edit the social networks in the Header component - src/components/Header.astro, change the URL to your social network.
To add a new category to your blog, simply go to the src/data/categories.ts file and add it to the array.
Example:
export const CATEGORIES = [
'JavaScript',
'React',
'new category here' <---
] as const
๐จ Zod checks whether the category is not correctly written or does not exist in the properties of the markdown document. It will throw an error when building the application. ๐จ
Adding a post is as simple as adding a .md or .mdx file to the blog folder at the path src/content/blog. The filename will be used to create the slug/URL of the page.
For example, if you have a file named jsx-and-react.md, it will be transformed into: http://yourdomain.com/post/jsx-and-react/
To activate draft mode, add the property draft: true to the file, and it will no longer be displayed on the blog.
Example :
title: MacBook Pro 2022
description: 'The new MacBook Pro 2022 is here. With the Apple M2 chip, a new design, and more, the new MacBook Pro is the best laptop Apple has ever made.'
pubDate: 'Jul 02 2022'
heroImage: '../../assets/bg.jpg'
category: 'Category 1'
tags: ['JavaScript', 'css', 'HTML5', 'GitHub']
draft: true <---