靜態網站生成工具:oopress

jopen 11年前發布 | 16K 次閱讀 oopress 建站系統CMS

oopress是一個靜態網站生成工具,使用python開發,用到了markdown、jinja2等第三方庫,在Linux下測試正常。

185237_i97j_940565.png

oopress/
├── _extras
│   └── robots.txt
├── gen_site.py
├── _images
│   └── 2014
│       ├── demo.png
│       └── images.jpeg
├── _layouts
│   ├── cat_index.html
│   ├── default.html
│   ├── error.html
│   ├── index.html
│   ├── page.html
│   ├── post.html
│   ├── post_index.html
│   └── tag_index.html
├── _pages
│   ├── 關于oopress.md
│   ├── 留言本.md
│   └── 音樂墻.md
├── _posts
│   └── 2014
│       └── 04
│           ├── 2014-04-11-測試.md
│           ├── 2014-04-18-使用up2yun.py上傳oopress到upyun.md
│           └── 2014-04-18-簡易指南.md
├── readme.md
├── _site
│   ├── category
│   │   └── index.html
│   ├── error.html
│   ├── images
│   │   └── 2014
│   │       ├── demo.png
│   │       └── images.jpeg
│   ├── index.html
│   ├── post
│   │   ├── 2014
│   │   │   └── 04
│   │   │       ├── 11
│   │   │       │   └── 測試.html
│   │   │       └── 18
│   │   │           └── oopress簡易指南.html
│   │   └── index.html
│   ├── robots.txt
│   ├── static
│   │   ├── default.css
│   │   ├── easing.js
│   │   ├── favicon.png
│   │   ├── jquery-1.7.2.min.js
│   │   ├── jquery.js
│   │   ├── jquery.ui.totop.min.js
│   │   ├── prism.css
│   │   ├── prism.js
│   │   ├── style.css
│   │   ├── ui.totop.css
│   │   └── ui.totop.png
│   ├── tag
│   │   └── index.html
│   ├── 關于oopress.html
│   ├── 留言本.html
│   └── 音樂墻.html
├── _static
│   ├── default.css
│   ├── easing.js
│   ├── favicon.png
│   ├── jquery-1.7.2.min.js
│   ├── jquery.js
│   ├── jquery.ui.totop.min.js
│   ├── prism.css
│   ├── prism.js
│   ├── style.css
│   ├── ui.totop.css
│   └── ui.totop.png
├── tool
│   ├── base.py
│   └── __init__.py
├── up2yun.py
└── up2yun.sh

oopress/_site/目錄下的內容是生成的網站內容。在目錄oopress/_posts/中寫文章(mardown語法),文章應該以下面的形式開頭:

---
title:簡易指南
layout:post
time:2014-04-18 09:00
author:樂天
cat:oopress
tag:oopress,test
---

:右邊是要修改的內容。title指定文章名稱;layout制定使用oopress/_layouts下的哪個模板文件;time指定文章書寫時間,這個必須要有,且應按照上面示例的形式書寫;author指明作者;cat是文章非類;tag是文章標簽。上面的文件在構建靜態網站時候會生成文件oopress/_site/2014/04/18/簡易指南.html

項目主頁:http://www.baiduhome.net/lib/view/home/1397999821875

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!