跳转到主要内容

有观点的简单静态站点生成器

项目描述

corvid

corvid是一个有观点的简单静态站点生成器。

它处理Markdown文件、静态资源和目录,生成编译内容的1:1层次结构。

它包括可重载的本地开发服务器,支持自定义Markdown前端和Jinja模板。

安装

$ pip install corvid

运行

默认情况下,corvid期望在包含input目录的目录中运行。如果没有参数,corvid将处理此目录中的所有文件到output目录,然后退出。

$ corvid --help
Usage: corvid [OPTIONS]

Options:
  -l, --listen          Enable live reloading
  -b, --bind TEXT       Host to bind to
  -p, --port INTEGER    Port to run on
  -i, --input TEXT      Input directory
  -o, --output TEXT     Output directory
  -t, --templates TEXT  Templates directory
  --help                Show this message and exit.

示例

给定以下目录结构

├── input
│   └── index.md
└── templates
    └── default.html

以下文件内容

input/index.md

---
title: This is the Index
---

Welcome

templates/default.html

<html>
    <head>
        <title>{{ title }}</title>
    <body>
        {{ content }}
    </body>
</body>

运行corvid将产生额外的output目录

.
├── input
│   └── index.md
├── output
│   └── index.html
└── templates
    └── default.html

文件内容如下

output/index.html

<html>
    <head>
        <title>This is the Index</title>
    <head>
    <body>
        <p>Welcome</p>
    </body>
</body>

使用模板

可以通过指定templates目录中模板的路径作为template前端来设置自定义模板。

请参阅/example以获取完整示例。

项目详情


下载文件

下载适用于您的平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分发

corvid-1.1.0.tar.gz (4.4 kB 查看哈希值)

上传时间 源代码

构建发行版

corvid-1.1.0-py3-none-any.whl (9.9 kB 查看哈希值)

上传时间 Python 3

支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面