Skip to content
This repository has been archived by the owner on Nov 16, 2020. It is now read-only.

安装配置

showzeng edited this page Aug 14, 2018 · 2 revisions

基于 gem 包安装

如果你是 基于 gem 包安装 的,你需要先建立以下几个文件。

  1. index.md
---
layout: index
---
  1. articles.md
---
layout: articles
title: 文章
---
  1. archive.md
---
layout: archive
title: 归档
---
  1. categories.md
---
layout: categories
title: 分类
---
  1. about.md
---
layout: about
title: 关于
date: 2018-08-12 21:13:52 +0800
---

这下面填写你的关于页面的内容

这里之所以给关于页面添加 date 信息是因为在开启 gitment 配置时,是使用 date 信息来作为评论的 id 的,所以如果你不会使用到 gitment 评论,你也可以去掉 date 信息

  1. feed.xml
---
permalink: /feed.xml
---

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="https://www.w3.org/2005/Atom" xmlns:dc="https://purl.org/dc/elements/1.1/">
  <channel>
    <title>{{ site.name | xml_escape }}</title>
    <description>{% if site.description %}{{ site.description | xml_escape }}{% endif %}</description>
    <link>{{ site.url }}</link>
    <atom:link href="{{ site.url }}/{{ page.path }}" rel="self" type="application/rss+xml" />
    {% for post in site.posts limit:10 %}
      <item>
        <title>{{ post.title | xml_escape }}</title>
        {% if post.author.name %}
        <dc:creator>{{ post.author.name | xml_escape }}</dc:creator>
        {% endif %}
        <description>{{ post.content | xml_escape }}</description>
        <pubDate>{{ post.date | date_to_rfc822 }}</pubDate>
        <link>{{ site.url }}{{ post.url }}</link>
        <guid isPermaLink="true">{{ site.url }}{{ post.url }}</guid>
      </item>
    {% endfor %}
  </channel>
</rss>

一般你此时的博客结构如下:

myblog/
├── _posts/
|   └── xxxx-xx-xx-xxxxxx.md
├── _site/
├── _config.yml
├── .gitignore
├── about.md
├── archive.md
├── articles.md
├── categories.md
├── feed.xml
├── Gemfile
├── Gemfile.lock
├── index.md
├── README.md

基于模板安装

如果你是 基于模板安装 的,只需将模板文件中的以下文件放入博客文件夹中。

  • about.md
  • archive.md
  • articles.md
  • assets/
  • categories.md
  • feed.xml
  • _includes/
  • index.md
  • _layouts/
  • _sass/

如果文件中已有同名文件,请将其覆盖,同时修改 about.md 里的正文内容为你自己的关于界面介绍。