Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jun 20, 2018. It is now read-only.

msbu-tech/msbu-tech.github.io

Repository files navigation

MSBU Tech 团队 GitHub 官方首页。

我想给周刊投稿

安装

  1. Clone

    $ git clone https://github.com/msbu-tech/msbu-tech.github.io.git
    
  2. 初始化 Bundler

    $ bundle install
    
  3. 本地运行

    $ rake serve
    

    http://localhost:4000 进行预览。

对于编辑人员

目录结构

_posts/
 2016年09月08日-msbu-tech-website.md
 ...
_weekly/
 2016年09月06日-weekly.md
 ...
_newsletter/
 2016年09月06日-weekly-email.md
 ...
  • 博客:_posts/
  • 周刊:周刊主体放在 _weekly/,_newsletter/ 用于生成推广邮件

创建周刊

编辑可以自行根据格式创建博客或者周刊。为了方便编辑的工作,我们提供了 rake 来快速创建新周刊。只需要运行:

$ rake weekly:create

就会根据当前时间创建如下周刊所需的文件:

_weekly/2016-10-09-weekly.md
_newsletter/2016-10-09-weekly-email.md

如果需要指定时间,可以使用参数:

$ rake weekly:create[2016年10月09日]

对于 zsh 用户,需要转义:

$ rake weekly:create\[2016年10月09日\]

创建 GitHub Issues 周刊收集贴

$ ACCESS_TOKEN=your-access-token-here rake weekly:open[2016年10月09日]

导入 GitHub Issues 中的周刊

如果已经在 msbu-tech/weekly 中创建好 Issue,可以直接创建并导入周刊文章:

$ ACCESS_TOKEN=your-access-token-here rake weekly:import[2016年10月09日]

编辑周刊

周刊中的文章在 _weekly/ 文件夹中的 .md 文件头部的 Front Matter 中以 yaml 格式存放。_newsletter 中的文章不需要任何编辑,会自动根据 _weekly 中的内容生成。

一般情况下,我们都是编辑最新一期周刊的内容。为了方便,我们提供了一个指令用默认编辑器打开最新一期周刊:

$ rake weekly:edit-latest

它会自动调用环境变量中的 $EDITOR,如果不想用环境变量中的编辑器,可以手动传入:

$ EDITOR=atom rake weekly:edit-latest

周刊 yaml 格式约定如下:

字段 作用 类型 限制
title 文章标题 String 支持 inline html
original 是否为原创 Boolean 可省略,默认 false
link 文章链接 String
comment 文章推荐语 String 支持 inline html
referrer 文章推荐人 String 可省略
tags 文章标签 String Array

测试

为了防止在添加文章时出现低级错误,我们提供了自动化检测。在添加文章发布之前,请运行:

$ rake test-weekly

默认是全量扫描,如果只想扫描某期周刊,可以带日期参数运行:

$ rake test-weekly[2016年11月15日]

对于最新一期,可以使用 latest 参数:

$ rake test-weekly[latest]

如果发现错误,会提示所在文件、文章、出错字段和原因:

[ERROR] Duplicated name within a weekly found:
 Filename: 2016年11月22日-weekly.md
 Item: 1
 >> Name: Google 是如何做到从不宕机的

如果返回"Success.",则证明检测通过,可以发布。

发布周刊

$ ACCESS_TOKEN=your-access-token-here WLIST_CLIENT_ID=your-wunderlist-client-id WLIST_ACCESS_TOKEN=your-wunderlist-access-token rake weekly:publish[2016年10月09日]

对于设计者

模版和样式分别位于 _layouts/css/ 中。

部署

网站基于 GitHub Pages,只需要 git pushmaster 就可以完成部署。

License

About

[Deprecated] MSBU Tech Official Homepage

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /