azrrrrr / azrrrrr.github.io

Azr的博客
MIT License
0 stars 0 forks source link

Build Status

环境

jekyll

开始

你可以通用修改 _config.yml文件来轻松的开始搭建自己的博客:

# Site settings
title: Azrrrrr               # 你的博客网站标题
SEOTitle: Azr的博客 | BY Blog       # SEO 标题
description: "Hey"             # 随便说点,描述一下

# SNS settings      
github_username: azrrrrr     # 你的github账号
jianshu_username: 93d333ac3afd   # 你的简书ID。

# Build settings
# paginate: 10              # 一页你准备放几篇文章

Jekyll官方网站还有很多的参数可以调,比如设置文章的链接形式...网址在这里:Jekyll - Official Site 中文版的在这里:Jekyll中文.

撰写博文

要发表的文章一般以 Markdown 的格式放在这里_posts/,你只要看看这篇模板里的文章你就立刻明白该如何设置。

yaml 头文件长这样:

---
layout:     post
title:      定时器 你真的会使用吗?
subtitle:   iOS定时器详解
date:       2016-12-13
author:     Azrrrrr
header-img: img/post-bg-ios9-web.jpg
catalog:     true
tags:
    - JS
    - 定时器
---

侧边栏

_config.yml文件里面的Sidebar settings那块。

# Sidebar settings
sidebar: true  #添加侧边栏
sidebar-about-description: "简单的描述一下你自己"
sidebar-avatar: /img/avatar-by.jpg     #你的大头贴,请使用绝对地址.注意:名字区分大小写!后缀名也是

侧边栏是响应式布局的,当屏幕尺寸小于992px的时候,侧边栏就会移动到底部。具体请见bootstrap栅格系统 http://v3.bootcss.com/css/

Mini About Me

Mini-About-Me 这个模块将在你的头像下面,展示你所有的社交账号。这个也是响应式布局,当屏幕变小时候,会将其移动到页面底部,只不过会稍微有点小变化,具体请看代码。

Featured Tags

# Featured Tags
featured-tags: true  
featured-condition-size: 1     # A tag will be featured if the size of it is more than this condition value

唯一需要注意的是featured-condition-size: 如果一个标签的 SIZE,也就是使用该标签的文章数大于上面设定的条件值,这个标签就会在首页上被推荐。

内部有一个条件模板 {% if tag[1].size > {{site.featured-condition-size}} %} 是用来做筛选过滤的.

Social-media Account

Friends

好友链接部分。这会在全部页面显示。

设置是在 _config.yml文件里面的Friends那块,自己加吧。

# Friends
friends: [
    {
        title: "Azr",
        href: "https://azrrrrr.github.io/"
    },
    {
        title: "Apple",
        href: "https://apple.com/"
    }
]

参考文档:using jekyll with pages & Upgrading from 2.x to 3.x

致谢

BY fork 的, 感谢这个作者。