静态站点生成器实际上可以使用。
lightweight的Python项目详细描述
轻量级
静态站点生成器我实际上可以使用。
功能
- [X]干净且易于扩展的API
- [X]Jinja2模板
- [X]降价渲染
- []降价链接
- [X]SASS/SCSS渲染
- []RSS/Atom订阅源
- []开发服务器
安装
可从PyPI:
pip install lightweight
快速示例
fromlightweightimportSite,markdown,paths,render,template,sassdefblog_posts():post_template=template('blog-post.html')# Use globs to select files.return(markdown(path,post_template)forpathinpaths('blog/**.md'))site=Site()# Render a Jinja2 template.site.include('index.html',render('index.html'))# Render list of Markdown files.[site.include(f'posts/{post.file.name}.html',post)forpostinblog_posts()]# Render SCSS.site.include('static/css/style.css',sass('static/scss/lightweight.scss'))# Include a copy of a directory.site.include('static/img')# Execute all included content. site.render()