mirror of
https://github.com/prdlk/website.git
synced 2026-08-02 09:21:41 +00:00
docs: update README.md to reflect Astro Cactus template changes
This commit is contained in:
@@ -1,98 +0,0 @@
|
||||
# CLAUDE.md
|
||||
|
||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||
|
||||
## Project Overview
|
||||
|
||||
This is a personal portfolio/blog website built with Next.js 13.4.16 (App Router), TypeScript, and Tailwind CSS. It's based on the Tailwind UI "Spotlight" template and features a modern, responsive design with dark mode support.
|
||||
|
||||
## Essential Commands
|
||||
|
||||
```bash
|
||||
# Install dependencies
|
||||
npm install
|
||||
|
||||
# Run development server (http://localhost:3000)
|
||||
npm run dev
|
||||
|
||||
# Build for production
|
||||
npm run build
|
||||
|
||||
# Start production server
|
||||
npm start
|
||||
|
||||
# Run linting
|
||||
npm run lint
|
||||
|
||||
# Type checking (via build process)
|
||||
npm run build
|
||||
```
|
||||
|
||||
## Architecture & Key Patterns
|
||||
|
||||
### Directory Structure
|
||||
- **`/src/app/`** - Next.js App Router pages and layouts
|
||||
- Each page is in its own directory with `page.tsx` or `page.mdx`
|
||||
- Articles are MDX files in subdirectories under `/articles/`
|
||||
- RSS feed generation at `/feed.xml/`
|
||||
|
||||
- **`/src/components/`** - Reusable React components
|
||||
- Layout components extend from `Layout.tsx`
|
||||
- All components use TypeScript with proper type definitions
|
||||
- Components use Tailwind CSS classes for styling
|
||||
|
||||
- **`/src/lib/`** - Utility functions
|
||||
- `articles.ts` - Functions for loading and managing MDX articles
|
||||
- `formatDate.ts` - Date formatting utilities
|
||||
|
||||
### Content Management
|
||||
- Articles are written in MDX format in `/src/app/articles/[slug]/page.mdx`
|
||||
- Each article directory can contain images alongside the MDX file
|
||||
- Article metadata is defined in the MDX frontmatter
|
||||
- The `ArticleLayout` component wraps all article content
|
||||
|
||||
### Styling Approach
|
||||
- Tailwind CSS utility classes for all styling
|
||||
- Dark mode support via `next-themes` package
|
||||
- Typography plugin for prose content styling
|
||||
- Custom Tailwind configuration in `tailwind.config.js`
|
||||
- Code syntax highlighting with Prism CSS
|
||||
|
||||
### TypeScript Configuration
|
||||
- Strict mode enabled
|
||||
- Path alias `@/*` maps to `./src/*`
|
||||
- All components and utilities should have proper TypeScript types
|
||||
|
||||
### Important Files
|
||||
- `next.config.mjs` - Next.js configuration with MDX support
|
||||
- `tailwind.config.js` - Tailwind CSS customization
|
||||
- `.env.local` - Must set `NEXT_PUBLIC_SITE_URL` for production
|
||||
|
||||
## Development Guidelines
|
||||
|
||||
### Adding New Pages
|
||||
1. Create a new directory under `/src/app/`
|
||||
2. Add a `page.tsx` file with proper TypeScript types
|
||||
3. Use the `SimpleLayout` or custom layout components
|
||||
4. Follow existing page patterns for consistency
|
||||
|
||||
### Adding New Articles
|
||||
1. Create a new directory under `/src/app/articles/[article-name]/`
|
||||
2. Add a `page.mdx` file with frontmatter including title, description, author, and date
|
||||
3. Place any images in the same directory
|
||||
4. Articles automatically appear in the articles list and RSS feed
|
||||
|
||||
### Component Development
|
||||
- Always use TypeScript with proper type definitions
|
||||
- Follow existing component patterns for props and structure
|
||||
- Use Tailwind CSS classes; avoid inline styles
|
||||
- Components should be reusable and properly abstracted
|
||||
|
||||
### Environment Setup
|
||||
Before running the project, create a `.env.local` file:
|
||||
```
|
||||
NEXT_PUBLIC_SITE_URL=https://your-domain.com
|
||||
```
|
||||
|
||||
## No Testing Framework
|
||||
This project does not currently have a testing framework configured. Consider adding Jest and React Testing Library if test coverage is needed.
|
||||
-129
@@ -1,129 +0,0 @@
|
||||
# Tailwind UI License
|
||||
|
||||
## Personal License
|
||||
|
||||
Tailwind Labs Inc. grants you an on-going, non-exclusive license to use the Components and Templates.
|
||||
|
||||
The license grants permission to **one individual** (the Licensee) to access and use the Components and Templates.
|
||||
|
||||
You **can**:
|
||||
|
||||
- Use the Components and Templates to create unlimited End Products.
|
||||
- Modify the Components and Templates to create derivative components and templates. Those components and templates are subject to this license.
|
||||
- Use the Components and Templates to create unlimited End Products for unlimited Clients.
|
||||
- Use the Components and Templates to create End Products where the End Product is sold to End Users.
|
||||
- Use the Components and Templates to create End Products that are open source and freely available to End Users.
|
||||
|
||||
You **cannot**:
|
||||
|
||||
- Use the Components and Templates to create End Products that are designed to allow an End User to build their own End Products using the Components and Templates or derivatives of the Components and Templates.
|
||||
- Re-distribute the Components and Templates or derivatives of the Components and Templates separately from an End Product, neither in code or as design assets.
|
||||
- Share your access to the Components and Templates with any other individuals.
|
||||
- Use the Components and Templates to produce anything that may be deemed by Tailwind Labs Inc, in their sole and absolute discretion, to be competitive or in conflict with the business of Tailwind Labs Inc.
|
||||
|
||||
### Example usage
|
||||
|
||||
Examples of usage **allowed** by the license:
|
||||
|
||||
- Creating a personal website by yourself.
|
||||
- Creating a website or web application for a client that will be owned by that client.
|
||||
- Creating a commercial SaaS application (like an invoicing app for example) where end users have to pay a fee to use the application.
|
||||
- Creating a commercial self-hosted web application that is sold to end users for a one-time fee.
|
||||
- Creating a web application where the primary purpose is clearly not to simply re-distribute the components (like a conference organization app that uses the components for its UI for example) that is free and open source, where the source code is publicly available.
|
||||
|
||||
Examples of usage **not allowed** by the license:
|
||||
|
||||
- Creating a repository of your favorite Tailwind UI components or templates (or derivatives based on Tailwind UI components or templates) and publishing it publicly.
|
||||
- Creating a React or Vue version of Tailwind UI and making it available either for sale or for free.
|
||||
- Create a Figma or Sketch UI kit based on the Tailwind UI component designs.
|
||||
- Creating a "website builder" project where end users can build their own websites using components or templates included with or derived from Tailwind UI.
|
||||
- Creating a theme, template, or project starter kit using the components or templates and making it available either for sale or for free.
|
||||
- Creating an admin panel tool (like [Laravel Nova](https://nova.laravel.com/) or [ActiveAdmin](https://activeadmin.info/)) that is made available either for sale or for free.
|
||||
|
||||
In simple terms, use Tailwind UI for anything you like as long as it doesn't compete with Tailwind UI.
|
||||
|
||||
### Personal License Definitions
|
||||
|
||||
Licensee is the individual who has purchased a Personal License.
|
||||
|
||||
Components and Templates are the source code and design assets made available to the Licensee after purchasing a Tailwind UI license.
|
||||
|
||||
End Product is any artifact produced that incorporates the Components or Templates or derivatives of the Components or Templates.
|
||||
|
||||
End User is a user of an End Product.
|
||||
|
||||
Client is an individual or entity receiving custom professional services directly from the Licensee, produced specifically for that individual or entity. Customers of software-as-a-service products are not considered clients for the purpose of this document.
|
||||
|
||||
## Team License
|
||||
|
||||
Tailwind Labs Inc. grants you an on-going, non-exclusive license to use the Components and Templates.
|
||||
|
||||
The license grants permission for **up to 25 Employees and Contractors of the Licensee** to access and use the Components and Templates.
|
||||
|
||||
You **can**:
|
||||
|
||||
- Use the Components and Templates to create unlimited End Products.
|
||||
- Modify the Components and Templates to create derivative components and templates. Those components and templates are subject to this license.
|
||||
- Use the Components and Templates to create unlimited End Products for unlimited Clients.
|
||||
- Use the Components and Templates to create End Products where the End Product is sold to End Users.
|
||||
- Use the Components and Templates to create End Products that are open source and freely available to End Users.
|
||||
|
||||
You **cannot**:
|
||||
|
||||
- Use the Components or Templates to create End Products that are designed to allow an End User to build their own End Products using the Components or Templates or derivatives of the Components or Templates.
|
||||
- Re-distribute the Components or Templates or derivatives of the Components or Templates separately from an End Product.
|
||||
- Use the Components or Templates to create End Products that are the property of any individual or entity other than the Licensee or Clients of the Licensee.
|
||||
- Use the Components or Templates to produce anything that may be deemed by Tailwind Labs Inc, in their sole and absolute discretion, to be competitive or in conflict with the business of Tailwind Labs Inc.
|
||||
|
||||
### Example usage
|
||||
|
||||
Examples of usage **allowed** by the license:
|
||||
|
||||
- Creating a website for your company.
|
||||
- Creating a website or web application for a client that will be owned by that client.
|
||||
- Creating a commercial SaaS application (like an invoicing app for example) where end users have to pay a fee to use the application.
|
||||
- Creating a commercial self-hosted web application that is sold to end users for a one-time fee.
|
||||
- Creating a web application where the primary purpose is clearly not to simply re-distribute the components or templates (like a conference organization app that uses the components or a template for its UI for example) that is free and open source, where the source code is publicly available.
|
||||
|
||||
Examples of use **not allowed** by the license:
|
||||
|
||||
- Creating a repository of your favorite Tailwind UI components or template (or derivatives based on Tailwind UI components or templates) and publishing it publicly.
|
||||
- Creating a React or Vue version of Tailwind UI and making it available either for sale or for free.
|
||||
- Creating a "website builder" project where end users can build their own websites using components or templates included with or derived from Tailwind UI.
|
||||
- Creating a theme or template using the components or templates and making it available either for sale or for free.
|
||||
- Creating an admin panel tool (like [Laravel Nova](https://nova.laravel.com/) or [ActiveAdmin](https://activeadmin.info/)) that is made available either for sale or for free.
|
||||
- Creating any End Product that is not the sole property of either your company or a client of your company. For example your employees/contractors can't use your company Tailwind UI license to build their own websites or side projects.
|
||||
|
||||
### Team License Definitions
|
||||
|
||||
Licensee is the business entity who has purchased a Team License.
|
||||
|
||||
Components and Templates are the source code and design assets made available to the Licensee after purchasing a Tailwind UI license.
|
||||
|
||||
End Product is any artifact produced that incorporates the Components or Templates or derivatives of the Components or Templates.
|
||||
|
||||
End User is a user of an End Product.
|
||||
|
||||
Employee is a full-time or part-time employee of the Licensee.
|
||||
|
||||
Contractor is an individual or business entity contracted to perform services for the Licensee.
|
||||
|
||||
Client is an individual or entity receiving custom professional services directly from the Licensee, produced specifically for that individual or entity. Customers of software-as-a-service products are not considered clients for the purpose of this document.
|
||||
|
||||
## Enforcement
|
||||
|
||||
If you are found to be in violation of the license, access to your Tailwind UI account will be terminated, and a refund may be issued at our discretion. When license violation is blatant and malicious (such as intentionally redistributing the Components or Templates through private warez channels), no refund will be issued.
|
||||
|
||||
The copyright of the Components and Templates is owned by Tailwind Labs Inc. You are granted only the permissions described in this license; all other rights are reserved. Tailwind Labs Inc. reserves the right to pursue legal remedies for any unauthorized use of the Components or Templates outside the scope of this license.
|
||||
|
||||
## Liability
|
||||
|
||||
Tailwind Labs Inc.’s liability to you for costs, damages, or other losses arising from your use of the Components or Templates — including third-party claims against you — is limited to a refund of your license fee. Tailwind Labs Inc. may not be held liable for any consequential damages related to your use of the Components or Templates.
|
||||
|
||||
This Agreement is governed by the laws of the Province of Ontario and the applicable laws of Canada. Legal proceedings related to this Agreement may only be brought in the courts of Ontario. You agree to service of process at the e-mail address on your original order.
|
||||
|
||||
## Questions?
|
||||
|
||||
Unsure which license you need, or unsure if your use case is covered by our licenses?
|
||||
|
||||
Email us at [support@tailwindui.com](mailto:support@tailwindui.com) with your questions.
|
||||
@@ -1,42 +1,232 @@
|
||||
# Spotlight
|
||||
<div align="center">
|
||||
<img alt="Astro Cactus logo" src="https://github.com/user-attachments/assets/92dfbabf-ca65-4bf6-991d-9a71e5319880" width="70" />
|
||||
</div>
|
||||
<h1 align="center">
|
||||
Astro Cactus
|
||||
</h1>
|
||||
|
||||
Spotlight is a [Tailwind UI](https://tailwindui.com) site template built using [Tailwind CSS](https://tailwindcss.com) and [Next.js](https://nextjs.org).
|
||||
Astro Cactus is a simple opinionated starter built with [Astro](https://astro.build). Use it to create an easy-to-use blog or website.
|
||||
|
||||
## Getting started
|
||||
## Table Of Contents
|
||||
|
||||
To get started with this template, first install the npm dependencies:
|
||||
1. [Key Features](#key-features)
|
||||
2. [Demo](#demo-)
|
||||
3. [Quick start](#quick-start)
|
||||
4. [Preview](#preview)
|
||||
5. [Commands](#commands)
|
||||
6. [Configure](#configure)
|
||||
7. [Updating](#updating)
|
||||
8. [Adding posts, notes, and tags](#adding-posts-notes-and-tags)
|
||||
- [Post Frontmatter](#post-frontmatter)
|
||||
- [Note Frontmatter](#note-frontmatter)
|
||||
- [Tag Frontmatter](#tag-frontmatter)
|
||||
- [Frontmatter Snippets](#frontmatter-snippets)
|
||||
9. [Pagefind search](#pagefind-search)
|
||||
10. [Analytics](#analytics)
|
||||
11. [Deploy](#deploy)
|
||||
12. [Acknowledgment](#acknowledgment)
|
||||
|
||||
## Key Features
|
||||
|
||||
- Astro v6 Fast 🚀
|
||||
- Tailwind v4
|
||||
- Accessible, semantic HTML markup
|
||||
- Responsive & SEO-friendly
|
||||
- Dark & Light mode
|
||||
- MD & [MDX](https://docs.astro.build/en/guides/markdown-content/#mdx-only-features) posts & notes
|
||||
- Includes [Admonitions](https://astro-cactus.chriswilliams.dev/posts/markdown-elements/admonitions/)
|
||||
- [Satori](https://github.com/vercel/satori) for creating open graph png images
|
||||
- [Automatic RSS feeds](https://docs.astro.build/en/guides/rss)
|
||||
- [Webmentions](https://webmention.io/)
|
||||
- Auto-generated:
|
||||
- [sitemap](https://docs.astro.build/en/guides/integrations-guide/sitemap/)
|
||||
- [robots.txt](https://github.com/alextim/astro-lib/blob/main/packages/astro-robots-txt/README.md)
|
||||
- [web app manifest](https://github.com/alextim/astro-lib/blob/main/packages/astro-webmanifest/README.md)
|
||||
- [Pagefind](https://pagefind.app/) static search library integration
|
||||
- [Astro Icon](https://github.com/natemoo-re/astro-icon) svg icon component
|
||||
- [Expressive Code](https://expressive-code.com/) code blocks and syntax highlighter
|
||||
|
||||
## Demo 💻
|
||||
|
||||
Check out the [Demo](https://astro-cactus.chriswilliams.dev/), hosted on Netlify
|
||||
|
||||
## Quick start
|
||||
|
||||
[Create a new repo](https://github.com/chrismwilliams/astro-theme-cactus/generate) from this template.
|
||||
|
||||
```bash
|
||||
npm install
|
||||
# npm 7+
|
||||
npm create astro@latest -- --template chrismwilliams/astro-theme-cactus
|
||||
|
||||
# pnpm
|
||||
pnpm dlx create-astro --template chrismwilliams/astro-theme-cactus
|
||||
```
|
||||
|
||||
Next, create a `.env.local` file in the root of your project and set the `NEXT_PUBLIC_SITE_URL` variable to your site's public URL:
|
||||
[](https://app.netlify.com/start/deploy?repository=https://github.com/chrismwilliams/astro-theme-cactus) [](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fchrismwilliams%2Fastro-theme-cactus&project-name=astro-theme-cactus)
|
||||
|
||||
```
|
||||
NEXT_PUBLIC_SITE_URL=https://example.com
|
||||
## Preview
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## Commands
|
||||
|
||||
Replace pnpm with your choice of npm / yarn
|
||||
|
||||
| Command | Action |
|
||||
| :--------------- | :------------------------------------------------------------- |
|
||||
| `pnpm install` | Installs dependencies |
|
||||
| `pnpm dev` | Starts local dev server at `localhost:3000` |
|
||||
| `pnpm build` | Build your production site to `./dist/` |
|
||||
| `pnpm postbuild` | Pagefind script to build the static search of your blog posts |
|
||||
| `pnpm preview` | Preview your build locally, before deploying |
|
||||
| `pnpm sync` | Generate types based on your config in `src/content/config.ts` |
|
||||
|
||||
## Configure
|
||||
|
||||
- Edit the template's config file `src/site.config.ts`
|
||||
- **Important**: set the url property with your own domain.
|
||||
- Modify the settings for markdown code blocks, generated by [Expressive Code](https://expressive-code.com). Astro Cactus has both a dark (dracula) and light (github-light) theme. You can find more options [@ expressive-code](https://expressive-code.com/guides/themes/#available-themes).
|
||||
- Update file `astro.config.ts`
|
||||
- [astro-webmanifest options](https://github.com/alextim/astro-lib/blob/main/packages/astro-webmanifest/README.md)
|
||||
- Replace & update files within the `/public` folder:
|
||||
- icon.svg - used as the source to create favicons & manifest icons
|
||||
- social-card.png - used as the default og:image
|
||||
- Modify file `src/styles/global.css` with your own light and dark styles, and customise [Tailwind's theme settings](https://tailwindcss.com/docs/theme#customizing-your-theme).
|
||||
- Edit social links in `src/components/SocialList.astro` to add/replace your media profile. Icons can be found @ [icones.js.org](https://icones.js.org/), per [Astro Icon's instructions](https://www.astroicon.dev/guides/customization/#find-an-icon-set).
|
||||
- Create/edit posts & notes for your blog within `src/content/post/` & `src/content/note/` with .md/mdx file(s). See [below](#adding-posts-notes-and-tags) for more details.
|
||||
- Read [this post](http://astro-cactus.chriswilliams.dev/posts/webmentions/) for adding webmentions to your site.
|
||||
- Add any custom Tag pages for related blog posts in `/src/content/tag/`, ensuring that the file name is the same as the tag.
|
||||
- OG Image:
|
||||
- If you would like to change the style of the generated image the Satori library creates, open up `src/pages/og-image/_ogMarkup.ts` to the markup function where you can edit the html/tailwind-classes as necessary. You can use this [playground](https://og-playground.vercel.app/) to aid your design.
|
||||
- You can also create your own og images and skip satori generating it for you by adding an ogImage property in the frontmatter with a link to the asset, an example can be found in `src/content/post/testing/social-image.md`. More info on frontmatter can be found [below](#post-frontmatter)
|
||||
- Optional:
|
||||
- Fonts: This theme sets the body element to the font family `font-mono`, in `src/layouts/Base.astro` on the `<body>`. You can change fonts by removing the variant `font-mono`, after which TailwindCSS will default to the `font-sans` [font family stack](https://tailwindcss.com/docs/font-family).
|
||||
|
||||
## Updating
|
||||
|
||||
If you've forked the template, you can [sync the fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork) with your own project, remembering to **not** click Discard Changes as you will lose your own.
|
||||
|
||||
If you have a template repository, you can add this template as a remote, [as discussed here](https://stackoverflow.com/questions/56577184/github-pull-changes-from-a-template-repository).
|
||||
|
||||
## Adding posts, notes, and tags
|
||||
|
||||
This theme uses [Content Collections](https://docs.astro.build/en/guides/content-collections/) to organise local Markdown and MDX files, as well as type-checking frontmatter with a schema -> `src/content.config.ts`.
|
||||
|
||||
Adding a post/note/tag is as simple as adding your .md(x) files to either `src/content/post`, `src/content/note`, and `src/content/tag` folders, the filename of which will be used as the slug/url.
|
||||
|
||||
The Tag collection allows you to override the content for generated tag pages. For example the template includes `src/content/tag/test.md` which overrides the content shown in `your-domain.com/tags/test`.
|
||||
|
||||
> **Note**
|
||||
> For a tag page to work, the file name (`src/content/tag/*`) must also be in a post's [tags frontmatter.](#post-frontmatter)
|
||||
|
||||
The posts/notes/tags included with this template are there as an example of how to structure your frontmatter. Additionally, the [Astro docs](https://docs.astro.build/en/guides/markdown-content/) has a detailed section on markdown pages.
|
||||
|
||||
### Post Frontmatter
|
||||
|
||||
| Property (\* required) | Description |
|
||||
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| title \* | Self explanatory. Used as the text link to the post, the h1 on the posts' page, and the pages title property. Has a max length of 60 chars, set in `src/content/config.ts` |
|
||||
| description \* | Similar to above, used as the seo description property. Has a min length of 50 and a max length of 160 chars, set in the post schema. |
|
||||
| publishDate \* | Again pretty simple. To change the date format/locale, currently **en-GB**, update the date option in `src/site.config.ts`. Note you can also pass additional options to the component `<FormattedDate>` if required. |
|
||||
| updatedDate | This is an optional date representing when a post has been updated, in the same format as the publishDate. |
|
||||
| tags | Tags are optional with any created post. Any new tag(s) will be shown in `your-domain.com/posts` & `your-domain.com/tags`, and generate the page(s) `your-domain.com/tags/[yourTag]` |
|
||||
| coverImage | This is an optional object that will add a cover image to the top of a post. Include both a `src`: "_path-to-image_" and `alt`: "_image alt_". You can view an example in `src/content/post/testing/cover-image/index.md`. |
|
||||
| ogImage | This is an optional property. An OG Image will be generated automatically for every post where this property **isn't** provided. If you would like to create your own for a specific post, include this property and a link to your image, the theme will then skip automatically generating one. |
|
||||
| draft | This is an optional property as it is set to false by default in the schema. By adding true, the post will be filtered out of the production build in a number of places, inc. getAllPosts() calls, og-images, rss feeds, and generated page[s]. You can view an example in `src/content/post/testing/draft-post.md` |
|
||||
|
||||
### Note Frontmatter
|
||||
|
||||
| Property (\* required) | Description |
|
||||
| ---------------------- | --------------------------------------------------------------------------------------------------------------------- |
|
||||
| title \* | Used as the link text to the note, the pages title property, and the h1 of said note page. Has a max length 60 chars. |
|
||||
| description | Optional. Used for the head meta description property. |
|
||||
| publishDate \* | ISO 8601 format with offsets allowed. |
|
||||
|
||||
### Tag Frontmatter
|
||||
|
||||
| Property (\* required) | Description |
|
||||
| ---------------------- | ------------------------------------------------------------------------------------------------------- |
|
||||
| title | Optional. Used as the h1 on the tags' page, and the pages title property. Has a max length of 60 chars. |
|
||||
| description | Optional. Used for the head meta description and the first paragraph under the h1. |
|
||||
|
||||
### Frontmatter snippets
|
||||
|
||||
Astro Cactus includes a helpful VSCode snippet which creates a frontmatter 'stub' for posts and note's, found here -> `.vscode/post.code-snippets`. Start typing the word `frontmatter` on your newly created .md(x) file to trigger it. Visual Studio Code snippets appear in IntelliSense via (⌃Space) on mac, (Ctrl+Space) on windows.
|
||||
|
||||
## Pagefind search
|
||||
|
||||
This integration brings a static search feature for searching blog posts and notes. In its current form, pagefind only works once the site has been built. This theme adds a postbuild script that should be run after Astro has built the site. You can preview locally by running both build && postbuild.
|
||||
|
||||
Search results only includes pages from posts and notes. If you would like to include other/all your pages, remove/re-locate the attribute `data-pagefind-body` to the article tag found in `src/layouts/BlogPost.astro` and `src/components/note/Note.astro`.
|
||||
|
||||
It also allows you to filter posts by tags added in the frontmatter of blog posts. If you would rather remove this, remove the data attribute `data-pagefind-filter="tag"` from the link in `src/components/blog/Masthead.astro`.
|
||||
|
||||
If you would rather not include this integration, simply remove the component `src/components/Search.astro`, and uninstall both `@pagefind/default-ui` & `pagefind` from package.json. You will also need to remove the postbuild script from here as well.
|
||||
|
||||
You can reduce the initial css payload of your css, [as demonstrated here](https://github.com/chrismwilliams/astro-theme-cactus/pull/145#issue-1943779868), by lazy loading the web components styles.
|
||||
|
||||
## Analytics
|
||||
|
||||
You may want to track the number of visitors you receive to your blog/website in order to understand trends and popular posts/pages you've created. There are a number of providers out there one could use, including web hosts such as [vercel](https://vercel.com/analytics), [netlify](https://www.netlify.com/products/analytics/), and [cloudflare](https://www.cloudflare.com/web-analytics/).
|
||||
|
||||
This theme/template doesn't include a specific solution due to there being a number of use cases and/or options which some people may or may not use.
|
||||
|
||||
You may be asked to included a snippet inside the **HEAD** tag of your website when setting it up, which can be found in `src/layouts/Base.astro`. Alternatively, you can add the snippet in `src/components/BaseHead.astro`.
|
||||
|
||||
## Deploy
|
||||
|
||||
For guidence, the [Astro docs](https://docs.astro.build/en/guides/deploy/) has a great breakdown of how to deploy your own Astro site on various platforms and their idiosyncrasies.
|
||||
|
||||
By default, the theme prerenders all pages and endpoints, with the [`'static'` output](https://docs.astro.build/en/reference/configuration-reference/#output), and the [`'./dist'`](https://docs.astro.build/en/reference/configuration-reference/#outdir) output directory.
|
||||
|
||||
You do not need to add any adapter to use this theme.
|
||||
|
||||
### Cloudflare Workers
|
||||
|
||||
If deploying via Cloudflare Workers, you may have [issues](https://github.com/chrismwilliams/astro-theme-cactus/issues/454) with regards to the OG image endpoints and it requiring a Node environment. To solve this, you will need to add a [Wrangler configuration file](https://developers.cloudflare.com/workers/framework-guides/web-apps/astro/#if-you-have-a-static-site) for a static build.
|
||||
|
||||
```jsonc
|
||||
{
|
||||
"name": "astro-cactus",
|
||||
// Set this to today's date
|
||||
"compatibility_date": "2026-05-11",
|
||||
"assets": {
|
||||
"directory": "./dist",
|
||||
"not_found_handling": "404-page"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Next, run the development server:
|
||||
If you are intending to use the [Clouflare adapter](https://docs.astro.build/en/guides/integrations-guide/cloudflare/), please set the [`prerenderEnvironment`](https://docs.astro.build/en/guides/integrations-guide/cloudflare/#prerenderenvironment) to `'node'`, and follow the [Cloudflare docs](https://developers.cloudflare.com/workers/framework-guides/web-apps/astro/#if-your-site-uses-on-demand-rendering).
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
> Please note the `nodejs_compat` flag, and the main entry point which is incorrect on Cloudflare's docs at the time of writing.
|
||||
|
||||
```jsonc
|
||||
{
|
||||
"name": "astro-cactus",
|
||||
"main": "@astrojs/cloudflare/entrypoints/server",
|
||||
// Set this to today's date
|
||||
"compatibility_date": "2026-05-11",
|
||||
"compatibility_flags": ["global_fetch_strictly_public", "nodejs_compat"],
|
||||
"assets": {
|
||||
"binding": "ASSETS",
|
||||
"directory": "./dist",
|
||||
"not_found_handling": "404-page"
|
||||
},
|
||||
"observability": {
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Finally, open [http://localhost:3000](http://localhost:3000) in your browser to view the website.
|
||||
|
||||
## Customizing
|
||||
|
||||
You can start editing this template by modifying the files in the `/src` folder. The site will auto-update as you edit these files.
|
||||
## Acknowledgment
|
||||
|
||||
This theme was inspired by [Hexo Theme Cactus](https://github.com/probberechts/hexo-theme-cactus)
|
||||
|
||||
## License
|
||||
|
||||
This site template is a commercial product and is licensed under the [Tailwind UI license](https://tailwindui.com/license).
|
||||
|
||||
## Learn more
|
||||
|
||||
To learn more about the technologies used in this site template, see the following resources:
|
||||
|
||||
- [Tailwind CSS](https://tailwindcss.com/docs) - the official Tailwind CSS documentation
|
||||
- [Next.js](https://nextjs.org/docs) - the official Next.js documentation
|
||||
- [Headless UI](https://headlessui.dev) - the official Headless UI documentation
|
||||
- [MDX](https://mdxjs.com) - the MDX documentation
|
||||
MIT
|
||||
|
||||
Reference in New Issue
Block a user