[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Haunt patches
From: |
pelzflorian (Florian Pelz) |
Subject: |
Re: Haunt patches |
Date: |
Thu, 8 Feb 2018 18:12:44 +0100 |
User-agent: |
NeoMutt/20171208 |
Hello,
(Ccing address@hidden)
I wrote patches that introduce page variants for translations. I will
send them right after this mail. If there are interested guix-devel
readers, they can find them at
https://pelzflorian.de/git/haunt/commit/?id=ac3e93fe35363fd0066cf93b969c95c0fde7a25a
https://pelzflorian.de/git/haunt/commit/?id=ca32925a58c8ec526653aff9825be2359bf358c3
https://pelzflorian.de/git/haunt/commit/?id=34f6b56bfe3a3059ced4be5e9b768a6a3a93c671
A site can have a list of variants such as various languages,
e.g. '("de" "en").
Each page body can then optionally be a procedure that given a variant
returns a body. If a page body is a procedure, the page is written
multiple times, once for each variant, unless the procedure returns #f
for the variant.
I previously wrote about variants in this discussion on the Guix
mailing list.
https://lists.gnu.org/archive/html/guix-devel/2018-02/msg00118.html
While changing things I also added a #:subtitle key to
Atom-feeds-by-tag.
I already restructured my website’s code to make use of the patches.
https://pelzflorian.de/git/pelzfloriande-website/commit/?id=02e80b47fe0a9929a25d4a5f7ce11a15e1042d6f
I would be grateful if you could comment further on style etc. so this
can eventually be merged, unless you think the approach is wrong.
Everything that can be done with variants is possible already by
adding one site builder for each language instead of just one site
builder, e.g. adding the same blog site builder once for each variant.
I think variants are the cleaner solution even though it means adding
many lambdas for each body.
If the approach is right, I should probably write documentation for
it.
Alternatively backwards compatibility could be disregarded and
procedures returning bodies could take one more argument, the variant.
Another alternative would be doing nothing (except for adding
subtitles to atom-feeds-by-tag) since variants are just prettier but
not strictly needed.
One problem is that the page file name is not an argument to blog
layouts, so one cannot easily put links to the other variants of a
page on a page. This does not yet address this issue.
Regards,
Florian
signature.asc
Description: PGP signature
- Re: Haunt patches,
pelzflorian (Florian Pelz) <=
- Re: Haunt patches, Ludovic Courtès, 2018/02/09
- Re: Haunt patches, pelzflorian (Florian Pelz), 2018/02/09
- Web site i18n with Haunt, Ludovic Courtès, 2018/02/09
- Re: Web site i18n with Haunt, pelzflorian (Florian Pelz), 2018/02/09
- Re: Web site i18n with Haunt, Ricardo Wurmus, 2018/02/09
- Re: Web site i18n with Haunt, pelzflorian (Florian Pelz), 2018/02/11
- Re: Web site i18n with Haunt, Ricardo Wurmus, 2018/02/11
- Re: Web site i18n with Haunt, pelzflorian (Florian Pelz), 2018/02/11