Total Pageviews

Friday 31 March 2017

搭建基于纯linux命令的静态博客程序ditto

cd /usr/local
mkdir ditto-site
cd ditto-site

root@localhost:/usr/local/ditto-site# wget https://raw.githubusercontent.com/chutsu/ditto/gh-pages/scripts/install.sh
root@localhost:/usr/local/ditto-site# sh install.sh
会提示:
This script will generate your ditto site by doing the following:
- create a 'docs' folder (will **NOT** overwrite if it exists!)
- download index.html
- create sidebar.md
Do you want to continue? (y/n):
输入y并回车。
root@localhost:/usr/local/ditto-site# ls
docs  index.html  install.sh  sidebar.md
root@localhost:/usr/local/ditto-site#
(可见/usr/local/ditto-site就是静态网站的根目录)

新建源帖:
root@localhost:/usr/local/ditto-site# cd docs
root@localhost:/usr/local/ditto-site/docs# nano test-1.md
root@localhost:/usr/local/ditto-site/docs# cat test-1.md
# 测试1

这是测试1.

看看如何?

root@localhost:/usr/local/ditto-site/docs# cd ..
root@localhost:/usr/local/ditto-site# nano sidebar.md
(在"- [FAQ](#docs/faq)"这行的上方加上一行:“- [测试1](#docs/test-1) ”, 把sidebar.md里的
的第一行里的Your project link改为“/".)
root@localhost:/usr/local/ditto-site# cat sidebar.md
# [Your Project Name](/)

- [因为我爱你](#docs/bilu)
- [稀奇古怪的中国经济](#docs/chinese-economy)
- [测试2](#docs/test-2)
- [测试1](#docs/test-1)

- [FAQ](#docs/faq)
- [API](#docs/api)

## REMOVE THE FOLLOWING COMMENT AFTER YOU READ IT
In the above two links (FAQ and API) ditto will look for files in
'docs/faq.md' and 'docs/api.md'. (i.e. it automatically appends the '.md' to
your links so you don't have to)
root@localhost:/usr/local/ditto-site#

演示网站:http://dt.bright.biz.st/
项目地址:https://github.com/chutsu/ditto
http://chutsu.github.io/ditto/

No comments:

Post a Comment