npm install nico -g
git clone https://github.com/lepture/nico-boilerplate nico-blog
cd nico-blog
git clone https://github.com/lepture/nico-one _themes/one/ (克隆主题/模板)
as3:~/nico-blog# ls
content ghp-import.py Makefile nico.json README.md _themes
as3:~/nico-blog# nico build (这个就是生成/更新静态网站的命令)
as3:~/nico-blog# ls
content ghp-import.py Makefile nico.json README.md _site _themes
(新出现了_site目录)
as3:~/nico-blog# cd _site
as3:~/nico-blog/_site# ls
feed.xml hello-nico.html index.html page static
(可见~/nico-blog/_site/就是静态网站的根目录。)
as3:~/nico-blog/_site# nohup Rwebserver 35424 > /dev/null &
访问http://as3.brite.biz:35424/就可看到网站效果。
发贴方法:
as3:~/nico-blog/_site# cd ..
as3:~/nico-blog# ls
content ghp-import.py Makefile nico.json README.md _site _themes
as3:~/nico-blog# cd content
as3:~/nico-blog/content# ls
hello-nico.md
as3:~/nico-blog/content# nano test1.md
按hello-nico.md的格式,新建帖子test1.md,格式如下:
# 测试1
- pubdate: 2014-04-15 15:26:00
---
这是测试1.
然后,
as3:~/nico-blog/content# cd ..
as3:~/nico-blog# ls
content ghp-import.py Makefile nico.json README.md _site _themes
as3:~/nico-blog# nico build
as3:~/nico-blog# nano nico.json
把"perpage"的值由30改为5,这样首页只会显示5篇帖子,之前的帖子会出现在第二页。
演示站点:http://as3.brite.biz:35424/, http://nc.brite.biz.st
项目地址:https://github.com/lepture/nico
https://github.com/lepture/nico-boilerplate
文章的链接是不带.html的,如果直接访问是打不开链接的,需做如下操作:
<VirtualHost my-vps-ip:80>
ServerName nc.brite.biz.st
DocumentRoot /root/nico-blog/_site
<Directory /root/nico-blog/_site>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
需加上上述蓝色部分,重启apache即可打开不带.html的链接。我发现建立.htaccess文件有时达不到打开不带.html的链接地址的目的。
git clone https://github.com/lepture/nico-boilerplate nico-blog
cd nico-blog
git clone https://github.com/lepture/nico-one _themes/one/ (克隆主题/模板)
as3:~/nico-blog# ls
content ghp-import.py Makefile nico.json README.md _themes
as3:~/nico-blog# nico build (这个就是生成/更新静态网站的命令)
as3:~/nico-blog# ls
content ghp-import.py Makefile nico.json README.md _site _themes
(新出现了_site目录)
as3:~/nico-blog# cd _site
as3:~/nico-blog/_site# ls
feed.xml hello-nico.html index.html page static
(可见~/nico-blog/_site/就是静态网站的根目录。)
as3:~/nico-blog/_site# nohup Rwebserver 35424 > /dev/null &
访问http://as3.brite.biz:35424/就可看到网站效果。
发贴方法:
as3:~/nico-blog/_site# cd ..
as3:~/nico-blog# ls
content ghp-import.py Makefile nico.json README.md _site _themes
as3:~/nico-blog# cd content
as3:~/nico-blog/content# ls
hello-nico.md
as3:~/nico-blog/content# nano test1.md
按hello-nico.md的格式,新建帖子test1.md,格式如下:
# 测试1
- pubdate: 2014-04-15 15:26:00
---
这是测试1.
然后,
as3:~/nico-blog/content# cd ..
as3:~/nico-blog# ls
content ghp-import.py Makefile nico.json README.md _site _themes
as3:~/nico-blog# nico build
as3:~/nico-blog# nano nico.json
把"perpage"的值由30改为5,这样首页只会显示5篇帖子,之前的帖子会出现在第二页。
演示站点:http://as3.brite.biz:35424/, http://nc.brite.biz.st
项目地址:https://github.com/lepture/nico
https://github.com/lepture/nico-boilerplate
文章的链接是不带.html的,如果直接访问是打不开链接的,需做如下操作:
<VirtualHost my-vps-ip:80>
ServerName nc.brite.biz.st
DocumentRoot /root/nico-blog/_site
<Directory /root/nico-blog/_site>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
需加上上述蓝色部分,重启apache即可打开不带.html的链接。我发现建立.htaccess文件有时达不到打开不带.html的链接地址的目的。