Giter Site home page Giter Site logo

noscripter / linuxtoy.org Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xuxiaodong/linuxtoy.org

0.0 2.0 0.0 5.88 MB

Site source for linuxtoy.org.

Home Page: http://linuxtoy.org

Makefile 7.24% Shell 4.11% Python 23.48% CSS 31.92% JavaScript 1.73% HTML 31.51%

linuxtoy.org's Introduction

linuxtoy.org

这是 LinuxTOY 网站的源代码,原来采用 WordPress,现迁移到 Pelican,其中包括:

  • content:所有文章,为 Markdown 格式
  • themes:Pelican 主题
  • plugins:Pelican 插件
  • pelicanconf.py:Pelican 配置文件
  • develop_server.sh:开发脚本
  • Makefile:Make 构建脚本

如何使用

请参照 Pelican 快速入门 安装 Pelican。

新建文章

为了保持一致性,推荐使用 Markdown 格式,主要包括文章元数据和正文两个部分,例如:

Title: (标题)
Date: 2010-12-03 10:20 (创建日期)
Modified: 2010-12-05 19:30 (修改日期)
Category: Python (分类,只能使用单一分类)
Tags: pelican, publishing (标签,多个以 , 分隔)
Slug: my-super-post (slug,将用于 url,请与文件名保持一致)
Authors: (作者,多个以 , 分隔)
Summary: (摘要)

这是正文。

关于摘要

我们一般把文章第一段作为摘要,但 Pelican 的摘要功能只会将其显示在首页,而文章本身所在页面却并不显示。因此推荐使用以下方式来产生摘要,只需将其添加到第一段之后即可:

<!-- PELICAN_END_SUMMARY -->

添加代码

在撰文时,可对引用代码添加语法高亮显示,记法如下:

A block of text. (正常文本)

    :::identifier (标识符,如 python)
    <code goes here> (具体的代码)

Vim 支持

若你使用 Vim 文本编辑器,那么可以在 .vimrc 中定义如下函数并绑定快捷键 _ + m,这样能够快速生成文章元数据:

"-- Markdown header --"
function! MarkdownHeader()
let date = strftime("%Y-%m-%d %T")
exe "normal iTitle: "
exe "normal oDate: " . date
exe "normal oAuthors: "
exe "normal oCategory: "
exe "normal oTags: "
exe "normal oSlug: "
exe "normal o"
endfunction

nmap _m :call MarkdownHeader()<cr>

欢迎贡献

我们是开放性网站,主要聚焦于 GNU/Linux 和开源,内容包括但不限于新闻、应用、以及提示诸方面,无论是来稿,抑或改善意见,我们都欢迎。

版权许可

本网站文字及图片内容遵循“署名-非商业性使用-相同方式共享 2.5 **大陆”的创作共用协议。

linuxtoy.org's People

Contributors

xuxiaodong avatar xuchunyang avatar croath avatar cofemei avatar

Watchers

James Cloos 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.