Total Pageviews

Saturday 21 January 2017

搭建基于haskell的静态博客程序CraigStuntz.github.io

先按此文http://briteming.blogspot.jp/2016/07/hakyll.html,安装stack,ghc,hakyll.

cd /usr/local
git clone https://github.com/CraigStuntz/CraigStuntz.github.io
cd CraigStuntz.github.io


root@AR:/usr/local/CraigStuntz.github.io# ls
CNAME        archive.html  feed.xml              publish.sh  tags
LICENSE        atom.xml      images              templates
blog.cabal    index.html         
contact.html  posts              site.hs
about.html    css          presentations.html     
about.markdown    drafts          presentations.markdown  stack.yaml
root@AR:/usr/local/CraigStuntz.github.io#  ghc --make site.hs
root@AR:/usr/local/CraigStuntz.github.io# ls
CNAME        archive.html  feed.xml              publish.sh  tags
LICENSE        atom.xml      images              site      templates
blog.cabal    index.html          site.hi
contact.html  posts              site.hs
about.html    css          presentations.html      site.o
about.markdown    drafts          presentations.markdown  stack.yaml
root@AR:/usr/local/CraigStuntz.github.io# ./site build
root@AR:/usr/local/CraigStuntz.github.io# ls
CNAME        archive.html  feed.xml              publish.sh  tags
LICENSE        atom.xml      images              site      templates
_cache        blog.cabal    index.html          site.hi
_site        contact.html  posts              site.hs
about.html    css          presentations.html      site.o
about.markdown    drafts          presentations.markdown  stack.yaml
root@AR:/usr/local/CraigStuntz.github.io# cd _site
root@AR:/usr/local/CraigStuntz.github.io/_site# ls
about.html    atom.xml    feed.xml  index.html  presentations.html
archive.html  css    images      posts       tags
root@AR:/usr/local/CraigStuntz.github.io/_site#
(可见/usr/local/CraigStuntz.github.io/_site就是静态网站的根目录)

新建源帖:
root@AR:/usr/local/CraigStuntz.github.io/_site# cd ../posts
root@AR:/usr/local/CraigStuntz.github.io/posts# nano 2017-01-21-test-1.markdown
root@AR:/usr/local/CraigStuntz.github.io/posts# cat 2017-01-21-test-1.markdown
---
title: 测试1
tags: misc1, misc2, misc3
---

这是测试1.

看看如何?

root@AR:/usr/local/CraigStuntz.github.io/posts# cd ..
root@AR:/usr/local/CraigStuntz.github.io# ./site build

演示网站:http://cs.bright.biz.st, http://cs.bright.biz.st/archive.html
(奇怪的是发表的新帖并不显示在首页,但是在http://cs.bright.biz.st/archive.html里面有。)
项目地址:https://github.com/CraigStuntz/CraigStuntz.github.io

No comments:

Post a Comment