Total Pageviews

Friday 13 January 2017

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

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

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

root@AR:/usr/local/montagy.github.io# ls
LICENSE  about.rst  index.html     posts  stack.yaml
apps.html  js       reflexapp.html  site.hs  templates
css        montagy.cabal            
root@AR:/usr/local/montagy.github.io# ghc --make site.hs
root@AR:/usr/local/montagy.github.io# ./site build
root@AR:/usr/local/montagy.github.io# cd _site
root@AR:/usr/local/montagy.github.io/_site# ls
about.html  apps.html  blog.html  css  index.html  js  posts  reflexapp.html
root@AR:/usr/local/montagy.github.io/_site#
(可见/usr/local/montagy.github.io/_site就是静态网站的根目录)

新建源帖:
root@AR:/usr/local/montagy.github.io/_site#  cd ../posts
root@AR:/usr/local/montagy.github.io/posts# nano 2017-01-14-test-1.markdown
root@AR:/usr/local/montagy.github.io/posts# cat 2017-01-14-test-1.markdown
---
title: 测试1
---

这是测试1.

看看如何?

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

演示网站:http://mtg.bright.biz.st
项目地址:https://github.com/montagy/montagy.github.io

No comments:

Post a Comment