From mboxrd@z Thu Jan 1 00:00:00 1970 From: "pelzflorian (Florian Pelz)" Subject: Re: Haunt patches Date: Thu, 8 Feb 2018 18:12:44 +0100 Message-ID: <20180208171243.dnligzfvwsxvc4l3@floriannotebook> References: <20171223125116.33r6kjnu2zze7f2o@floriannotebook> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="fl5dnxjg4w4hco5h" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47724) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejpkh-00030j-4H for guix-devel@gnu.org; Thu, 08 Feb 2018 12:12:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ejpkf-0000Cw-UI for guix-devel@gnu.org; Thu, 08 Feb 2018 12:12:51 -0500 Content-Disposition: inline In-Reply-To: <20171223125116.33r6kjnu2zze7f2o@floriannotebook> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: davet@gnu.org Cc: guix-devel@gnu.org --fl5dnxjg4w4hco5h Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, (Ccing guix-devel@gnu.org.) 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=3Dac3e93fe35363fd0066cf93b969c9= 5c0fde7a25a https://pelzflorian.de/git/haunt/commit/?id=3Dca32925a58c8ec526653aff9825be= 2359bf358c3 https://pelzflorian.de/git/haunt/commit/?id=3D34f6b56bfe3a3059ced4be5e9b768= a6a3a93c671 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=E2=80=99s code to make use of the patches. https://pelzflorian.de/git/pelzfloriande-website/commit/?id=3D02e80b47fe0a9= 929a25d4a5f7ce11a15e1042d6f 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 --fl5dnxjg4w4hco5h Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEwRjGsqAMqXB4uw3y3T6EbElHBVsFAlp8hQYACgkQ3T6EbElH BVsW7A//XpqQvM2Czg7eqbBw1wtEjiFaS2Jcmrki2MDcnbTYfGoE7zVYNfC1Y/u1 7PtvJmHD0EKuoGonYj2OBIRP3rnSdP8V/WLTWhvWC6AqreEN6Aa7UWVlmpkRzCZ0 Wm6f/KNSHrl0WR6JzGa/RTIX4lTdkfnxmXRo7Bezu6SlEpjyV18ta95/gOamxaMv Dj7iRdFxEcy33/nKL6CtwdhUf9Qr0vfG8AXp2blwNBCmmCJjVnYpKJYaXahmzTyY KJom3TlzM22SJ6jyQjAyZs3QMKNMunpot8pv3n2BYEI/Wup0UXCOfYWCXutG+8/a 6l9lrKlwQNBd00Sk21VJ3sSZJ6SEk/T49e8JIEeS358RaWWokAc1QefkpPMhOkJ0 8RM6uKU4r+YWPFtSncCfvBGJtCI6oATDI10SAfCYcJWJ+XEjpujznZh9684blJvn NB0zbnZDnds4FSwFs0bveE2oQGrgVfs0c/kPYVqC8R0vRG/KLlxqvnjfotkhnhP+ rHw58dPsWtj9+AndhhDD7KQc8DSLH9z7S07KExx1QMW44q/ajTY/Uny4sVBDLNje S9fwAxpbcFXaIgvw4ZgfS2xVabkNnXkZDlrbndeWC86BH29A7W7Vv20wf9xEyXs9 /dAbBGeQnmfj7vmT9pKyS+XDU0KOrwx8wZoysR+WTOHlT09PMZI= =zirI -----END PGP SIGNATURE----- --fl5dnxjg4w4hco5h--