Jekyll-Lambda 项目使用教程

Jekyll-Lambda 项目使用教程

jekyll-lambdaAn ascetic theme for Jekyll. Live at http://lauris.github.io项目地址:https://gitcode.com/gh_mirrors/je/jekyll-lambda

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

Jekyll-Lambda 项目的目录结构如下:

jekyll-lambda/
├── _includes/
├── _layouts/
├── _posts/
├── css/
├── images/
├── .gitignore
├── 404.md
├── Gemfile
├── Gemfile.lock
├── LICENSE
├── README.md
├── Rakefile
├── _config.yml
├── about.md
├── feed.xml
└── index.html

目录介绍:

  • _includes/:包含可重用的 HTML 片段。
  • _layouts/:包含页面布局模板。
  • _posts/:包含博客文章。
  • css/:包含样式文件。
  • images/:包含图片资源。
  • .gitignore:指定 Git 忽略的文件和目录。
  • 404.md:404 错误页面。
  • Gemfile:指定项目依赖的 Ruby gems。
  • Gemfile.lock:锁定 gem 版本。
  • LICENSE:项目许可证。
  • README.md:项目说明文档。
  • Rakefile:包含 Rake 任务。
  • _config.yml:Jekyll 配置文件。
  • about.md:关于页面。
  • feed.xml:RSS 订阅源。
  • index.html:项目主页。

2. 项目的启动文件介绍

项目的启动文件是 index.html,它是项目的主页。以下是 index.html 的内容:

---
layout: default
---
<div>
  {% assign index = true %}
  {% for post in paginator.posts %}
    {% assign content = post.content %}
    <article>
      {% include article.html %}
    </article>
  {% endfor %}
  <div class="pagination">
    {% if paginator.previous_page %}
      <a href="{{ paginator.previous_page_path }}" class="previous">Previous</a>
    {% else %}
      <span class="previous">Previous</span>
    {% endif %}
    <span class="page_number ">Page: {{ paginator.page }} of {{ paginator.total_pages }}</span>
    {% if paginator.next_page %}
      <a href="{{ paginator.next_page_path }}" class="next">Next</a>
    {% else %}
      <span class="next ">Next</span>
    {% endif %}
  </div>
</div>

启动文件介绍:

  • layout: default:指定使用 _layouts/default.html 作为布局模板。
  • {% assign index = true %}:设置变量 indextrue
  • {% for post in paginator.posts %}:遍历分页器中的文章。
  • {% include article.html %}:包含 _includes/article.html 文件。
  • div class="pagination":分页导航。

3. 项目的配置文件介绍

项目的配置文件是 _config.yml,它包含了 Jekyll 站点的配置信息。以下是 _config.yml 的部分内容:

title: Jekyll Lambda
description: An ascetic theme for Jekyll
baseurl: "" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site, e.g. http://example.com

markdown: kramdown
highlighter: rouge

gems:
  - jekyll-paginate

paginate: 5
paginate_path: "/page:num/"

permalink: /:year/:month/:day/:title/

exclude:
  - Gemfile
  - Gemfile.lock
  - vendor
  - README.md
  - Rakefile

配置文件介绍:

  • title:站点标题。
  • description:站点描述。
  • baseurl:站点的子路径。
  • url:站点的基本主机名和协议。
  • markdown:使用的 Markdown 解析器。
  • highlighter:代码高亮工具。
  • gems:依赖的 gems。
  • paginate:每页显示的文章数量。

jekyll-lambdaAn ascetic theme for Jekyll. Live at http://lauris.github.io项目地址:https://gitcode.com/gh_mirrors/je/jekyll-lambda

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

庞队千Virginia

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值