先按此文http://briteming.blogspot.com/2016/07/haskellghc.html ,安装ghc/cabal.
cd /usr/local
git clone https://github.com/yuhama/variadic.me variadic.me-site
cd variadic.me-site
cd /usr/local
git clone https://github.com/yuhama/variadic.me variadic.me-site
cd variadic.me-site
root@AR:/usr/local/variadic.me-site# ls
404.html css index.html README.md templates
about.markdown favicon.ico posts robots.txt
_cache fonts projects.markdown site.hs
root@AR:/usr/local/variadic.me-site# ghc --make site.hs (此命令会生成可执行文件site)
root@AR:/usr/local/variadic.me-site# ls
404.html css index.html README.md site.o templates
about.markdown favicon.ico posts robots.txt site.hi
_cache fonts projects.markdown site site.hs
(生成了可执行文件site)
root@AR:/usr/local/variadic.me-site# ./site build (这个就是生成/更新静态网站的命令)
root@AR:/usr/local/variadic.me-site# ls
404.html css index.html README.md _site site.o
about.markdown favicon.ico posts robots.txt site.hi templates
_cache fonts projects.markdown site site.hs
root@AR:/usr/local/variadic.me-site# cd _site
root@AR:/usr/local/variadic.me-site/_site# ls
404.html css fonts posts projects.html rss.xml
about.html favicon.ico index.html posts.html robots.txt tags
root@AR:/usr/local/variadic.me-site/_site#
(可见/usr/local/variadic.me-site/_site/就是静态网站的根目录)
新建源贴:
root@AR:/usr/local/variadic.me-site/_site# cd ..
root@AR:/usr/local/variadic.me-site# ls
404.html css index.html README.md _site site.o
about.markdown favicon.ico posts robots.txt site.hi templates
_cache fonts projects.markdown site site.hs
root@AR:/usr/local/variadic.me-site# cd posts
root@AR:/usr/local/variadic.me-site/posts#
root@AR:/usr/local/variadic.me-site/posts# nano 2016-08-19-1400-test-1.markdown
(格式如下:
---
title: 测试1
date: August 19, 2016
tags: misc1, misc2
---
这是测试1. )
root@AR:/usr/local/variadic.me-site/posts# cd ..
root@AR:/usr/local/variadic.me-site# ./site build
演示网站:http://surmount.biz.st:5498,http://vd.smt.biz.st
项目地址:https://github.com/yuhama/variadic.me
相关帖子:http://briteming.blogspot.com/2016/08/hakylljavrania.html,跟此帖子的操作几乎一样。