Home

Awesome

Showcase Card

<div align="center">

astro-erudite

Stargazers License

</div>

astro-erudite is an opinionated, no-frills static blogging template built with Astro, Tailwind, and shadcn/ui. Extraordinarily loosely based off the Astro Micro theme by trevortylerlee.

[!NOTE] To learn more about why this template exists, read The State of Static Blogs in 2024, where I share my take on what constitutes a great blogging template and my goals while developing this one.


Community Examples

Below are some fantastic examples of websites based on this template. If you wish to add your site to this list, open a pull request!

SiteAuthorDescription/FeaturesSource
enscribe.dev@jktrnHeavily modified bento-style homepage with client interactivity, with custom MDX components!

Features

Technology Stack

This is a list of the various technologies used to build this template:

CategoryTechnology Name
FrameworkAstro
StylingTailwind
Componentsshadcn/ui
ContentMDX
Syntax HighlightingShiki + rehype-pretty-code
GraphicsFigma
DeploymentVercel

Getting Started

  1. Hit “Use this template”, the big green button on the top right, to create a new repository in your own GitHub account with this template.

  2. Clone the repository:

    git clone https://github.com/[YOUR_USERNAME]/[YOUR_REPO_NAME].git
    cd [YOUR_REPO_NAME]
    
  3. Install dependencies:

    npm install
    
  4. Start the development server:

    npm run dev
    
  5. Open your browser and visit http://localhost:1234 to get started. The following commands are also available:

    CommandDescription
    npm run startAlias for npm run dev
    npm run buildRun type checking and build the project
    npm run previewPreviews the built project
    npm run astroRun Astro CLI commands
    npm run prettierBlanket format all files using Prettier

Customization

Site Configuration

Edit the src/consts.ts file to update your site's metadata, navigation links, and social links:

export const SITE: Site = {
  TITLE: 'astro-erudite',
  DESCRIPTION:
    'astro-erudite is a opinionated, no-frills blogging template—built with Astro, Tailwind, and shadcn/ui.',
  EMAIL: 'jason@enscribe.dev',
  NUM_POSTS_ON_HOMEPAGE: 2,
  SITEURL: 'https://astro-erudite.vercel.app',
}

export const NAV_LINKS: Link[] = [
  { href: '/blog', label: 'blog' },
  { href: '/authors', label: 'authors' },
  { href: '/about', label: 'about' },
  { href: '/tags', label: 'tags' },
]

export const SOCIAL_LINKS: Link[] = [
  { href: 'https://github.com/jktrn', label: 'GitHub' },
  { href: 'https://twitter.com/enscry', label: 'Twitter' },
  { href: 'jason@enscribe.dev', label: 'Email' },
  { href: '/rss.xml', label: 'RSS' },
]

Color Palette

Colors are defined in src/styles/global.css in <abbr title="Hue, Saturation, Lightness">HSL</abbr> format, using the shadcn/ui convention:

@layer base {
  :root {
    --background: 0 0% 100%;
    --foreground: 0 0% 3.9%;
    --primary: 0 0% 9%;
    --primary-foreground: 0 0% 98%;
    --secondary: 0 0% 80.1%;
    --secondary-foreground: 0 0% 9%;
    --muted: 0 0% 80.1%;
    --muted-foreground: 0 0% 45.1%;
    --accent: 0 0% 80.1%;
    --accent-foreground: 0 0% 9%;
    --additive: 112 50% 36%; /* Unique to astro-erudite */
    --additive-foreground: 0 0% 98%; /* Unique to astro-erudite */
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 98%;
    --border: 0 0% 89.8%;
    --ring: 0 0% 3.9%;
  }

  .dark {
    /* ... */
  }
  /* ... */
}

Adding Content

Blog Posts

Add new blog posts as MDX files in the src/content/blog/ directory. Use the following frontmatter structure:

---
title: 'Your Post Title'
description: 'A brief description of your post!'
date: 2024-01-01
tags: ['tag1', 'tag2']
image: './image.png'
authors: ['author1', 'author2']
draft: false
---

The blog post schema is defined as follows:

FieldType (Zod)RequirementsRequired
titlestringMust be ≤60 characters.Yes
descriptionstringMust be ≤155 characters.Yes
datecoerce.date()Must be in YYYY-MM-DD format.Yes
imageimage()Must be exactly 1200px × 630px.Optional
tagsstring[]Preferably use kebab-case for these.Optional
authorsstring[]If the author has a profile, use the slug associated with their Markdown file in src/content/authors/ (e.g. if their file is named jane-doe.md, use jane-doe in the array).Optional
draftbooleanDefaults to false if not provided.Optional

Authors

Add author information in src/content/authors/ as Markdown files. A file named [author-name].md can be associated with a blog post if "author-name" (the slug) is added to the authors field:

---
name: 'enscribe'
pronouns: 'he/him'
avatar: 'https://gravatar.com/avatar/9bfdc4ec972793cf05cb91efce5f4aaaec2a0da1bf4ec34dad0913f1d845faf6.webp?size=256'
bio: 'd(-_-)b'
website: 'https://enscribe.dev'
twitter: 'https://twitter.com/enscry'
github: 'https://github.com/jktrn'
mail: 'jason@enscribe.dev'
---

The author schema is defined as follows:

FieldType (Zod)RequirementsRequired
namestringn/aYes
pronounsstringn/aOptional
avatarstring.url()Must be a valid URL. Preferably use Gravatar with the ?size=256 size parameter.Yes
biostringn/aOptional
mailstring.email()Must be a valid email address.Optional
websitestring.url()Must be a valid URL.Optional
twitterstring.url()Must be a valid URL.Optional
githubstring.url()Must be a valid URL.Optional
linkedinstring.url()Must be a valid URL.Optional
discordstring.url()Must be a valid URL.Optional

[!TIP] You can add as many social media links as you want, as long as you adjust the schema! Make sure you also support the new field in the src/components/SocialIcons.astro component.

Projects

Add projects in src/content/projects/ as Markdown files:

---
name: 'Project A'
description: 'This is an example project description! You should replace this with a description of your own project.'
tags: ['Framework A', 'Library B', 'Tool C', 'Resource D']
image: '/static/1200x630.png'
link: 'https://example.com'
---

The project schema is defined as follows:

FieldType (Zod)RequirementsRequired
namestringn/aYes
descriptionstringn/aYes
tagsstring[]n/aYes
imageimage()Must be exactly 1200px × 630px.Yes
linkstring.url()Must be a valid URL.Yes

License

This project is open source and available under the MIT License.


Star History

<a href="https://star-history.com/#jktrn/astro-erudite&Date"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=jktrn/astro-erudite&type=Date&theme=dark" /> <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=jktrn/astro-erudite&type=Date" /> <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=jktrn/astro-erudite&type=Date" /> </picture> </a>

Built with ♥ by enscribe!