Total Pageviews

Tuesday 24 January 2017

搭建基于haskell的静态博客程序rgoulter.com(支持分页)

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

cd /usr/local
git clone https://github.com/rgoulter/my-hakyll-blog rgoulter.com
cd rgoulter.com

root@AR:/usr/local/rgoulter.com# ls
README.md          css          new_post.jinja  posts   
emacs.markdown  new_post.py   templates
images          new_post.sh     yi.markdown
cabal.sandbox.config  js          playground   site.hs
root@AR:/usr/local/rgoulter.com# ghc --make site.hs (在当前目录下,会生成可执行文件site)
root@AR:/usr/local/rgoulter.com# git clone https://github.com/rgoulter/my-blog-posts posts
root@AR:/usr/local/rgoulter.com# ./site rebuild
root@AR:/usr/local/rgoulter.com# ls
README.md          css          new_post.jinja  posts    site.o
_cache              emacs.markdown  new_post.py     site     templates
_site              images          new_post.sh     site.hi  yi.markdown
cabal.sandbox.config  js          playground      site.hs
(生成了_site目录)
root@AR:/usr/local/rgoulter.com# cd _site
root@AR:/usr/local/rgoulter.com/_site# ls
10  13    16  4  7  archive.html    css        index.html    tags
11  14    2   5  8  atom.xml    emacs.html  js        yi.html
12  15    3   6  9  categories    images        posts
root@AR:/usr/local/rgoulter.com/_site#
(可见/usr/local/rgoulter.com/_site就是静态网站的根目录)

新建源帖:
root@AR:/usr/local/rgoulter.com/_site# cd ../posts
root@AR:/usr/local/rgoulter.com/posts# ls
2016-09-04-on-wet-shaving.markdown  games  politics  romance
argument                meta   narrative  programming
root@AR:/usr/local/rgoulter.com/posts# mkdir misc
root@AR:/usr/local/rgoulter.com/posts# cd misc
root@AR:/usr/local/rgoulter.com/posts/misc# nano 2017-01-23-test-1.markdown
root@AR:/usr/local/rgoulter.com/posts/misc# cat 2017-01-23-test-1.markdown
---
title: 测试1
author: brite fisherman
tags: misc1, misc2, misc3
---

这是测试1.

看看如何?

root@AR:/usr/local/rgoulter.com/posts/misc# cd ../..
root@AR:/usr/local/rgoulter.com# ./site rebuild

演示网站:http://rgt.bright.biz.st/
项目地址:https://github.com/rgoulter/my-hakyll-blog
https://github.com/rgoulter/my-blog-posts

No comments:

Post a Comment