Giter Club home page Giter Club logo

msbu-tech.github.io's Introduction

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

msbu-tech.github.io's People

Contributors

crispgm avatar msbu-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.