Jekyll Whiteglass 主题使用教程

随笔3周前发布
34 0 0

Jekyll Whiteglass 主题使用教程

whiteglassMinimal, responsive Jekyll theme for hackers项目地址:https://gitcode.com/gh_mirrors/wh/whiteglass

1. 项目的目录结构及介绍

Jekyll Whiteglass 主题的目录结构遵循标准的 Jekyll 项目结构。以下是主要目录和文件的介绍:

  1. whiteglass/

  2. ├── _config.yml

  3. ├── _data

  4. │ └── navigation.yml

  5. ├── _includes

  6. │ ├── footer.html

  7. │ ├── head.html

  8. │ ├── header.html

  9. │ └── ...

  10. ├── _layouts

  11. │ ├── default.html

  12. │ ├── home.html

  13. │ ├── page.html

  14. │ └── post.html

  15. ├── _posts

  16. │ └── 2023-01-01-welcome-to-jekyll.markdown

  17. ├── _sass

  18. │ ├── _base.scss

  19. │ ├── _layout.scss

  20. │ └── ...

  21. ├── assets

  22. │ ├── css

  23. │ ├── images

  24. │ └── js

  25. ├── Gemfile

  26. ├── index.html

  27. └── ...

  • _config.yml: 项目的配置文件。
  • _data/navigation.yml: 导航菜单的配置文件。
  • _includes/: 包含可重用的 HTML 片段。
  • _layouts/: 包含页面的布局模板。
  • _posts/: 存放博客文章的目录。
  • _sass/: 包含 SASS 样式文件。
  • assets/: 存放静态资源,如 CSS、图片和 JavaScript 文件。
  • Gemfile: 定义项目依赖的 Gem 文件。
  • index.html: 网站的首页。

2. 项目的启动文件介绍

Jekyll Whiteglass 主题的启动文件主要是 index.html_config.yml

  • index.html: 这是网站的首页文件,它使用 home 布局来展示博客文章列表。
  1. ---

  2. layout: home

  3. ---

  • _config.yml: 这是 Jekyll 项目的主要配置文件,包含了网站的基本设置、插件配置、主题配置等。
  1. title: 你的博客标题

  2. email: 你的邮箱

  3. description: 你的博客描述

  4. baseurl: ""

  5. url: "http://你的域名.com"

  6. theme: jekyll-whiteglass

  7. plugins:

  8. - jekyll-archives

  9. - jekyll-paginate

  10. - jekyll-sitemap

  11. permalink: /:year/:month/:day/:title/

  12. paginate_path: /page:num/

3. 项目的配置文件介绍

Jekyll Whiteglass 主题的配置文件是 _config.yml,它包含了多个配置选项,以下是一些关键配置的介绍:

  • title: 网站的标题。
  • email: 联系邮箱。
  • description: 网站的描述。
  • baseurl: 网站的基本 URL(通常为空字符串)。
  • url: 网站的完整 URL。
  • theme: 使用的主题名称,这里是 jekyll-whiteglass
  • plugins: 启用的 Jekyll 插件列表。
  • permalink: 文章的永久链接格式。
  • paginate_path: 分页路径格式。

通过编辑 _config.yml 文件,你可以自定义网站的外观和行为。例如,你可以添加社交媒体链接、修改导航菜单、配置归档页面等。

希望这份教程能帮助你更好地使用 Jekyll Whiteglass 主题。如果有任何问题,请参考官方文档或社区支持。

whiteglassMinimal, responsive Jekyll theme for hackers项目地址:https://gitcode.com/gh_mirrors/wh/whiteglass

© 版权声明

相关文章

暂无评论

您必须登录才能参与评论!
立即登录
暂无评论...