spress-add-ons/clean-blog-theme

由 Start Bootstrap 设计的 Spress 清洁博客主题

安装: 110

依赖: 0

建议: 0

安全性: 0

星标: 2

关注者: 2

分支: 4

开放问题: 1

语言:JavaScript

类型:spress-theme

v2.1.0 2017-05-21 19:01 UTC

This package is auto-updated.

Last update: 2024-09-13 04:01:34 UTC


README

清洁博客主题是将 Start Bootstrap 设计的主题移植到 Spress 的一个主题。

在线演示.

Spresso theme preview

特性

  • 全响应式。
  • 无干扰的博客文本优化以提高可读性。
  • 支持文章中的标签和分类。
  • getsimpleform 驱动的联系表单。
  • Disqus 驱动的评论。
  • 由于 highlight.js 而代码突出显示。

安装

您可以根据清洁博客创建一个网站,或者将其作为现有网站的主题安装。

要求

  • Spress >= 2.2.0

基于此主题创建新网站

执行以下命令,clean-blog 主题将被安装到 mysite 文件夹中

$ spress new:site mysite spress-add-ons/clean-blog-theme

作为主题安装

转到您的网站文件夹并执行以下命令

$ spress add:plugin spress-add-ons/clean-blog-theme

并将此行添加到您的网站的 config.yml 文件中

themes:
    name: "spress-add-ons/clean-blog-theme"

如何更新?

只需运行以下命令即可获取 Clean blog 主题的最新版本

$ spress update:plugin

内容

布局

指向位于 ./src/layouts 目录内的文件,这些文件定义了内容的架构。

  • default.html:基本布局。派生布局将其内容注入到 {{ page.content }} 行中。
  • page.html:页面布局。
  • post.html:文章布局。它们位于 ./src/content/posts
  • collection.html:集合页面使用的布局:categories.htmltags.html

包含

指向位于 ./src/includes 目录内的代码片段。这些可以插入到布局和页面中。

  • head.html:在默认布局中定义 <head></head> 的内容。
  • footer.html:定义默认页脚部分。
  • nav.html:基于有标题的页面定义顶部菜单。
  • paginator.html:定义内容的分页。

配置

评论

评论由 Disqus 驱动,并需要一个 disqus 短名。要获取它,您需要在此服务中创建一个帐户。这是免费的。

comments:
  enabled: true
  disqus_shortname: "your-shortname"

顶部菜单

顶部菜单由每个有 title 属性的页面组成。例如:./src/content/about.md

title: "About me"

联系表单

联系表单是在 config.yml 中配置的 AJAX 表单。

forms:
    contact:
        getsimpleform_api_token:

您需要从 getsimpleform 服务获取 API 密钥。这是免费的。

撰写文章

要创建新文章,从 Spress 运行 new:post 命令

$ spress new:post

每篇文章都可以有一个标题和缩略图图像。您可以配置您的图像及其一些数据

header_img:
  url: "assets/img/post-bg-07.jpg"
  author: "Yuri Samoilov"
  author_url: "https://flic.kr/p/mjhDwB"

缩略图图像

《index.html》页面可以为每篇帖子显示缩略图。这类图片必须位于./src/content/assets/img文件夹中,且图片尺寸可以是100x100 px

thumb_img键下,您可以设置图片文件名,如下所示

thumb_img: spress.png

许可证

本主题遵循Apache 2.0许可证作为开源软件提供。