Jekyll Static Comments 开源项目教程
1. 项目的目录结构及介绍
Jekyll Static Comments 项目的目录结构如下:
jekyll-static-comments/
├── _includes/
│ └── static-comments.html
├── _layouts/
│ └── comment.html
├── _plugins/
│ └── static_comments.rb
├── _posts/
│ └── comments/
├── assets/
│ └── css/
│ └── static-comments.css
├── .gitignore
├── Gemfile
├── Gemfile.lock
├── LICENSE
├── README.md
└── example/
├── _config.yml
├── _posts/
├── index.html
└── static-comments.yml
目录结构介绍
_includes/
:包含用于插入静态评论的 HTML 文件。_layouts/
:包含评论的布局模板。_plugins/
:包含用于处理静态评论的 Jekyll 插件。_posts/
:包含评论的 Markdown 文件。assets/
:包含静态资源,如 CSS 文件。example/
:包含示例项目的配置和文件。.gitignore
:Git 忽略文件。Gemfile
和Gemfile.lock
:Ruby 依赖管理文件。LICENSE
:项目许可证。README.md
:项目说明文档。static-comments.yml
:静态评论的配置文件。
2. 项目的启动文件介绍
Jekyll Static Comments 项目的启动文件主要是 example/index.html
和 example/_config.yml
。
example/index.html
这是示例项目的入口文件,包含了如何加载和显示静态评论的示例代码。
example/_config.yml
这是 Jekyll 的配置文件,包含了项目的全局配置,如站点 URL、插件配置等。
3. 项目的配置文件介绍
Jekyll Static Comments 项目的配置文件主要是 static-comments.yml
和 example/_config.yml
。
static-comments.yml
这是静态评论的配置文件,包含了评论系统的具体配置,如评论存储路径、评论模板等。
example/_config.yml
这是 Jekyll 的配置文件,包含了项目的全局配置,如站点 URL、插件配置等。在这个文件中,你需要确保插件 static_comments
被正确加载。
plugins:
- jekyll-static-comments
通过这些配置文件,你可以自定义和调整静态评论系统的功能和外观。