This is not a tutorial to create an Astro website, this is only a note! You can find some every new and useful techniques on this note alongside the official documentation.
Installation
First install nodejs
Create a astro projects
You should follow the installation steps given in the theme you choose.
Setup & Deploy
Templating
Using sass
Installing sass module to compile
Write stylesheet
Using tailwindcss
Installing
Configuration
ConfigFile: Default the config of tailwind is tailwind.config.ts
ApplyBaseStyles: By default, the integrations imports a basic base.css file on every page of your project. To disable this behavior, set applyBaseStyles to false.
Content Collections
Define Collections
Define collection schema
Using content in Astro
Render content to HTML
Framework Components
Astro supports a variety of popular frameworks including react, preact, svelte, vue, solidjs, alpinejs, lit with official integrations. To install it, please follow this official guide
Using frameworks
Hydrating interactive Components
Remark and Rehype
Remark parses Markdown and MDX files and convert theme to HTML.
Rehype parses and transforms HTML and exports HTML
Astro supports adding third-party remark and rehype plugins for Markdown and MDX.
Plugins for both Remark and Rehype may be registered in the Markdown or MDX integrations in astro.config.mjs. Below, we is and example remark plugins of the markdown
Create a Remark Plugins
Somewhere in a root project, create a .mjs file with the name you like, such as remark-post-status.mjs
This code will be applied to every markdown file in your project, one at a time. This checks the post is a new post or not if this file was created within 7 days ago and parses to frontendmatter of this file.
In order to register this remark plugin with Astro and make it applies to your markdown page, you need to reference its in your astro.config.mjs like this: