Overview
Astro Theme Cactus is a simple and opinionated starter built with the Astro framework. It is designed to create an easy-to-use blog or website.
Features
- Astro Fast: Built with the Astro framework for fast performance.
- TailwindCSS Utility classes: Utilizes TailwindCSS utility classes for easy styling.
- Accessible, semantic HTML markup: Uses semantic HTML markup for improved accessibility.
- Responsive & SEO-friendly: Provides a responsive design that is optimized for search engines.
- Dark / Light mode: Supports dark and light mode using Tailwind and CSS variables.
- Astro Assets Integration: Integrates with Astro Assets for optimized images.
- MD & MDX posts: Supports Markdown and MDX files for creating blog posts.
- Satori for creating open graph png images: Uses Satori library for generating open graph images.
- Pagination: Includes automatic pagination for blog posts.
- Automatic RSS feed: Generates an RSS feed automatically.
- Shiki code syntax styling: Provides code syntax styling using Shiki.
- Auto-generated sitemap: Generates a sitemap automatically.
- Pagefind static search library integration: Integrates with Pagefind static search library for search functionality.
Installation
To install the Astro Theme Cactus, follow these steps:
- Create a new repository from the provided template.
- Deploy the theme with either Netlify or Vercel.
- Run the following commands:
pnpm installto install dependencies.pnpm devto start the local development server atlocalhost:3000.pnpm buildto build your production site to./dist/.pnpm postbuildto run the Pagefind script for building the static search of your blog posts.pnpm previewto preview your build locally before deploying.pnpm syncto generate types based on your config insrc/content/config.ts.
- Configure the theme by:
- Editing the
src/site.config.tsfile for basic site meta data. - Updating the
astro.config.tsfile’s site property with your own domain. - Replacing and updating files within the
/publicfolder, such asfavicon.icoandrobots.txt. - Modifying the
src/styles/global.cssfile with your own light and dark styles. - Editing social links in
src/data/constants.tsandsrc/components/SocialList.astroto add or replace your media profiles.
Create or edit blog posts within the
src/content/post/directory using.mdor.mdxfiles.Customize the OG Image:
- To change the style of the generated image, open
src/pages/og-image/[slug].png.tsand modify the markup function. - To generate SVG OG images instead of PNG, remove the
@resvg/resvg-jslibrary and modify thegetfunction insrc/pages/og-image/[slug].png.ts. - Alternatively, you can create your own OG images by adding an
ogImageproperty in the frontmatter of your blog post files.
- Optional: Fonts can be customized by editing the font family in the
src/styles/global.cssfile.
Summary
Astro Theme Cactus is a simple and opinionated starter theme built with the Astro framework. It provides key features such as fast performance, TailwindCSS utility classes, accessible HTML markup, responsive design, dark and light modes, optimized images, support for Markdown and MDX posts, code syntax styling, automatic pagination, RSS feed generation, sitemap generation, and search functionality. It can be easily installed and customized to create a blog or website.