Jekyll Last Modified At 插件使用教程
项目目录结构及介绍
jekyll-last-modified-at/
├── _plugins/
│ └── jekyll-last-modified-at.rb
├── lib/
│ ├── jekyll-last-modified-at/
│ │ ├── executor.rb
│ │ ├── git_metadata_generator.rb
│ │ └── version.rb
│ └── jekyll-last-modified-at.rb
├── spec/
│ ├── executor_spec.rb
│ ├── git_metadata_generator_spec.rb
│ └── spec_helper.rb
├── .gitignore
├── .rubocop.yml
├── .ruby-version
├── CHANGELOG.md
├── Gemfile
├── LICENSE.txt
├── README.md
├── Rakefile
└── jekyll-last-modified-at.gemspec
- _plugins/: 存放插件的主要文件
jekyll-last-modified-at.rb
。 - lib/: 包含插件的核心逻辑文件。
- spec/: 包含测试文件。
- .gitignore: Git 忽略文件配置。
- .rubocop.yml: RuboCop 配置文件。
- .ruby-version: Ruby 版本配置。
- CHANGELOG.md: 更新日志。
- Gemfile: Ruby 依赖管理文件。
- LICENSE.txt: 许可证文件。
- README.md: 项目说明文档。
- Rakefile: Rake 任务配置文件。
- jekyll-last-modified-at.gemspec: 插件的 gemspec 文件。
项目的启动文件介绍
项目的启动文件是 _plugins/jekyll-last-modified-at.rb
,该文件负责加载插件并注册到 Jekyll 中。
require 'jekyll-last-modified-at'
项目的配置文件介绍
插件不需要在 _config.yml
中进行特殊配置,只需确保插件文件 jekyll-last-modified-at.rb
位于 _plugins
目录下即可自动加载。
# _config.yml
# 无需特殊配置
通过以上配置,插件会自动检测并显示每个页面的最后修改时间。