Giter Site home page Giter Site logo

blog-astro's Introduction

Blog Astro

一个基于 Astro 的静态博客;

打算仿一个 gridea 主题作为练习:「getgridea/gridea-theme-simple: 一个漂亮的 Gridea 主题 Simple」;

使用

wdssmq/blog-astro: https://github.com/wdssmq/blog-astro

1、使用上面的仓库作为模板,创建一个新的仓库;

2、克隆到本地;

3、安装依赖及运行,推荐使用 pnpm;

pnpm install
# 调试开发
npm run dev
# 构建
npm run build

4、各种说明:

  1. 这东西虽然可以当博客,但并没有一般博客意义上的「主题」规范,姑且仍然尝试将文件放到了 src/theme-simple 目录下,src/pages 则因为 Astro 的限制,只能放外边;
  2. src/theme-simple/config.ts 用于预置和合并配置,自定义则在 src/consts.ts 中;
  3. 文章内容路径为 src/content,可以符号链接或快捷方式到其他地方方便管理;
  4. 内置了一个「关于」页面,路径 src/content/pages/about.md应该是不能删除,其他文件名也并不会被解析为新页面
  5. 「文章」存放于 src/content/blog 路径内,可自行清空后新建;

5、评论设置:

  1. 参考文档部署 Waline 评论系统: https://waline.js.org/
  2. src/consts.ts 中配置 waline 字段:
    waline: {
        enable: true, // 启用评论
        serverURL: "https://your-domain.vercel.app", // 修改为你的评论服务器地址
    },

6、更新:

  1. 克隆或下载 wdssmq/blog-astro 仓库;
  2. 使用 Beyond Compare 或其他工具比较差异;
  3. 按如下说明覆盖文件:
    • src/content/config.ts;「2023-08-26:此文件内配置将从 src/theme-simple/config.ts 引入」
    • src/theme-simple 内所有文件;「2023-08-26:原有的自定义配置复制到新版 src/consts.ts 内」
    • src/pages 内的所有文件;
    • package.json
  4. 额外对比 public astro.config.mjs src/consts.ts 内容;
  5. 重新安装依赖然后调试运行;

推荐:tip. 额外的使用或更新说明 · Issue #4 · wdssmq/blog-astro;「提供了 Beyond Compare 的排除规则」

文档

入门指南 🚀 Astro 文档:

https://docs.astro.build/zh-cn/getting-started/

astro/examples/blog at latest · withastro/astro · GitHub:

https://github.com/withastro/astro/tree/latest/examples/blog?on=github#astro-starter-kit-blog

投喂支持

爱发电:https://afdian.net/a/wdssmq

哔哩哔哩:https://space.bilibili.com/44744006/video「投币或充电」「大会员卡券领取 - bilibili

RSS 订阅:https://feed.wdssmq.com/「言说」RSS 是一种态度!!

在更多平台关注我:https://www.wdssmq.com/guestbook.html#其他出没站点和信息

更多「小代码」:https://cn.bing.com/search?q=小代码+沉冰浮水

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.