Total Pageviews

Wednesday 25 January 2017

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


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

cd /usr/local
git clone https://github.com/IMOKURI/IMOKURI.github.io
cd IMOKURI.github.io

root@AR:/usr/local/IMOKURI.github.io# stack build (因为当前目录下存在stack.yaml)
会显示:
 ...
 Linking .stack-work/dist/i386-linux/Cabal-1.22.5.0/build/site/site ...
IMOKURI-github-io-0.1.0.0: copy/register
Installing executable(s) in
/usr/local/IMOKURI.github.io/.stack-work/install/i386-linux/lts-6.22/7.10.3/bin
Completed 126 action(s).
root@AR:/usr/local/IMOKURI.github.io# .stack-work/dist/i386-linux/Cabal-1.22.5.0/build/site/site rebuild
root@AR:/usr/local/IMOKURI.github.io# ls
404.markdown         _site                  index.html
Build.hs         about.markdown              robots.txt
CNAME             blog                  src
IMOKURI-github-io.cabal  css                  stack.yaml
LICENSE             fonts                  templates
README.md         google393d69a2d334900c.html  tests
_cache             images
root@AR:/usr/local/IMOKURI.github.io# cd _site
root@AR:/usr/local/IMOKURI.github.io/_site# ls
404.html   about  feed                   images       sitemap.xml
CNAME       blog   fonts                   index.html  tags
README.md  css      google393d69a2d334900c.html  robots.txt
root@AR:/usr/local/IMOKURI.github.io/_site#
(可见/usr/local/IMOKURI.github.io/_site就是静态网站的根目录)

新建源帖:
root@AR:/usr/local/IMOKURI.github.io/_site# cd ../blog
root@AR:/usr/local/IMOKURI.github.io/blog# ls
2012  2013  2014  2015    2016   draft  template.markdown
root@AR:/usr/local/IMOKURI.github.io/blog# mkdir -p 2017/01
root@AR:/usr/local/IMOKURI.github.io/blog# cd 2017/01
root@AR:/usr/local/IMOKURI.github.io/blog/2017/01# nano test-1.markdown
root@AR:/usr/local/IMOKURI.github.io/blog/2017/01# cat test-1.markdown
---
date: 2017-01-25 22:30:00
title: 测试1
tags: misc1, misc2, misc3
description: 点击标题,看全文
---

这是测试1.

<!--more-->

看看如何?

root@AR:/usr/local/IMOKURI.github.io/blog/2017/01# cd ../../..
root@AR:/usr/local/IMOKURI.github.io# .stack-work/dist/i386-linux/Cabal-1.22.5.0/build/site/site rebuild

演示网站:http://imkr.bright.biz.st, http://imkr.bright.biz.st/blog
项目地址:https://github.com/IMOKURI/IMOKURI.github.io

No comments:

Post a Comment