Coder Social home page Coder Social logo

whtsky / catsup Goto Github PK

View Code? Open in Web Editor NEW
135.0 15.0 16.0 637 KB

A lightweight static website generator which aims to be simple and elegant.

Home Page: https://catsup.readthedocs.org/en/latest/

License: MIT License

Python 93.52% HTML 6.48%
python static-site-generator static-site-generation static-site-building

catsup's Introduction

Catsup

https://travis-ci.org/whtsky/Catsup.png?branch=develop https://coveralls.io/repos/whtsky/catsup/badge.png?branch=develop

Catsup is a lightweight static website generator which aims to be simple and elegant. Documentation is available at RTFD: https://catsup.readthedocs.org/en/latest/

Quick Start

First, install Catsup via pip

$ pip install catsup

Then, create a new Catsup site

$ mkdir site
$ cd site
$ catsup init

Edit the config file

vim config.json

Write some posts

$ vim posts/hello-world.md
$ cat posts/hello-world.md
# Hello World

- tags: hello world, catsup
- time: 2013-08-30 12:00

---

Hello, World!

Build your site and deploy

catsup build && catsup deploy

For more information, please read the document: https://catsup.readthedocs.org/en/latest/

catsup's People

Contributors

jmpotato avatar messense avatar peixinchen avatar renovate-bot avatar renovate[bot] avatar whtsky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

catsup's Issues

运行catsup themes报错

运行catsup themes会报错

catsup/parser/themes.py", line 67, in list_themes
themes.add(name)
AttributeError: 'tuple' object has no attribute 'add'

我提交了一个pull request尝试进行了修复
#40

Migrate

Catsup will no longer support jeklly style posts.
Instead, we will provide a command like catsup migrate --jeklly to convert your posts to catsup style.

Catsup watch

  • catsup watch -- watch source folder and regenerate

sitemap support

  • Do we really need this?
  • Google can import ATOM as sitemap

add UIModule support

添加对 tornado 的 UIModule 的支持,简化主题逻辑,抽象出公用模块,如评论等等。

难点在于 catsup.deploy 方法中对 UIModule 的处理。

一个问题

hi.
i run commands:(in /root/)

git clone git://github.com/whtsky/catsup.git
cd catsup
python setup.py install

it shows:
....
src/misaka.c:4193: fatal error: error writing to /tmp/cc6ClsOt.s: No space left on device
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1

i use command rm -rf /tmp/*,but i run "python setup.py install" again,i still met the above error.

怎么显示没空间呢?我运行df -h,显示还有600多mb空间,

as3:# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 9.9G 8.8G 608M 94% /
tmpfs 254M 0 254M 0% /lib/init/rw
udev 240M 20K 240M 1% /dev
tmpfs 254M 0 254M 0% /dev/shm
overflow 1.0M 108K 916K 11% /tmp
as3:
#

难道600多mb空间装你这个程序,不够用吗?谢谢回复

死循环问题

如果用户的 .md 文件里没有写 --- ,会导致载入文章产生死循环。

Custom post/page template

在 post meta 中可通过定义 template 来自定义 post/page 渲染用的 template ,若主题中不存在则使用默认的 template。和 WordPress 提供的自定义页面模板功能差不多。

另外,page 类型的 post 目前用的是 post.html 模板来渲染的,觉得应该独立成 page.html 模板来渲染,把当前版本用来生成首页、分页的 page.html 模板重命名成 index.html 或者 home.html 之类。

因为 Catsup 目前的 post meta 并不是定死的那几个,增加自定义页面模板之后主题设计就灵活得多了。

move from wordpress

(env)jyprince@rp:~/catsup$ catsup migrate --wordpress -f 039sblog.wordpress.2013-02-15.xml
[I 130215 08:44:14 wordpress:27] Reading post Hello World
[I 130215 08:44:14 wordpress:27] Reading post 2011.7.28
[I 130215 08:44:14 wordpress:27] Reading post 腾讯十年读后感
[I 130215 08:44:14 wordpress:27] Reading post 中考之后
[I 130215 08:44:14 wordpress:27] Reading post 2011.8.3-黑客
[I 130215 08:44:14 wordpress:27] Reading post 五大怪异**实验(读后感)
[I 130215 08:44:14 wordpress:27] Reading post 在军训之前需要交代的一些遗言
[I 130215 08:44:14 wordpress:27] Reading post 军训归来
[I 130215 08:44:14 wordpress:27] Reading post 电影:土拔鼠日
[I 130215 08:44:14 wordpress:27] Reading post 关于,中医
[I 130215 08:44:14 wordpress:27] Reading post 物是人非
[I 130215 08:44:14 wordpress:27] Reading post JyIM终于算是开始了
[I 130215 08:44:14 wordpress:27] Reading post 即将开学(外加Ubuntu迁移计划)
[I 130215 08:44:14 wordpress:27] Reading post 开学第一天
[I 130215 08:44:14 wordpress:27] Reading post 开学第一天(续篇)
[I 130215 08:44:14 wordpress:27] Reading post 周记:第一篇周记
[I 130215 08:44:14 wordpress:27] Reading post 和空姐同居的日子(读后感)
[I 130215 08:44:14 wordpress:27] Reading post 周记:篮球赛
[I 130215 08:44:14 wordpress:27] Reading post 周记:我看90后
[I 130215 08:44:14 wordpress:27] Reading post 周记:十一见闻
[I 130215 08:44:14 wordpress:27] Reading post 麻木的世界
[I 130215 08:44:14 wordpress:27] Reading post 文科理科的思考
[I 130215 08:44:14 wordpress:27] Reading post 精神病人的世界(读后感)-角色问题
[I 130215 08:44:14 wordpress:27] Reading post 国学知识竞赛的本身以及一些胡思乱想
[I 130215 08:44:14 wordpress:27] Reading post 高一第一次月考成绩以及分析
[I 130215 08:44:14 wordpress:27] Reading post 十六岁生日
[I 130215 08:44:14 wordpress:27] Reading post 2011之年度小结
[I 130215 08:44:14 wordpress:27] Reading post 新年联欢会(附照片视频)
[I 130215 08:44:14 wordpress:27] Reading post 语文期末考试的一篇神作
[I 130215 08:44:14 wordpress:27] Reading post 半个多月了:正视一下自己的期末考试
[I 130215 08:44:14 wordpress:27] Reading post 互联网把人变傻了么
[I 130215 08:44:14 wordpress:27] Reading post 2012.1-随便的一点点总结
[I 130215 08:44:14 wordpress:27] Reading post 小说:阴缘伞
[I 130215 08:44:14 wordpress:27] Reading post 知识的一般性
[I 130215 08:44:14 wordpress:27] Reading post 对“知识的一般性”的一点补充
[I 130215 08:44:14 wordpress:27] Reading post 2012.3-开学啦
[I 130215 08:44:14 wordpress:27] Reading post 有关微博还有强迫症
[I 130215 08:44:14 wordpress:27] Reading post 电影:这个男人来自地球
[I 130215 08:44:14 wordpress:27] Reading post 好久没写日志了
[I 130215 08:44:14 wordpress:27] Reading post 回初中瞧瞧
[I 130215 08:44:14 wordpress:27] Reading post 期中考试作文:丢啥不能丢节操
[I 130215 08:44:14 wordpress:27] Reading post 数学必修三-算法初步
[I 130215 08:44:14 wordpress:27] Reading post 电影:阿凡达
[I 130215 08:44:14 wordpress:27] Reading post 有感而发:你如何看待高考时举报别人作弊的学生?
[I 130215 08:44:14 wordpress:27] Reading post 星座和血型究竟有多么科学
[I 130215 08:44:14 wordpress:27] Reading post 来自田总的吐槽和我那不堪回首的往事
[I 130215 08:44:14 wordpress:27] Reading post 高一下学期期末考试
[I 130215 08:44:14 wordpress:27] Reading post 决定论:上帝不掷骰子
[I 130215 08:44:14 wordpress:27] Reading post 关于人类进化的讨论
[I 130215 08:44:14 wordpress:27] Reading post 关于前天的日志的一点修订
[I 130215 08:44:14 wordpress:27] Reading post 什么是QQ空间体
[I 130215 08:44:14 wordpress:27] Reading post 废旧电池的回收与利用
[I 130215 08:44:14 wordpress:27] Reading post 信不信由你
[I 130215 08:44:14 wordpress:27] Reading post 换了个新主题
[I 130215 08:44:14 wordpress:27] Reading post PHP build-in WebServer
[I 130215 08:44:14 wordpress:27] Reading post 灰常冷门的攻击方式:跨端口窃取Cookie
[I 130215 08:44:14 wordpress:27] Reading post C++讲稿-1.预备知识
[I 130215 08:44:14 wordpress:27] Reading post C++讲稿-2.HelloWorld
[I 130215 08:44:14 wordpress:27] Reading post 自己编译了一下Qt5
[I 130215 08:44:14 wordpress:27] Reading post 理想
[I 130215 08:44:14 wordpress:27] Reading post C++讲稿-3.计算机如何储存数据
[I 130215 08:44:14 wordpress:27] Reading post 近期计划
[I 130215 08:44:14 wordpress:27] Reading post C++讲稿-4.处理数据
[I 130215 08:44:14 wordpress:27] Reading post C++讲稿-5.条件语句
[I 130215 08:44:14 wordpress:27] Reading post C++讲稿-6.循环语句A
[I 130215 08:44:14 wordpress:27] Reading post 友链调整
[I 130215 08:44:14 wordpress:27] Reading post TCP/IP 笔记(1.概述)
Traceback (most recent call last):
File "/home/jyprince/catsup/env/bin/catsup", line 9, in
load_entry_point('catsup==0.0.8', 'console_scripts', 'catsup')()
File "/home/jyprince/catsup/env/local/lib/python2.7/site-packages/catsup-0.0.8-py2.7.egg/catsup/cli.py", line 220, in main
parguments.run()
File "/home/jyprince/catsup/env/local/lib/python2.7/site-packages/parguments-0.2.1-py2.7.egg/parguments/init.py", line 95, in run
result = cmd(args=args)
File "/home/jyprince/catsup/env/local/lib/python2.7/site-packages/parguments-0.2.1-py2.7.egg/parguments/init.py", line 23, in call
self._func(_args, *_kwargs)
File "/home/jyprince/catsup/env/local/lib/python2.7/site-packages/catsup-0.0.8-py2.7.egg/catsup/cli.py", line 216, in migrate
catsup.migrate.wordpress(args)
File "/home/jyprince/catsup/env/local/lib/python2.7/site-packages/catsup-0.0.8-py2.7.egg/catsup/migrate/wordpress.py", line 66, in migrate
os.path.join(output, 'posts'))
File "/home/jyprince/catsup/env/local/lib/python2.7/site-packages/catsup-0.0.8-py2.7.egg/catsup/migrate/wordpress.py", line 52, in write_posts
write(filename, post)
File "/home/jyprince/catsup/env/local/lib/python2.7/site-packages/catsup-0.0.8-py2.7.egg/catsup/migrate/wordpress.py", line 14, in write
with open(os.path.join(folder, filename), 'w') as f:
IOError: [Errno 2] No such file or directory: u'./posts/2012-11-24-TCP/IP-\u7b14\u8bb0(1.\u6982\u8ff0).md'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.