Coder Social home page Coder Social logo

huhexian / astro-blog Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yuhangch/astro-theme-panda

0.0 0.0 0.0 121 KB

A tiny blog theme for astro.

Home Page: https://astro-theme-panda.vercel.app

JavaScript 19.10% TypeScript 12.63% CSS 15.32% Astro 52.95%

astro-blog's Introduction

Astro Blog Theme: Panda 🐼

git clone https://github.com/yuhangch/astro-theme-panda.git

Key Features

  • Fast, tiny (~30kb), optimized, and awesome pages

Project Structure

Inside of panda🐼 project, you'll focus on these folders and files:

/
β”œβ”€β”€ public/
β”œβ”€β”€ src/
β”‚   └── content/
β”‚       └── posts/
β”‚   └── config.js
└── astro.config.mjs

In config.js, navigate to PandaConfig, you can customize your site for your own needs.

export const PandaConfig = {
    title: 'Panda Blog',
    description: 'Panda Blog, a blog powered by Astro',
    start: '2016',
    site: 'https://astro-theme-panda.vercel.app/',
    defaultLocale: 'en',
    navbar: [
        // {title: 'Posts', url: '/'}, // auto generated
        {title: 'about', url: '/about/'},
    ],
    footer:[
        {title: 'rss', url: '/rss/'},
        {title: 'contact', url: 'https://github.com/yuhangch/astro-theme-panda/issues/new'},
        {title: 'github', url: 'https://github.com/yuhangch/astro-theme-panda'},
    ]
}

More customization

Add a new post

  • Create a new markdown file in src/content/posts/ folder
  • Add the following frontmatter to the top of the file:
---
description: "Your description here"
pubDate: "2024-03-02"
tags: ['markdown','example']
categories: ['tech']
---
  • Write your content below the frontmatter

Add a new page

  • Create a new folder in src/content/ folder
  • Add an index.md file in the new folder
  • Write your content in the index.md file
  • Create your-page-name.astro in src/pages/ folder
  • Reference the src/content/about/about.md and src/pages/about.astro for more details.

Customize the theme

  • Update the src/styles/index.css file to customize the theme
  • Set --color-primary-main and --color-secondary-main in :root and :root.dark to change the theme colors.

Simple language support

  • Set defaultLocale in astro.config.mjs (PandaConfig) to the language you want to use.
  • If you need lang not zh or en, you need to add the language file in src/content/lang/ folder.
  • Reference the src/locates/en.yml and src/utils/locale.ts for more details.

Commands

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

Command Action
npm install Installs dependencies
npm run dev Starts local dev server at localhost:4321
npm run build Build your production site to ./dist/
npm run preview Preview your build locally, before deploying
npm run astro ... Run CLI commands like astro add, astro check
npm run astro -- --help Get help using the Astro CLI

Roadmap

  • The real i18n support.

astro-blog's People

Contributors

yuhangch avatar kelseyshi 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.