Git Product home page Git Product logo

astro-theme's Introduction

Astro Theme Cactus logo

Astro Theme Cactus ๐Ÿš€๐ŸŒต

Astro Theme Cactus is a simple opinionated starter built with the Astro framework. Use it to create an easy-to-use blog or website.

๐Ÿ’ป Live Demo hosted on Netlify

Features

Made with Astro, Typescript, and TailwindCSS

  • Astro Fast ๐Ÿš€
  • Accessible, semantic HTML markup
  • Responsive & SEO-friendly
  • Astro Image Integration for optimised images
  • MDX posts
  • Pagination
  • Theming colour modes with Tailwind and CSS variables
  • Shiki code syntax styling
  • Auto-generated sitemap

Quick start

Create a new repo from this template.

Deploy with Netlify Deploy with Vercel

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 preview Preview your build locally, before deploying

Configure

  • Edit config file src/site-meta.config.ts for basic site meta data
  • Update file astro.config.mjs site property with your own domain
  • Replace & update files within the /public folder:
    • favicon.ico
    • /images folder - add your own icon
    • robots.txt - update the Sitemap url to your own domain
    • manifest.webmanifest
  • Modify file src/styles/global.css with your own light and dark styles
  • Create / edit posts for your blog within src/pages/posts/ with .md file(s)
  • Optional:
    • Fonts: This theme sets the body element to the font family font-mono, located in the global css file src/styles/global.css. You can change fonts by removing the variant font-mono, after which TailwindCSS will default to the font-sans font family stack.

Adding posts

Adding a post is a simple as adding your .mdx file(s) to the src/pages/posts/ folder, the name of which will be used as the slug/url. The two posts included with this template can be modified, and give you an example of how to structure your posts. Astro docs also has a detailed section on markdown pages.

Frontmatter

Property (* required) Description
layout This is used to import Markdown Layouts, this theme uses src/layouts/BlogPost.astro as a wrapper for all blog posts.
title * Self explanatory. Used as the text link to the post, the h1 on the posts' page, and the pages' title property
description * Similar to above, used as the seo description property
publishDate * Again pretty simple. To change the date format/locale, currently en-GB, update/pass the locale arg to function getLocaleTime, found in src/util.ts.
tags Tags are optional. Any new tag(s) will be shown in yourdomain.com/posts + yourdomain.com/tags, and generate the page(s) yourdomain.com/tags/[yourTag]

Deploy

Astro docs has a great section and breakdown of how to deploy your own Astro site on various platforms and their idiosyncrasies.

By default the site will be built (see Commands section above) to a /dist directory.

Acknowledgment

This theme is inspired by Hexo Theme Cactus

License

Licensed under the MIT License, Copyright ยฉ 2022

astro-theme's People

Contributors

zero1018 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.