Giter VIP home page Giter VIP logo

itopic.go's Introduction

采用Go语言和Markdown实现的一个简易博客系统,主要包括以下功能:

  • 按日期、按标签展现文章列表
  • 首页、文章详情页
  • 可生成静态页面,配合Github/Coding Pages可实现简单的博客,http://itopic.org 采用此方案。

功能比较简单,不需要依赖数据库,不需要管理后台,使用者只需要关注文章内容的书写即可,同时写好的文章可直接在Github上查看。

安装Golang

从golang.org下载并根据实际路径设置环境变量。

export GOROOT=/usr/local/server/go1.8
export GOPATH=/user/local/server/gopath:/Users/peng/workspace/golang
export PATH=$PATH:$GOROOT/bin

如何写文章?

文章采用Markdown的写法,需要先了解Markdown的写法,基本用法可查看Markdown基本用法。除此之外有几点需要注意:

1、文章放在posts目录中,文件夹可多层嵌套(无影响),文件需以md为后缀,文件名即文章标题。

2、md文件头部需写入文章头部,文章头部和文章正文以换行区分,示例如下:

{
    "url": "markdown",
    "time": "2016/11/01 19:45",
    "tag": "Markdown"
}

文章正文

文章头部采用json来描述文章信息,字段定义如下:

字段 必选 说明
url 文章URL
time 文章发表时间
tag 标签,多个标签用英文逗号分隔
public 为no的时候表示文章不可被浏览器访问到

安装

go get github.com/pengbotao/itopic.go

启动

go run main.go

说明:

  • 不需要生成静态页面时将main.goisCreateHTML设置为false
  • domain用来定义模版页链接前缀,可设置为空

itopic.go's People

Contributors

pengbotao avatar

Watchers

 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.