File: syndication.md

package info (click to toggle)
staticsite 2.5-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 14,648 kB
  • sloc: javascript: 33,722; python: 9,851; makefile: 46; sh: 4
file content (73 lines) | stat: -rw-r--r-- 2,188 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# syndication: Build syndication feeds for groups of pages.

## Page types

* [rss](../pages/rss.md): A RSS syndication page
* [atom](../pages/atom.md): An Atom syndication page
* [archive](../pages/archive.md): An archive page is automatically created for each syndication.

## Documentation

The Syndication feature implements generation of a [RSS](https://en.wikipedia.org/wiki/RSS)
and [Atom](https://en.wikipedia.org/wiki/Atom_(Web_standard\)) feed for a page
or group of pages.

Add a `syndication` metadata to a page to declare it as the index for a group
of page. RSS and Atom feeds will appear next to the page, containing pages
selected in the `syndication` metadata.

One page is used to define the syndication, using "syndication_*" tags.

Use a data page without type to define a contentless syndication page

## Syndication metadata

Example front page for a blog page:

```yaml
---
pages: blog/*
syndication: yes
template: blog.html
---
# My blog
```

See [metadata documentation](metadata.md) for a reference on the `syndication`
field.

## Syndication of taxonomies

Each category page in each taxonomy automatically defines a syndication
metadata equivalent to this:

```yaml
syndication:
  add_to: no
```

This would automatically generates RSS and Atom feeds with all pages in that
category, but those feed links will only be added to the category page itself.

You can use the `syndication` metadata in your taxonomy categories to customize
titles and description in your categories feeds, like with any other page.


## Templates

See the example templates for working `syndication.rss` and `syndication.atom`
templates, that are used by the generated RSS and Atom pages.

### `syndicated_pages(page=None, limit=None)`

Templates can use the `syndicated_pages` function to list syndicated pages for
a page, sorted with the most recently syndicated first.

`page` can be a page, a path to a page, or omitted, in which case the current
page is used. `page` can also be a list of pages, which will be sorted by
syndiaction date and sampled.

`limit` is the number of pages to return, or, if omitted, all the pages are
returned.

[Back to reference index](../README.md)