先按此文http://briteming.blogspot.com/2016/07/haskellghc.html ,安装ghc。
cd /usr/local/
git clone https://github.com/dannysu/hakyll-blog hakyll-blog-by-dannysu
cd hakyll-blog-by-dannysu
root@AR:/usr/local/hakyll-blog-by-dannysu# ls
404.markdown files LICENSE search.markdown
hakyll-blog.cabal pages stack.yaml
css images posts templates
dannysu.github.com index.markdown Rakefile
favicon.ico keybase.txt README.md site.hs
root@AR:/usr/local/hakyll-blog-by-dannysu# ghc --make site.hs
(注意:这里不要运行stack build.运行stack build,一个小时都搞不完而且还可能出错)
root@AR:/usr/local/hakyll-blog-by-dannysu# ls
404.markdown files LICENSE search.markdown site.o
_cache hakyll-blog.cabal pages site stack.yaml
css images posts templates
dannysu.github.com index.markdown Rakefile site.hi
favicon.ico keybase.txt README.md site.hs
(生成了可执行文件site)
root@AR:/usr/local/hakyll-blog-by-dannysu# ./site build (这个就是生成/更新静态网站的命令)
root@AR:/usr/local/hakyll-blog-by-dannysu# ls
404.markdown files LICENSE search.markdown site.o
_cache hakyll-blog.cabal pages site stack.yaml
css images posts _site templates
dannysu.github.com index.markdown Rakefile site.hi
favicon.ico keybase.txt README.md site.hs
(生成了_site目录)
root@AR:/usr/local/hakyll-blog-by-dannysu# cd _site
root@AR:/usr/local/hakyll-blog-by-dannysu/_site# ls
2003 firefox-extensions
2004 german-street-dictionary-compression
2005 home-screen-customizer-for-windows-mobile
2006 html5prj
2007 images
2010 index.html
2011 keybase.txt
2012 label
2013 mangastream-for-windows-phone-7
2014 markdown
2015 msnp11-implementation-for-adium
2016 onebusaway-org-w3c-widget
404.html past-and-present-phones
about-me past-personal-projects
blog recording-feature-for-spwave
css rss.xml
directx-game-engine rst
es1-left-recursive-grammar search.html
es1-non-left-recursive-grammar system-tray-for-evolution
favicon.ico work-experience
files
root@AR:/usr/local/hakyll-blog-by-dannysu/_site#
(/usr/local/hakyll-blog-by-dannysu/_site/里面有index.html,可见/usr/local/hakyll-blog-by-dannysu/_site/就是静态网站的根目录)
新建源贴:
root@AR:/usr/local/hakyll-blog-by-dannysu/_site# cd ..
root@AR:/usr/local/hakyll-blog-by-dannysu# ls
404.markdown files LICENSE search.markdown site.o
_cache hakyll-blog.cabal pages site stack.yaml
css images posts _site templates
dannysu.github.com index.markdown Rakefile site.hi
favicon.ico keybase.txt README.md site.hs
root@AR:/usr/local/hakyll-blog-by-dannysu# cd posts
root@AR:/usr/local/hakyll-blog-by-dannysu/posts# nano 2016-08-19-2131-test-1.markdown
(这里2130指晚上9点31分。注意:源贴的扩展名是markdown,不是md!)
root@AR:/usr/local/hakyll-blog-by-dannysu/posts# cat 2016-08-19-2130-test-1.markdown
---
date: 2016-08-19 21:30:49 PDT
title: 测试1
tags: misc1, misc2, misc3
---
这是测试1.
(注意:程序作者的源贴中的description那一行要删掉,否则所发表的帖子并不会在首页中显示。)
root@AR:/usr/local/hakyll-blog-by-dannysu/posts# cd ..
root@AR:/usr/local/hakyll-blog-by-dannysu# ./site build
演示网站:http://hb.bright.biz.st
项目地址: https://github.com/dannysu/hakyll-blog
cd /usr/local/
git clone https://github.com/dannysu/hakyll-blog hakyll-blog-by-dannysu
cd hakyll-blog-by-dannysu
root@AR:/usr/local/hakyll-blog-by-dannysu# ls
404.markdown files LICENSE search.markdown
hakyll-blog.cabal pages stack.yaml
css images posts templates
dannysu.github.com index.markdown Rakefile
favicon.ico keybase.txt README.md site.hs
root@AR:/usr/local/hakyll-blog-by-dannysu# ghc --make site.hs
(注意:这里不要运行stack build.运行stack build,一个小时都搞不完而且还可能出错)
root@AR:/usr/local/hakyll-blog-by-dannysu# ls
404.markdown files LICENSE search.markdown site.o
_cache hakyll-blog.cabal pages site stack.yaml
css images posts templates
dannysu.github.com index.markdown Rakefile site.hi
favicon.ico keybase.txt README.md site.hs
(生成了可执行文件site)
root@AR:/usr/local/hakyll-blog-by-dannysu# ./site build (这个就是生成/更新静态网站的命令)
root@AR:/usr/local/hakyll-blog-by-dannysu# ls
404.markdown files LICENSE search.markdown site.o
_cache hakyll-blog.cabal pages site stack.yaml
css images posts _site templates
dannysu.github.com index.markdown Rakefile site.hi
favicon.ico keybase.txt README.md site.hs
(生成了_site目录)
root@AR:/usr/local/hakyll-blog-by-dannysu# cd _site
root@AR:/usr/local/hakyll-blog-by-dannysu/_site# ls
2003 firefox-extensions
2004 german-street-dictionary-compression
2005 home-screen-customizer-for-windows-mobile
2006 html5prj
2007 images
2010 index.html
2011 keybase.txt
2012 label
2013 mangastream-for-windows-phone-7
2014 markdown
2015 msnp11-implementation-for-adium
2016 onebusaway-org-w3c-widget
404.html past-and-present-phones
about-me past-personal-projects
blog recording-feature-for-spwave
css rss.xml
directx-game-engine rst
es1-left-recursive-grammar search.html
es1-non-left-recursive-grammar system-tray-for-evolution
favicon.ico work-experience
files
root@AR:/usr/local/hakyll-blog-by-dannysu/_site#
(/usr/local/hakyll-blog-by-dannysu/_site/里面有index.html,可见/usr/local/hakyll-blog-by-dannysu/_site/就是静态网站的根目录)
新建源贴:
root@AR:/usr/local/hakyll-blog-by-dannysu/_site# cd ..
root@AR:/usr/local/hakyll-blog-by-dannysu# ls
404.markdown files LICENSE search.markdown site.o
_cache hakyll-blog.cabal pages site stack.yaml
css images posts _site templates
dannysu.github.com index.markdown Rakefile site.hi
favicon.ico keybase.txt README.md site.hs
root@AR:/usr/local/hakyll-blog-by-dannysu# cd posts
root@AR:/usr/local/hakyll-blog-by-dannysu/posts# nano 2016-08-19-2131-test-1.markdown
(这里2130指晚上9点31分。注意:源贴的扩展名是markdown,不是md!)
root@AR:/usr/local/hakyll-blog-by-dannysu/posts# cat 2016-08-19-2130-test-1.markdown
---
date: 2016-08-19 21:30:49 PDT
title: 测试1
tags: misc1, misc2, misc3
---
这是测试1.
(注意:程序作者的源贴中的description那一行要删掉,否则所发表的帖子并不会在首页中显示。)
root@AR:/usr/local/hakyll-blog-by-dannysu/posts# cd ..
root@AR:/usr/local/hakyll-blog-by-dannysu# ./site build
演示网站:http://hb.bright.biz.st
项目地址: https://github.com/dannysu/hakyll-blog