Total Pageviews

Tuesday 17 January 2017

搭建基于haskell的静态博客程序codetalk.io(这个支持分页)

先按此文http://briteming.blogspot.jp/2016/07/hakyll.html,安装stack和ghc.
cd /usr/local
git clone  https://github.com/codetalkio/codetalk.io
cd codetalk.io

root@AR:/usr/local/codetalk.io#
root@AR:/usr/local/codetalk.io# ls
LICENSE    Setup.hs           posts      src         templates
README.md  codetalk-io.cabal  resources  stack.yaml
root@AR:/usr/local/codetalk.io# stack build
会显示:
...
Linking .stack-work/dist/i386-linux/Cabal-1.24.0.0/build/hakyll/hakyll ...
codetalk-io-1.2.0: copy/register
Installing executable(s) in
/usr/local/codetalk.io/.stack-work/install/i386-linux/nightly-2016-11-26/8.0.1/bin
Completed 147 action(s).
root@AR:/usr/local/codetalk.io# .stack-work/dist/i386-linux/Cabal-1.24.0.0/build/hakyll/hakyll build (这个就是生成/更新静态网站的根目录的命令)
root@AR:/usr/local/codetalk.io# ls
LICENSE    Setup.hs  _site              posts      src         templates
README.md  _cache    codetalk-io.cabal  resources  stack.yaml
root@AR:/usr/local/codetalk.io# cd _site
root@AR:/usr/local/codetalk.io/_site# ls
app.css  archive.html  favicon.ico  index.html  posts  resources  tags
root@AR:/usr/local/codetalk.io/_site#
(可见/usr/local/codetalk.io/_site就是静态网站的根目录)

新建源帖:
root@AR:/usr/local/codetalk.io/_site# cd ..
root@AR:/usr/local/codetalk.io#
root@AR:/usr/local/codetalk.io# cd posts
root@AR:/usr/local/codetalk.io/posts# nano 2017-01-18-test-1.md
root@AR:/usr/local/codetalk.io/posts# cat 2017-01-18-test-1.md
---
title: 测试1
tags: misc1, misc2, misc3
---

这是测试1.


看看如何?
root@AR:/usr/local/codetalk.io/posts# cd ..
root@AR:/usr/local/codetalk.io# .stack-work/dist/i386-linux/Cabal-1.24.0.0/build/hakyll/hakyll build

演示网站: http://ct.bright.biz.st
项目地址:https://github.com/codetalkio/codetalk.io
----------------

 https://github.com/Tehnix

No comments:

Post a Comment