Something went wrong. Try again.
Create cover images from Markdown posts
Something went wrong. Try again.
Files
Verified signature Signed by secluded.site SHA256:JBKEeoO/72Fz03rtlzeO49PATFT2maMancH3opcT0h0 Click to copy SHA
Verified signature Signed by secluded.site SHA256:JBKEeoO/72Fz03rtlzeO49PATFT2maMancH3opcT0h0 Click to copy SHA
Verified signature Signed by secluded.site SHA256:JBKEeoO/72Fz03rtlzeO49PATFT2maMancH3opcT0h0 Click to copy SHA
main Default
- Go 100%
README.md
p2c #
Generate cover images from Hugo posts
Usage #
- Install the Go toolchain
- Run
go install secluded.site/p2c@latest - Install the font family you want to use. p2c uses
Heliotrope 4, serifby default and accepts a CSS-style fallback list through--font. - Run the tool from the root of your Hugo site
- Example:
p2c -i content/posts/post.md -o public/post/cover.png
- Example:
$ p2c -h
Usage: p2c [options]
Options:
-f, --font string Font family list used for image text (default "Heliotrope 4, serif")
-h, --help Show the help message
-i, --input string Path to input Markdown
-M, --metasize int Size of font for meta information (default 40)
-o, --output string Path to output PNG
-t, --posttitle string Title displayed in the generated image
-P, --posttitlesize int Size of font for post title (default 60)
-S, --sitetitlesize int Size of font for site title (default 50)
-s, --subtitle string Subtitle displayed in the generated image
example: p2c -i input.md -o output.png
p2c is meant for use with Hugo.
It looks at...
- The Markdown file's frontmatter fields for
- title
- date
- The site's config.{toml/yaml/yml} fields for
- title (site title)
- The file's last modification date according to
the git history, falling back to the filesystem
metadata if git history is not available