Using Pandoc with Static Site Generators
Project description
Using Pandoc with Static Site Generators
This library aims to make it easy to write posts in Pandoc's Markdown and build them to static sites with ANY Static Site Generators (SSG) you want. After specifying the directory structure (pandoc4ssg.DirStruct
) of your static site (depends on the SSG you used) and options for compiling posts (pandoc4ssg.PostHandler
), pandoc4ssg
builds the site for you.
Hugo
Below is an example that builds markdown files located in pandoc_posts/
into a Hugo site. See pandoc4ssg-example for details.
import pandoc4ssg
dir_struct = pandoc4ssg.DirStruct(
tgt_dir_html="content/post",
tgt_dir_tex="public/tex",
pandoc_post_dir="pandoc_posts",
static_tgt=None,
public="public"
)
post_handler = pandoc4ssg.PostHandler(
meta_keep = ["title", "subtitle", "author", "date", "categories", "tags"],
meta_new=[("new_field", True)],
use_toml=False,
output_exts=".html",
output_dir=True,
pandoc_html_extra_args=['--citeproc'],
dir_struct=dir_struct
)
pandoc4ssg.build(ssg_cmd="hugo -D", post_handler=post_handler)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pandoc4ssg-0.0.1.tar.gz
(3.7 kB
view hashes)
Built Distribution
Close
Hashes for pandoc4ssg-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c75d9b56b39dc49342e27157524bbd798d5bb46847d5e20246c2216871cebba8 |
|
MD5 | f2ce47ce01db3570ccc22c0e35bdc0c3 |
|
BLAKE2b-256 | e9630f5593b7942891af1f969d20e136f172610fc7dfbc6330092d24caf134e8 |