Total Pageviews

Tuesday, 21 March 2023

静态博客生成器 :基于astro.js的astro-air-blog

 这个项目是「Astro Air Blog」,一个基于 Astro 和 Airtable 的静态博客系统,它使用现代化的技术栈,提供了轻量、快速、易用的博客搭建方式。

Astro Air Blog 使用了以下技术栈:

  • Astro:静态站点生成器,基于标准 Web 组件模型。

  • Airtable:表格和数据库管理工具,用于存储和管理博客文章和元数据。

  • TypeScript:强类型的 JavaScript,提供更好的代码可读性和可维护性。

  • React:用于构建用户界面的 JavaScript 库,提供组件化开发方式。

  • Tailwind CSS:快速构建自定义样式的 CSS 框架。

Astro Air Blog 具有以下主要特点:

  • 快速构建:使用 Astro 和 Airtable 可以快速构建可靠、可维护和高性能的静态站点。

  • 现代化设计:提供现代化的设计和布局,支持响应式设计,适配不同尺寸的屏幕和设备。

  • 丰富的博客功能:提供分类、标签、搜索、评论等丰富的博客功能,方便读者查找和分享博客文章。

  • 易于定制和扩展:使用 Tailwind CSS 可以快速构建自定义样式,使用 React 组件可以方便地扩展和定制博客功能。

     项目地址:https://github.com/austin2035/astro-air-blog

    ------------------

    中文版本说明

    👏🏻 Introduction

    This is a minimalist, beautiful, responsive blogging program written in Astro.

    Preview

    https://yufengbiji.com

    https://astro.yufengbiji.com

     

    Project Structure

    In this Astro project, you'll see the following folders and files:

    |-- README.md
    |-- astro.config.mjs
    |-- package.json
    |-- public
    |   |-- favicon.svg
    |   `-- static
    |-- src
    |   |-- components
    |   |   |-- BaseHead.astro // common <head> tags
    |   |   |-- Footer.astro
    |   |   |-- Header.astro
    |   |   `-- Navigation.astro
    |   |-- consts.js
    |   |-- env.d.ts
    |   |-- layouts
    |   |   |-- BaseLayout.astro
    |   |   |-- MarkdownPost.astro
    |   |   |-- MoreTile.astro
    |   |   `-- Tile.astro
    |   |-- pages
    |   |   |-- about.astro
    |   |   |-- archive.astro
    |   |   |-- index.astro
    |   |   |-- posts 
    |   |   |   |-- some markdown post.md // markdown post 
    |   |   |-- rss.xml.js // RSS feed
    |   |   `-- tags
    |   |       `-- [tag].astro // dynamic route of all posts with a given tag
    |   |-- styles
    |   |   `-- global.css // global styles
    |   `-- utils.js
    

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

    There's nothing special about src/components/, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.

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

    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:3000
    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

    Want to learn more?

    Feel free to check our documentation or jump into our Discord server.

    from  https://github.com/austin2035/astro-air-blog

    (从程序作者的文章https://yufengbiji.com/posts/how-did-I-find-my-ideal-internship可看出

    其2019年上大学,估计是2001年出生) 

    --------------------------------------------------------------------------------------

    Astro Air Blog 详细使用指南

https://docs.astro.build/en/getting-started/

https://docs.astro.build/en/install-and-setup/
 
https://github.com/withastro/astro 
https://github.com/withastro/astro/tree/main/examples

-------------------------------------------------------------------------------

         Dante, a blog for Astro.js.

dante-astro-theme.netlify.app/

Dante - Astro & Tailwind CSS Theme by justgoodui.com

Dante is a single-author blog and portfolio theme for Astro.js. Featuring a minimal, slick, responsive and content-focused design. For more Astro.js themes please check justgoodui.com.

Deploy to Netlify Button

If you click this☝️ button, it will create a new repo for you that looks exactly like this one, and sets that repo up immediately for deployment on Netlify.

Theme Features:

  • ✅ Dark and light color mode
  • ✅ Hero section with bio
  • ✅ Portfolio collection
  • ✅ Pagination support
  • ✅ Post tags support
  • ✅ Subscription form
  • ✅ View transitions
  • ✅ Tailwind CSS
  • ✅ Mobile-first responsive layout
  • ✅ SEO-friendly with canonical URLs and OpenGraph data
  • ✅ Sitemap support
  • ✅ RSS Feed support
  • ✅ Markdown & MDX support

Template Integrations

Project Structure

Inside of Dante Astro theme, you'll see the following folders and files:

├── public/
├── src/
│   ├── components/
│   ├── content/
│   ├── data/
│   ├── icons/
│   ├── layouts/
│   ├── pages/
│   ├── styles/
│   └── utils/
├── astro.config.mjs
├── package.json
├── README.md
├── 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.

There's nothing special about src/components/, but that's where we like to put any Astro (.astro) components.

The src/content/ directory contains "collections" of related Markdown and MDX documents. Use getCollection() to retrieve posts from src/content/blog/, and type-check your frontmatter using an optional schema. See Astro's Content Collections docs to learn more.

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

Astro.js 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

Want to learn more about Astro.js?

Check out our documentation or jump into our Discord server.

Astro Themes by Just Good UI

  • Ovidius is a free single author blog theme.
from https://github.com/JustGoodUI/dante-astro-theme
(访问https://dante-astro-theme.netlify.app/blog/ ,知道这个theme支持换页)
-------------------------------------------------------------------------------------------------

https://github.com/JustGoodUI/ovidius-astro-theme ,另外一个astro theme. visit
https://ovidius-astro-theme.netlify.app/blog/ ,知道这个theme支持换页。
------------------------------------------------------
 
https://github.com/Charca/astro-movies  
------------------------------------------------------

搭建astro-blog-template

$ git clone https://github.com/Charca/astro-blog-template
$ cd astro-blog-template
$ npm install
$ npm audit fix
 $ npm run build (此即生成/更新静态博客网站的命令)
$ ls
LICENSE           dist/              package.json         screenshot.png
README.md         node_modules/      public/              src/
astro.config.mjs  package-lock.json  sandbox.config.json  tsconfig.json 
(生成了dist目录)
$ cd dist
$ ls
_astro/  about/  assets/  blog/  favicon.ico  index.html  robots.txt
(可见dist目录就是静态网站的根目录)
$ python -m http.server 3040
 
访问http://127.0.0.1:3040,即可看到静态博客网站的效果。
 
新建源帖:
cd ../src/data/blog-posts
$ ls
hello-world.md  markdown-test.md
$ cp hello-world.md happy-festival.md
 $ nano happy-festival.md
$ cat happy-festival.md
---
title: 快乐的节日
publishDate: 23 Oct 2024
9:30:00
description: 这是一首歌
---
 
此处写正文或html codes
$ cd ~/astro-blog-template/
$ npm run build

 项目地址:https://github.com/Charca/astro-blog-template
我搭建的示例博客:https://chimerical-fairy-52bc87.netlify.app/ 
--------------------------------------------------------------------------

搭建astro-paper

$ git clone https://github.com/satnaing/astro-paper
$ cd astro-paper
$ npm install
$ npm run build  (此即生成/更新静态博客网站的命令)
$ cd dist
$ /path/to/dist (dist目录就是静态网站的根目录)
 
新建源帖:
cd ~/astro-paper/src/content/blog 
nano happy-festival.md
cat happy-festival.md
显示:
---
title: 快乐的节日
author: brite
pubDatetime: 2024-10-24T08:15:19Z
slug: happy-festival
featured: true
draft: false
tags:
  - music
  - life
ogImage: ""
description: This is a song
---
 
此处写正文或html codes
 
 $ cd ~/astro-paper/
$ npm run build 
项目地址:https://github.com/satnaing/astro-paper
我的示例博客:https://glistening-kitten-f73915.netlify.app/
-------------------

搭建dante-astro-theme

git clone https://github.com/JustGoodUI/dante-astro-theme
cd dante-astro-theme
npm install
npm run build (此即生成/更新静态博客网站的命令)
$ cd dist
$ /path/to/dist (dist目录就是静态网站的根目录)
 
新建源帖:
 cd ~/dante-astro-theme/src/content/blog
nano happy-festival.md 
cat happy-festival.md 
 显示:
---
title: 快乐的节日
excerpt: 这是一首歌
publishDate: 'Oct 24 2024 10:46:00'
tags:
  - music
  - life
---
 
此处写正文或html codes
 
$ cd ~/dante-astro-theme
$ npm run build
 
项目地址:https://github.com/JustGoodUI/dante-astro-theme
我的示例博客:https://resilient-hotteok-139587.netlify.app/blog/ 
---------------------

$ git clone https://github.com/saicaca/fuwari fuwari-site
cd fuwari-site
pnpm install
pnpm build (此即生成/更新静态网站的根目录的命令。)
cd dist
python3 -m http.server 1234
新建源帖:
cd ../src/content/posts
nano happy-festival.md
cat happy-festival.md
显示:
---
title: 快乐的节日
published: 2024-10-30 22:00:00
description: 这是一首歌
tags: [Markdown, life, music]
draft: false
---
 
此处写正文或html codes.
 
cd ~/fuwari-site
pnpm build 

演示网站:https://unique-chimera-1004d6.netlify.app/
项目地址: https://github.com/saicaca/fuwari

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 

 

 
 

 
 

 
 
 

 
 


 



 





No comments:

Post a Comment