Commit graph

51 commits

Author SHA1 Message Date
Chris Morgan
4653e68715 Add lang, taxonomy and term to feed template
Also a FIXME on the rebuilding part, because it’s presently very wrong.
2020-04-14 17:29:51 +05:30
Chris Morgan
e25915b231 Support and default to generating Atom feeds
This includes several breaking changes, but they’re easy to adjust for.

Atom 1.0 is superior to RSS 2.0 in a number of ways, both technical and
legal, though information from the last decade is hard to find.
http://www.intertwingly.net/wiki/pie/Rss20AndAtom10Compared
has some info which is probably still mostly correct.

How do RSS and Atom compare in terms of implementation support? The
impression I get is that proper Atom support in normal content websites
has been universal for over twelve years, but that support in podcasts
was not quite so good, but getting there, over twelve years ago. I have
no more recent facts or figures; no one talks about this stuff these
days. I remember investigating this stuff back in 2011–2013 and coming
to the same conclusion. At that time, I went with Atom on websites and
RSS in podcasts. Now I’d just go full Atom and hang any podcast tools
that don’t support Atom, because Atom’s semantics truly are much better.

In light of all this, I make the bold recommendation to default to Atom.

Nonetheless, for compatibility for existing users, and for those that
have Opinions, I’ve retained the RSS template, so that you can escape
the breaking change easily.

I personally prefer to give feeds a basename that doesn’t mention “Atom”
or “RSS”, e.g. “feed.xml”. I’ll be doing that myself, as I’ll be using
my own template with more Atom features anyway, like author information,
taxonomies and making the title field HTML.

Some notes about the Atom feed template:

- I went with atom.xml rather than something like feed.atom (the .atom
  file format being registered for this purpose by RFC4287) due to lack
  of confidence that it’ll be served with the right MIME type. .xml is a
  safer default.

- It might be nice to get Zola’s version number into the <generator>
  tag. Not for any particularly good reason, y’know. Just picture it:

    <generator uri="https://www.getzola.org/" version="0.10.0">
	Zola
    </generator>

- I’d like to get taxonomies into the feed, but this requires exposing a
  little more info than is currently exposed. I think it’d require
  `TaxonomyConfig` to preferably have a new member `permalink` added
  (which should be equivalent to something like `config.base_url ~ "/" ~
  taxonomy.slug ~ "/"`), and for the feed to get all the taxonomies
  passed into it (`taxonomies: HashMap<String, TaxonomyTerm>`).
  Then, the template could be like this, inside the entry:

    {% for taxonomy, terms in page.taxonomies %}
        {% for term in terms %}
            <category scheme="{{ taxonomies[taxonomy].permalink }}"
		term="{{ term.slug }}" label="{{ term.name }}" />
	{% endfor %}
    {% endfor %}

Other remarks:

- I have added a date field `extra.updated` to my posts and include that
  in the feed; I’ve observed others with a similar field. I believe this
  should be included as an official field. I’m inclined to add author to
  at least config.toml, too, for feeds.
- We need to have a link from the docs to the source of the built-in
  templates, to help people that wish to alter it.
2020-04-14 17:27:08 +05:30
Sam Ford
e804f907b2 Use Rust 2018 edition (#885) 2020-02-02 17:48:43 -08:00
Vincent Prouillet
73ea4b3b16 Finish path collision & fix paginate_path when empty
Closes #866
2020-02-02 17:48:43 -08:00
Tjeu Kayim
6149fd17e1 Skip anchor checking for URL with prefix in config (#812)
* cargo fmt & clippy

* Skip anchor checking for URL with prefix in config
2020-02-02 17:45:16 -08:00
Bob
e77adc56fd Fix the issue when checking the changes for multiple language section index file (#787)
* Fix the issue when checking the changes of multiple language section
2019-08-30 15:44:57 +02:00
Vincent Prouillet
fb89f94516 Process images on rebuild
Closes #790
2019-08-29 20:08:04 +02:00
Vincent Prouillet
7f459940e1 Allow multiple taxonomies with same name in different language
Closes #766
2019-08-10 18:54:32 +02:00
Vincent Prouillet
e74dab535d Update deps & re-render on anchor-link.html changes
Closes #719
2019-08-08 00:37:38 +02:00
Pyry Kovanen
4b43b75d22 Allow ignored_content to support markdown files (#759)
* Allow ignored_content to support markdown files

* Add test for markdown supported ignored_content
2019-08-01 10:18:42 +02:00
Sébastien Mariaux
2a0d0b9b77 Split sitemap (#619)
Split sitemap when it is getting too big
2019-03-14 20:57:22 +01:00
Vincent Prouillet
eccb1e9986 Strip base_path from page/section paths
To ensure we will get the right `content`
directory.
Fix #629
2019-03-08 23:30:43 +01:00
Vincent Prouillet
974492bb7b Ensure we don't delete root index without
adding back default in rebuild

Fix #620
2019-02-22 21:48:31 +01:00
Vincent Prouillet
84f10f6b69 Use platform separator for shortcodes paths 2019-02-16 16:32:11 +01:00
Vincent Prouillet
25b943ec35 Print list of template names to debug Windows error 2019-02-16 15:40:59 +01:00
Vincent Prouillet
9bc675f2a7 Fix colocated dates + rustfmt
Closes #607
2019-02-09 19:54:47 +01:00
Vincent Prouillet
5082e0f15a Render all relevant parent sections on rebuild 2019-01-30 09:15:46 +01:00
Vincent Prouillet
21d67235ae Arc-ify Library 2019-01-27 18:57:07 +01:00
Vincent Prouillet
a12e9512bc fmt/clippy 2018-12-29 11:17:43 +01:00
Vincent Prouillet
34708d6592 Handle editing language index colocated 2018-12-28 18:18:12 +01:00
Anton Lazarev
7cff1d335c
add rendering for 404.html when running zola serve 2018-12-06 20:07:34 -05:00
Vincent Prouillet
b3004c69ef Fix broken taxonomies pagination
Closes #533
2018-11-29 20:24:46 +01:00
Vincent Prouillet
9a99b40216 Add test for rebuild after deletion 2018-11-19 17:25:24 +01:00
Vincent Prouillet
a465d6a61e Fix deleting while zola serve 2018-11-19 17:19:05 +01:00
Vincent Prouillet
aee41f279c Fix reload with taxonomies 2018-11-16 23:51:11 +01:00
Vincent Prouillet
41a693a528 Ignore rename of non md files 2018-11-16 16:59:06 +01:00
Vincent Prouillet
7af314c61e Update deps + fmt 2018-11-14 17:34:21 +01:00
Vincent Prouillet
afc30543cc Handle file/dir renaming
Closes #385
2018-11-10 22:23:39 +01:00
Vincent Prouillet
56af4ca7f9 Add page_template to sections
To override all child pages

Closes #397
Tests from PR #434
2018-11-07 19:42:23 +01:00
Vincent Prouillet
a3b0f1e103 Add transparent sections
Closes #413
Closes #408
2018-11-06 00:46:13 +01:00
Vincent Prouillet
b7ce4e59fb rustfmt 2018-10-31 08:18:57 +01:00
Vincent Prouillet
465778c196 Always populate sections on section change 2018-10-19 08:59:45 +02:00
Vincent Prouillet
957c6bed9d Have a list of ancestors instead of only parent section 2018-10-18 15:54:51 +02:00
Vincent Prouillet
ee3f4dc511 Update to syntect 3 2018-10-09 14:33:43 +02:00
Vincent Prouillet
6843ec5c9c Rebuild more things now that it is more performant to do so
Fix #122
2018-10-06 13:52:40 +02:00
Vincent Prouillet
cdcebaea26 Cleanup of slotmap impl
Fix #205
2018-10-05 19:46:04 +02:00
Vincent Prouillet
10aba20fe5 Slotmap refactor 2018-10-03 16:29:29 +02:00
Christian Friedrich Coors
85529186e4 Fix some clippy warnings 2018-09-30 21:15:09 +02:00
Vincent Prouillet
14560f224e No clone when rendering rss feed 2018-09-20 22:47:43 +02:00
Vincent Prouillet
4f418a11b4 Fix live reload of section content 2018-08-05 10:30:01 +02:00
Vincent Prouillet
60a52fd2cc Some intellij reformatting 2018-07-31 15:30:49 +02:00
Daniel Sockwell
97f5065259 Fix formating/typos flaged in code review 2018-07-29 17:03:14 -04:00
Daniel Sockwell
c2437cc0eb Remove order and add heavier/later
This commit removes the option to sort by order and also removes
`page.next` and `page.previous` variables.  Instead, pages can be sorted
by two methods `date` and `weight`.  The Tera `reverse` filter will
reverse either of those sorts, so the old `order` behavior can be
achieved by using the `reverse` filter with `weight`.

In place of the `previous`/`next` variables, this commit adds the
`page.earlier`/`page.later` variables (which are set when the page is
sorted by date) and the `page.heavier`/`page.lighter` variables (which
are set when the page is sorted by weight).  These variables have the
advantage of not having confusing semantics when the `reverse` filter is
used.
2018-07-27 23:00:28 -04:00
Vincent Prouillet
18bef00671 Rename taxonomies paginate and error on unknown ones 2018-07-16 18:14:48 +02:00
Vincent Prouillet
1ae0702494
Custom taxonomies (#330) 2018-07-16 10:54:05 +02:00
Vincent Prouillet
3e6054a9ac tempdir -> tempfile 2018-06-25 17:57:33 +02:00
Vincent Prouillet
bcf42a0c10 The wonders of serde default, take 2 2018-03-20 18:42:42 +01:00
Vincent Prouillet
5c56278be1 Let people edit their index.md
Closes #241
2018-02-25 19:29:48 +01:00
Vincent Prouillet
10818cd0de Stop trying to load every file as markdown on serve
Closes #235
2018-02-22 16:49:37 +01:00
Vincent Prouillet
45fc1ee761 Release 0.3.1 2018-02-15 10:41:49 +01:00