代码地址如下:
http://www.demodashi.com/demo/13147.html

效果

环境配置

环境

  • Windows 10
  • Git Bash

安装ruby

下载rubyinstaller安装:https://rubyinstaller.org/downloads/ (推荐Ruby 2.2.6版本)

$ ruby -v

安装DevKit

下载DevKit.exe:https://rubyinstaller.org/downloads/ ,解压完成后进入目录,init初始化,review检查,成功添加ruby目录后再install

$ ruby dk.rb init
$ ruby dk.rb review
$ ruby dk.rb install

安装Jekyll

切换gem镜像后再安装Jekyll(需要安装bundler)

$ gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/
$ gem sources -l
https://gems.ruby-china.org $ gem install Jekyll
$ gem install bundler

新建博客

$ jekyll new ba-blog
$ jekyll server

模板套用

_config.yml

进行个性化全局配置。

# All possible configuration.
# For more see: http://jekyllrb.com/docs/configuration/
destination: ./_site
lsi: false
port: 4000
highligher: true # Build settings
markdown: rdiscount
rdiscount:
extensions: [smart] # This is the default base url path.
BASE_PATH : / # Website title.
title : Bee Ant<small>Wongjorie's Blog</small> # label listing. [create labels for category in folder `_label`]
# social listing. [create labels for social in folder `_label`]
collections:
- category
- social # This is the default format.
# For more see: http://jekyllrb.com/docs/permalinks/
permalink: /:title # Pagination based on number of posts
# For more see: http://jekyllrb.com/docs/pagination/
#paginate: 20
#paginate_path: "page/:num" ## Author Details ##
###########################
author:
# Info
name: Wong Jorie
role: Computer Programmer
email:
image: images/ba.jpg
# Social
github: joriewong
mail:
# About
about: ""
# copyright
copyright: "Some rights reserved © 2018 Wong Jorie." # Disable custom plugins,and ignore symbolic links..
# For more see: http://jekyllrb.com/docs/configuration/
safe: false
# Jekyll-sitemap auto generate
# For more see: https://github.com/jekyll/jekyll-sitemap
gems:
- jekyll-sitemap

_category目录

1、侧边栏中的博客分类分别对应一个序号-同名.markdown文件,套用格式如下。

---
title: FE
short-description: 前端
permalink: FE
---

2、博客分类在项目根目录下有同名文件夹,其中包含index.md文件,套用格式如下。

---
layout: default
title: FE | 前端
--- <h1>前端</h1>
<hr/> {% for category in site.categories %}
{% if category[0] == "FE" %}
{% for posts in category %}
{% for post in posts %}
{% if post.title %} {% if post.custom-link %}
<h2><a href="{{ post.custom-link }}"><small>{{ post.date | date: "%d %B, %Y" }}</small>{{ post.title }}</a></h2>
{% else %}
<h2><a href="{{ post.url }}"><small>{{ post.date | date: "%d %B, %Y" }}</small>{{ post.title }}</a></h2>
{% endif %}
<p>{{ post.excerpt | truncatewords:25 }}</p>
<hr/> {% endif %}
{% endfor %}
{% endfor %}
{% endif %}
{% endfor %}

_layouts目录

整体布局模板和博文默认模板(无需修改)。

---
layout: default
--- <article>
<h1>{{page.title}}</h1>
<hr/>
{{content}}
</article>

_posts目录

每次撰写博文在此目录下新增.md文件即可,文件命名格式年-月-日-标题名.md,撰写时,文件头可配置博文分类,正文支持Markdown语法。

---
layout: post
title: Trim snippet
categories: [Snippet]
--- 正文部分

_social目录

侧边栏中的社交链接分别对应一个序号-同名.markdown文件,套用格式如下。

---
title: Mail
short-description: If you talk
permalink: "mailto:JieYu.Wang@cisdi.com.cn"
---

首页、订阅配置

首页配置

首页图片为images下ba.jpg,可根据个人喜好随时更换,首页文字在项目根目录下index.html的<pre>标签中编辑。

---
layout: default
title: Bee Ant
---
<!-- 490 x 490 pixels -->
<img src="{{ BASE_PATH }}{{ site.author.image}}" alt="color photo ftl"/>
<!-- <p>Can't find your topic? Use <a href="{{ site.BASE_PATH }}search">Search Page</a></p> -->
<pre> Life isn't always what one likes. </pre>

订阅配置

项目根目录下feed.xml基本已完成RSS模板配置,只需变更一些个人信息即可。

<title>Bee Ant ~ Wongjorie's Blog</title>
...
<author>
<name>Wong Jorie</name>
<email></email>
</author>

演示效果

侧边栏

博文目录

博文详情

项目文件

基于Jekyll的博客模板

代码地址如下:
http://www.demodashi.com/demo/13147.html

注:本文著作权归作者,由demo大师代发,拒绝转载,转载需要作者授权

基于Jekyll的博客模板的更多相关文章

  1. 第41篇 推荐一个jekyll博客模板

    本人用的模板是基于Codeboy的博客模板改造模板,(由于本人可能会有很多样式修改,所以不再将修改pullrequst到原项目,在此对codeboy模板表示感谢).功能改造如下: 添加微信支付宝打赏 ...

  2. 基于Hexo搭建博客并部署到Github Pages

    基于Hexo搭建博客并部署到Github Pages 之前在简书上写东西,觉得自己还是太浮躁.本来打算用Flask自己写一个,以为是微框架就比较简单,naive.HTML.CSS.JS等都要学啊,我几 ...

  3. github page+jekyll搭博客初体验

    div.oembedall-githubrepos { border: 1px solid #DDD; list-style-type: none; margin: 0 0 10px; padding ...

  4. 基于 node 搭建博客系统(一)

    系统分为两端,分别实现. 管理员端: 功能 :个人信息,设置,发布随笔,随笔列表,删除随笔,查找,文章 等. 技术点:Boostrap + AdminLTE; 基于nodejs 实现的express ...

  5. github page+jekyll构建博客的解决方案

    想在github page上构建自己的博客,前几个星期就动手搞了起来,但由于自己对于前端这些东西不是很熟,所以断断续续的,直到今天才把所有东西都搞懂,而且构建出自己的github博客了. 最终效果,大 ...

  6. 给Jekyll静态博客添加ScrollSpy博文大纲目录

    目录 内置TOC 添加ScrollSpy博文menu Scrollnav.js 使用方法❤ 最近又双叒把博客模板换成了Jekyll,Jekyll无论上手难度和修改难度都是目前所见流行模板中最低的(以无 ...

  7. 基于.NetCore开发博客项目 StarBlog - (5) 开始搭建Web项目

    系列文章 基于.NetCore开发博客项目 StarBlog - (1) 为什么需要自己写一个博客? 基于.NetCore开发博客项目 StarBlog - (2) 环境准备和创建项目 基于.NetC ...

  8. 基于.NetCore开发博客项目 StarBlog - (6) 页面开发之博客文章列表

    系列文章 基于.NetCore开发博客项目 StarBlog - (1) 为什么需要自己写一个博客? 基于.NetCore开发博客项目 StarBlog - (2) 环境准备和创建项目 基于.NetC ...

  9. 基于.NetCore开发博客项目 StarBlog - (14) 实现主题切换功能

    系列文章 基于.NetCore开发博客项目 StarBlog - (1) 为什么需要自己写一个博客? 基于.NetCore开发博客项目 StarBlog - (2) 环境准备和创建项目 基于.NetC ...

随机推荐

  1. React入门 (2)—实现微博展示列表

    前言 如果从来不了解React先看前篇React入门 (1)-使用指南(包括ES5和ES6对比). 本文为了能将前篇学到的react知识学以致用,做了一个类似微博展示列表的demo.使用的是ES6+R ...

  2. java网络编程(套接字)

    套接字是java提供一套进行网络通信的API---TCP/UDP: ISO七层模型 物理层 .数据链路层 .传输层-IP. 网络层-UDP/TCP .会话层 . 表示层. 应用层 ---HTTP FT ...

  3. 2017中国大学生程序设计竞赛 - 女生专场A【模拟】

    A HDU - 6023 [题意]:求AC题数和总时长. [分析]:模拟.设置标记数组记录AC与否,再设置错题数组记录错的次数.罚时罚在该题上,该题没AC则不计入总时间,AC则计入.已经AC的题不用再 ...

  4. Codeforces #439 Div2 E

    #439 Div2 E 题意 给出二维平面,有多个询问: 把某一区域围起来(围墙之间无交点) 移除某一区域的围墙(此时保证围墙一定存在) 选定两个位置问是否可以互相到达 分析 看起来很复杂,其实这道题 ...

  5. POJ1258 Agri-Net(Prim)

    Agri-Net Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 51685   Accepted: 21558 Descri ...

  6. 【分块】【线段树】bzoj3212 Pku3468 A Simple Problem with Integers

    线段树入门题…… 因为poj原来的代码莫名RE,所以丧病地写了区间修改的分块…… 其实就是块上打标记,没有上传下传之类. #include<cstdio> #include<cmat ...

  7. [CodeChef-DGTCNT]Chef and Digits

    题目大意: 若一个十进制数$x$(不含前导零)满足数码$i$恰好出现$t_i$次,则这个数是坏的,否则是好的.求区间$[L,R](1\le L,R\le10^{18})$中有多少好数. 思路: 显然可 ...

  8. Mybatis添加用户&&Mybatis添加用户返回ID

    (1)添加用户(添加User记录) <!--插入用户 --> <insert id="insertUser" parameterType="com.so ...

  9. cocoapods更新

    使用sudo gem install cocoapods更新提示: ERROR: While executing gem ... (Errno::EPERM) Operation not permit ...

  10. iOS开发——检测屏幕旋转

    步骤一.注册通知 1: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(statusBarOrien ...