make rss feeds optional for resources

This commit is contained in:
zyl 2024-11-13 13:11:37 -08:00
parent 95a0765b1e
commit ddeb079d52
Signed by: zyl
SSH key fingerprint: SHA256:uxxbSXbdroP/OnKBGnEDk5q7EKB2razvstC/KmzdXXs
7 changed files with 101 additions and 65 deletions

View file

@ -14,9 +14,10 @@ resources:
resource_template: blog/blog.tera
resource_list_template: blog/list.tera
tag_list_template: basic-link-list.tera
rss_template: blog/rss.tera
rss_title: webdog blog
rss_description: feed of recent webdog blog posts.
rss:
template: blog/rss.tera
title: webdog blog
description: feed of recent webdog blog posts.
list_title: blog
tag_list_title: blog tags
resource_name_plural: blog posts

View file

@ -66,6 +66,9 @@ Arguments:
<ID> The resource type's ID
<NAME> The name of the resource type to create
<PLURAL> The name of the resource type, but plural
Options:
--no-rss Whether to skip enabling RSS for this resource or not
```
## `webdog page new`

View file

@ -73,17 +73,23 @@ the link to actually use for the link.
the link's title.
### `rss_template`
### `rss`
the resource type's rss info. if not present, no rss feed will be built.
consists of the following properties:
#### `template`
the template used to render the resource type's rss feed's html content.
this template is provided a single resource's properties as its properties.
### `rss_title`
#### `title`
the title for the resource type's rss feed.
### `rss_description`
#### `description`
the description for the resource type's rss feed.

View file

@ -6,8 +6,10 @@
{% else %}
<h1>blog Posts</h1>
<p><a href="tags">view blog tags</a></p>
{% if data.rss_enabled %}
<p><a href="rss.xml">rss feed</a></p>
{% endif %}
{% endif %}
<h1>Page {{data.page}}/{{data.page_max}}</h1>
{% if data.previous %}
<a href="./{{data.previous}}">previous page</a>