Coder Social home page Coder Social logo

jmnzki / astro-minimal-blog Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexanderhodes/astro-minimal-blog

0.0 0.0 0.0 359 KB

Minimalistic blog theme built with astro

Home Page: https://sunny-arithmetic-1e866e.netlify.app

JavaScript 6.50% TypeScript 6.28% CSS 4.42% Astro 82.80%

astro-minimal-blog's Introduction

Minimal blog with tags

Astro minimal blog with tags

Features:

  • Minimal styling
  • Tailwind integrated
  • Sitemap support
  • Robots.txt support
  • RSS Feed support
  • Markdown support
  • Webmanifest for PWA support
  • Compress support
  • Icons support
  • Tags for posts
  • 404 page integrated
  • TypeScript support
  • Dark mode support

Used astro integrations:

Project Structure

Inside this project you can find the following folder and file structure

├── public/
├── src/
│   ├── components/
│   ├── layouts/
│   └── pages/
│   └── styles/
│   └── types/
│   └── utils/
├── astro.config.mjs
├── README.md
├── package.json
├── tailwind.config.cjs
└── tsconfig.json

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

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

Commands

All commands need to be run from the root of the project. The project is setup with yarn. You can as well set it up using npm.

# install dependencies
$ yarn
# start local dev server
$ yarn dev
# build production site
$ yarn build
# preview build locally
$ yarn preview

Adding new tags

For adding new tags to posts you need to add the new tag in the array to the post located in src/pages/blog. For example tags: ["general", "tech", "nature", "new-tag"].

After adding this new tag you need to add this tag into the [tag].astro file that the dynamic route is created and when building the site. Here you need to add the new tag as a param in the getStaticPaths method.

export function getStaticPaths() {
  return [
    { params: { tag: "general" } },
    { params: { tag: "tech" } },
    { params: { tag: "food" } },
    { params: { tag: "nature" } },
    { params: { tag: "astro" } },
    // added this new-tag
    { params: { tag: "new-tag" } },
  ];
}

The tags will be read out of all posts dynamically using the findTags method in src/utils/post.utils.

Credit

This theme is developed based on the Astro blog theme.

astro-minimal-blog's People

Contributors

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