spanezz / staticsite

Static site generator
GNU General Public License v3.0
45 stars 7 forks source link

Setting metadata for auto-generated pages? #52

Open DonKult opened 3 years ago

DonKult commented 3 years ago

Lets say I want to include the blog/archive page in the navbar, how best to set e.g. nav_title for this page given that it is auto-generated?

I can create the page manually, but that produces a) a warning for replacing a page and b) it has only an effect for the page itself, others still use the (not available) metadata of the auto-generated page.

Beside, it is also a bit strange that the archive page has the same title as the page they are an archive for. For taxonomies you can at least control the title (in theory, this seems broken in practice?), but again no dice for other metadata like nav_title.

(I am using/adding my own metadata fields left and right, so having a generic solution would be nice, but I guess that is features territory.)

spanezz commented 3 years ago

In theory directory metadata could be used for that. I wonder if they work for things like archived pages?

Reference: doc/reference/contents.md

spanezz commented 1 year ago

You should be able, in the front matter of blog.md where you define syndication: <something>, to do something like this:

syndication:
  archive:
     nav_title: My nav title

Staticsite 2.0 should have better documentation for these kinds of things: https://github.com/spanezz/staticsite/blob/refactor/staticsite/features/syndication.py#L254