Total Pageviews

Monday 16 January 2017

搭建基于haskell的静态博客程序thetarpit.org

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

cd /usr/local
git clone  https://github.com/spyked/thetarpit.org
cd  thetarpit.org

root@AR:/usr/local/thetarpit.org# ls
403.markdown   contact.markdown        templates
404.markdown        css    thetarpit.cabal
LICENSE       about-2.markdown    index.html      site.hs  uploads
Setup.hs      about.markdown    posts         
root@AR:/usr/local/thetarpit.org# ghc --make site.hs
root@AR:/usr/local/thetarpit.org#./site build
root@AR:/usr/local/thetarpit.org# ls
403.markdown  _cache        contact.markdown  site       templates
404.markdown  _site        css          site.hi  thetarpit.cabal
LICENSE       about-2.markdown    index.html      site.hs  uploads
Setup.hs      about.markdown    posts          site.o
root@AR:/usr/local/thetarpit.org# cd _site
root@AR:/usr/local/thetarpit.org/_site# ls
403.html  about-2.html    archive.html  css      posts    tags
404.html  about.html    contact.html  index.html  rss.xml  uploads
root@AR:/usr/local/thetarpit.org/_site#
(可见/usr/local/thetarpit.org/_site就是静态网站的根目录)

新建源帖:
root@AR:/usr/local/thetarpit.org/_site#  cd ..
root@AR:/usr/local/thetarpit.org# cd posts
root@AR:/usr/local/thetarpit.org/posts#
root@AR:/usr/local/thetarpit.org/posts# ls
y00  y01  y02  y03
root@AR:/usr/local/thetarpit.org/posts# cd y03
root@AR:/usr/local/thetarpit.org/posts/y03# ls
04c-young-boy-brave-man-old-man-hermeticae.markdown
04d-future-of-computing-hardware.markdown
04e-the-myth-of-software-engineering-iii.markdown
04f-freedom-is-slavery.markdown
050-the-new-tarpit.markdown
051-day-of-the-tentacle.markdown
052-on-the-unambiguous-usefulness-of-tools.markdown
053-i-wrote-a-blog.markdown
root@AR:/usr/local/thetarpit.org/posts/y03# nano 054-test-1.markdown
root@AR:/usr/local/thetarpit.org/posts/y03# cat 054-test-1.markdown
---
postid: 054
title: 测试1
date: January 17, 2017
author: brite fisherman
tags: misc1, misc2, misc3
---

这是测试1.

看看如何?

root@AR:/usr/local/thetarpit.org/posts/y03# cd ../..
root@AR:/usr/local/thetarpit.org# ./site build

演示网站:http://ttp2.bright.biz.st(这个是搭建在我的openvz vps上.webserver为apache),
http://ttp.bright.biz.st/ (这个是搭建在我的kvm vps上。webserver为nginx)
项目地址:https://github.com/spyked/thetarpit.org

No comments:

Post a Comment