Total Pageviews

Tuesday 24 January 2017

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

先按此文http://briteming.blogspot.jp/2016/07/hakyll.html,安装stack,ghc,HAKYLL.
 
cd /usr/local
git clone  https://github.com/rdesfo/desfo.github.io
cd desfo.github.io
 
root@AR:/usr/local/desfo.github.io# cd templates
root@AR:/usr/local/desfo.github.io/templates# nano default.html 
(删除此行: <li role="navigation"><a href="/index.html#About">About</a></li> ,
修改<li role="navigation"><a href="/index.html#Post">Post</a></li>为
<li role="navigation"><a href="/archive.html">Posts</a></li> )
root@AR:/usr/local/desfo.github.io/templates# cd ..
root@AR:/usr/local/desfo.github.io# ghc --make site.hs
root@AR:/usr/local/desfo.github.io# ./site build
root@AR:/usr/local/desfo.github.io# cd _site
root@AR:/usr/local/desfo.github.io/_site# ls
archive.html  css  cv.html  images  index.html posts
root@AR:/usr/local/desfo.github.io/_site#  
(可见/usr/local/desfo.github.io/_site是静态网站的根目录)
 
新建源帖:
root@AR:/usr/local/desfo.github.io/_site# cd ../posts
root@AR:/usr/local/desfo.github.io/posts# nano 2017-01-25-test-1.md
root@AR:/usr/local/desfo.github.io/posts# cat 2017-01-25-test-1.md
---
title: 测试1
author: brite fisherman
---

这是测试1.

看看如何?
root@AR:/usr/local/desfo.github.io/posts# cd ..
root@AR:/usr/local/desfo.github.io# ./site rebuild
 
演示网站:http://df.bright.biz.st
项目地址:https://github.com/rdesfo/desfo.github.io

No comments:

Post a Comment