Skip to content

Commit

Permalink
Update README and CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
jmglov committed Jan 19, 2024
1 parent d2893bf commit d57a216
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ Instances of quickblog can be seen here:
- [Henry Widd's blog](https://widdindustries.com/blog)
- [Anders means different](https://www.eknert.com/blog) - ([source](https://github.com/anderseknert/blog))

## Unreleased

- Add `--date` to api/new. ([@jmglov](https://github.com/jmglov))
- Support Selmer template for new posts in api/new; see [Templates > New
posts](README.md#new-posts) in README. ([@jmglov](https://github.com/jmglov))

## 0.3.6 (2031-12-31)

- Fix caching (this is hard)
Expand Down
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,47 @@ this happens, you won't be able to use the new feature without making the same
modifications to your local templates. The easiest way to do this is to run `bb
quickblog refresh-templates`.

### New posts

In addition to the HTML templates above, you can also use a template for
generating new posts. Assuming you have a template `new-post.md` that looks like
this:

``` markdown
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!
```

you can generate a new post like this:

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

And the resulting `posts/test.md` will look like this:

``` markdown
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!
```

**It is not recommended to keep your new post template in your templates-dir, as
any changes to the new post template will cause all of your existing posts to be
re-rendered, which is probably not what you want!**

## Breaking changes

### posts.edn removed
Expand Down

0 comments on commit d57a216

Please sign in to comment.