Git Product home page Git Product logo

astro-blog's Introduction

Astro Blog

Simple blog theme based on Hello Astro but supports only Markdown and does not have the extra integrations. Uses UnoCSS instead of Tailwind.

Uses the following integrations:

  • @astrojs/sitemap
  • @astrojs/rss
  • @astrojs/alpinejs
  • astro-seo
  • astro-robots-txt

Features

  • Full-featured blog with frontmatter (title, description, author, date, image, tags)
  • High performance low overhead with minimal Javascript (AlpineJS)
  • Full text client based search of blog pages via lunrjs (search index only loaded on first invocation of search on a page)
  • Index page and individual pages for authors, categories and tags, including pagination
  • Support for RSS feed, sitemap and robots.txt
  • Full SEO support including Open Graph, Twitter Cards and Schema.org via JSON-LD
  • Full support for Light and dark UI modes, as well as following system preferences, in accordance to TailwindCSS recommendation
  • Customised 404 error page
  • Calculates and show reading time for blog posts
  • CSS/JS assets of external libraries loaded only when needed on a per page and per package basis - no unnecessary bloat
  • Photo gallery and lightbox using PhotoSwipe (including display of EXIF tags)
  • Carousel component using Swiper

External Packages

The start uses the following external packages:

It follows the JAMstack architecture by automatically building a static version from the Git repository. The demo is deployed on Github Pages.

๐Ÿš€ Project Structure

Inside this starter, you'll see the following folders and files:

/
โ”œโ”€โ”€ public/
โ”‚   โ””โ”€โ”€ favicon.ico
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ assets/
โ”‚   โ”‚   โ”œโ”€โ”€ image.png
โ”‚   โ”‚   โ””โ”€โ”€ gallery/
โ”‚   โ”‚       โ””โ”€โ”€ gallery-name/
โ”‚   โ”‚           โ””โ”€โ”€ image.jpg
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ””โ”€โ”€ header.astro
โ”‚   โ”œโ”€โ”€ content/
โ”‚   โ”‚   โ”œโ”€โ”€ blog/
โ”‚   โ”‚   |   โ””โ”€โ”€ 2022-08-01-post.md
โ”‚   โ”‚   โ”œโ”€โ”€ doc/
โ”‚   โ”‚   |   โ””โ”€โ”€ documentation-page.md
|   โ”‚   โ””โ”€โ”€ config.ts
โ”‚   โ”œโ”€โ”€ layouts/
โ”‚   โ”‚   โ”œโ”€โ”€ base.astro
โ”‚   โ”‚   โ”œโ”€โ”€ blog.astro
โ”‚   โ”‚   โ””โ”€โ”€ doc.astro
โ”‚   โ”œโ”€โ”€ pages/
โ”‚   โ”‚   โ”œโ”€โ”€ index.astro
โ”‚   โ”‚   โ””โ”€โ”€ contact.astro
โ”‚   โ””โ”€โ”€ config.ts
โ””โ”€โ”€ package.json

Astro looks for .astro, .md or .mdx files in the src/pages/ directory. Each page is exposed as a route based on its file name.

src/components/ is where we put any Astro components and similarly src/layouts/ for layouts.

Images can be placed in src/assets/.

Blog and documentation content are created as collections of Markdown or MDX files in src/content.

Any static assets, eg. images, can be placed in the public/ directory.

๐Ÿงž Commands

All commands are run from the root of the project, from a terminal:

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
pnpm lint Pretty print the source code
pnpm check Check the source code for errors
pnpm astro ... Run CLI commands like astro add, astro preview
pnpm astro --help Get help using the Astro CLI

Release History

  • 1.0.0: Initial Release

astro-blog's People

Contributors

christinetham 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.