Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support using a template for quickblog new #87

Open
jmglov opened this issue Jan 19, 2024 · 0 comments
Open

Support using a template for quickblog new #87

jmglov opened this issue Jan 19, 2024 · 0 comments

Comments

@jmglov
Copy link
Contributor

jmglov commented Jan 19, 2024

When creating a new post, I would like to have it look something like this:

Title: Test
Date: 2024-01-19
Tags: clojure
Image: assets/test-preview.png
Image-Alt: FIXME
Discuss: FIXME
Preview: true

Write a blog post here!

Instead of the boring quickblog default:

Title: Test
Date: 2024-01-19
Tags: clojure

Write a blog post here!

If I could but say something like this:

bb quickblog new --file "test.md" --title "Test" --preview --template-file new-post.md

assuming I have a new-post.md template that looks like this:

Title: {{title}}
Date: {{date}}
Tags: {{tags|join:\",\"}}
Image: {% if image %}{{image}}{% else %}{{assets-dir}}/{{file|replace:.md:}}-preview.png{% endif %}
Image-Alt: {{image-alt|default:FIXME}}
Discuss: {{discuss|default:FIXME}}
{% if preview %}Preview: true\n{% endif %}
Write a blog post here!

I would truly be the happiest of men!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant