Skip to content

fengjikui/blog-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Auto Blog Generator

自动化博客生成器 - 从 Markdown 生成静态 HTML 博客,支持代码高亮、图片处理和 RSS。

快速开始

安装依赖

npm install

构建博客

npm run build

预览

npm run preview

访问 http://localhost:3000

部署到 GitHub Pages

npm run deploy

目录结构

.
├── config.js           # 配置文件
├── src/
│   ├── index.js        # 主程序入口
│   ├── parser.js       # Markdown 解析
│   ├── highlighter.js  # 代码高亮
│   ├── imageProcessor.js # 图片处理
│   ├── rssGenerator.js # RSS 生成
│   ├── template.js     # 模板渲染
│   └── server.js       # 预览服务器
├── templates/          # EJS 模板
├── content/
│   ├── posts/          # Markdown 文章
│   └── images/         # 图片资源
├── output/             # 生成的静态文件
└── public/             # 静态资源

文章格式

content/posts/ 目录下创建 Markdown 文件:

---
title: 文章标题
date: 2026-03-09
tags: [标签 1, 标签 2]
description: 文章描述
---

# 文章内容

正文内容...

配置

编辑 config.js 修改博客设置:

module.exports = {
  blog: {
    title: '我的博客',
    author: '你的名字',
    url: 'https://yourusername.github.io'
  },
  server: {
    port: 3000
  }
};

技术栈

  • Node.js
  • marked (Markdown 解析)
  • highlight.js (代码高亮)
  • sharp (图片处理)
  • rss (RSS 生成)
  • ejs (模板引擎)
  • express (预览服务器)

License

MIT

About

自动化博客生成器 - Markdown to HTML

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors