Pages

Monday, 20 February 2017

搭建基于haskell的静态博客程序mcmtroffaes-homepage

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

cd /usr/local
git clone https://github.com/mcmtroffaes/homepage  mcmtroffaes-homepage
cd mcmtroffaes-homepage

root@AR:/usr/local/mcmtroffaes-homepage# ghc --make site.hs
root@AR:/usr/local/mcmtroffaes-homepage# ./site build
root@AR:/usr/local/mcmtroffaes-homepage# ls
2013       _cache     bib       csl           posts        site     site.o
2014       _site      build.sh       css           research.md  site.hi  templates
README.md  about.rst  contact.rst  index.html  shell.nix    site.hs
root@AR:/usr/local/mcmtroffaes-homepage# cd _site

root@AR:/usr/local/mcmtroffaes-homepage/_site# ls
about.html  blog.html  contact.html  css  index.html  posts
root@AR:/usr/local/mcmtroffaes-homepage/_site# 

(可见/usr/local/mcmtroffaes-homepage/_site就是静态网站的根目录)

新建源帖:
root@AR:/usr/local/mcmtroffaes-homepage/_site# cd ../posts
root@AR:/usr/local/mcmtroffaes-homepage/posts# nano 2017-02-16-test-1.markdown
root@AR:/usr/local/mcmtroffaes-homepage/posts# cat 2017-02-16-test-1.markdown
---
title: 测试1
author: brite fisherman
tags: misc1, misc2, misc3
---

这是测试1.

看看如何?

root@AR:/usr/local/mcmtroffaes-homepage/posts# cd ..

root@AR:/usr/local/mcmtroffaes-homepage# ./site rebuild

演示网站:http://mh.bright.biz.st, http://mh.bright.biz.st/blog.html
项目地址:https://github.com/mcmtroffaes/homepage

No comments:

Post a Comment