Pages

Monday, 23 January 2017

搭建基于haskell的静态博客程序edofic-blog

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

cd /usr/local
git clone https://github.com/edofic/blog  edofic-blog
cd edofic-blog

root@AR:/usr/local/edofic-blog# ls
README.md  content  default.nix  generator  shell.nix 
root@AR:/usr/local/edofic-blog#
root@AR:/usr/local/edofic-blog# ls generator
LICENSE  Setup.hs  blog.cabal  site.hs    stack.yaml
root@AR:/usr/local/edofic-blog# cd generator
root@AR:/usr/local/edofic-blog/generator# ls
LICENSE  Setup.hs  blog.cabal  site.hs    stack.yaml
root@AR:/usr/local/edofic-blog/generator# ghc --make site.hs
root@AR:/usr/local/edofic-blog/generator# ls
LICENSE  Setup.hs  blog.cabal  site  site.hi  site.hs  site.o  stack.yaml
root@AR:/usr/local/edofic-blog/generator# cd ../content
root@AR:/usr/local/edofic-blog/content# ls
contact.markdown  files  images      posts  templates
css          icons  index.html 
root@AR:/usr/local/edofic-blog/content# cp /usr/local/edofic-blog/generator/site ./
root@AR:/usr/local/edofic-blog/content# ls
contact.markdown  files  images      posts  templates
css          icons  index.html  site
root@AR:/usr/local/edofic-blog/content# ./site build
root@AR:/usr/local/edofic-blog/content# ls
_cache    contact.markdown  files  images      posts  templates
_site    css          icons  index.html  site
(生成了_site目录)
root@AR:/usr/local/edofic-blog/content# cd _site
root@AR:/usr/local/edofic-blog/content/_site# ls
archive.html  contact.html  css  files    icons  images  index.html  posts  rss.xml
root@AR:/usr/local/edofic-blog/content/_site#

新建源帖:
root@AR:/usr/local/edofic-blog/content/_site# cd ../posts
root@AR:/usr/local/edofic-blog/content/posts# nano 2017-01-23-test-1.markdown
root@AR:/usr/local/edofic-blog/content/posts# cat 2017-01-23-test-1.markdown
---
title: 测试1
---

这是测试1.

看看如何?

root@AR:/usr/local/edofic-blog/content/posts#  cd ..
root@AR:/usr/local/edofic-blog/content# ./site build

演示网站:http://edf.bright.biz.st/
项目地址:https://github.com/edofic/blog

No comments:

Post a Comment