Total Pageviews

Sunday 12 February 2017

搭建又一个基于github issues的静态博客程序slash

首先fork此项目https://github.com/mastermay/Slash,我fork后的项目地址为https://github.com/luckypoem/Slash

然后登陆linux vps,
git clone https://github.com/luckypoem/Slash slash-site
cd slash-site

root@AR:/usr/local/slash-site# ls
LICENSE  README.md  assets  index.html
root@AR:/usr/local/slash-site#
(可见/usr/local/slash-site就是静态网站的根目录)

编辑配置文件config.js:
root@AR:/usr/local/slash-site# cd assets
root@AR:/usr/local/slash-site/assets# ls
config.js      marked.min.js  slash.js           vue-router.min.js
jquery.min.js  slash.css      vue-resource.min.js  vue.js
root@AR:/usr/local/slash-site/assets# nano config.js
root@AR:/usr/local/slash-site/assets# cat config.js
config = {
    blogname: 'Slash blog of brite',    // 博客首页标题
    sep: ' | ',                                        // 博客标题间隔符
    user: 'luckypoem',                        // GitHub 用户名
    repo: 'Slash',                                // GitHub repo 名
    per_page: 3,                                // 每页显示的文章数目,建议不要设置的太大
    duoshuo_id: 'luckypoem'             // 多说二级域名
}

var duoshuoQuery = {
    short_name: config['duoshuo_id']
};
root@AR:/usr/local/slash-site/assets#

然后在新建的 repo(我的为https://github.com/luckypoem/Slash)的issues页面提交 issue 作为博客文章。

演示网站:http://sls.bright.biz.st
项目地址:https://github.com/mastermay/Slash

注:这个程序跟http://briteming.blogspot.com/2017/02/github-issues-github-issues-blog.html不一样,具有github.com账号的人虽然可在你的项目里的issues里面提交issues,但是其内容并不会显示在你的博客里。不知这个程序是怎么做到这点的?

---------------

Slash

A Github issues based blog

简介

利用 issue 写博客,可用此工具提供更好的显示效果。查看演示

使用方法

下载源代码,编辑配置文件 config.js 中的相关参数,新建 repo ,将所有文件 push 到该 repo 的 gh-pages 分支。在新建的 repo 里提交 issue 作为博客文章,同时可使用 label 能给文章添加分类。自定义域名可增加 CNAME 文件。
请严格按照 MarkDown 的格式书写博客,否则显示效果会受影响
config = {
    blogname: 'Slash',  // 博客首页标题
    sep: ' | ',         // 博客标题间隔符
    user: 'mastermay',  // GitHub 用户名
    repo: 'Slash',      // GitHub repo 名
    per_page: 1,        // 每页显示文章数目,建议不要设置的太大
    duoshuo_id: 'slash' // 多说二级域名
}

注意事项

直接 fork 是没有 issues 的,请
  1. clone 编辑后上传;
  2. 或者 fork 后修改 repo 名字。
many thanks to jQuery, vue.js, vue-router, vue-resource, marked.js, 多说.

from https://github.com/mastermay/Slash


   

No comments:

Post a Comment