Go to file
jordi fita mas 9a8ef8ce9f Add the language switched to the public layout
The language switcher needs the same information as languageLinks
needed, namely the list of locales and the current Path, to construct
the URI to all alternate versions.  However, in this case i need access
to this data in the template context, to build the list of links.

At first i use request’s context to hold the list of available locales
from application, and it worked, possibly without ill-effects, but i
realized that i was doing it just to avoid a new parameter.  Or, more
precise, an _explicit_ parameter; the context was used to skip the
inner functions between app and template.MustRenderPublic, but the
parameter was there all the same.

Finally, i thought that some handler might want to filter the list of
locales to show only the ones that it has a translation of.  In that
case, i would need to extract the locales from the context, filter it,
and create a new request with the updated context.  That made little
sense, and made me add the explicit locales parameter.

Since now the template has the same data as languageLinks, there is
little point of having the link in the HTTP response headers, and added
the <link> elements to <head>.

I thought that maybe i could avoid these <links> as they give the exact
same data as the language switch, but Google says nothing of using
regular anchors to gather information about localized versions of the
document[0], thus i opted to be conservative.  One can reason that the
<head> has more weight for Google, as most sites with user-generated
content, which could contain these anchors, rarely allow users to edit
the <head>.

[0]: https://developers.google.com/search/docs/specialty/international/localized-versions
2023-08-06 05:53:52 +02:00
cmd/camper Allow users to update their profile images 2023-07-28 20:15:09 +02:00
debian Add correct dependencies for camper-sqitch 2023-07-31 16:20:13 +02:00
deploy Add add_campsite_type function and call it from Go with a proper form 2023-08-04 19:59:58 +02:00
pkg Add the language switched to the public layout 2023-08-06 05:53:52 +02:00
po Split templates and handlers into admin and public 2023-08-05 03:42:37 +02:00
revert Add add_campsite_type function and call it from Go with a proper form 2023-08-04 19:59:58 +02:00
test Add add_campsite_type function and call it from Go with a proper form 2023-08-04 19:59:58 +02:00
verify Add add_campsite_type function and call it from Go with a proper form 2023-08-04 19:59:58 +02:00
web Add the language switched to the public layout 2023-08-06 05:53:52 +02:00
.gitignore Add the skeleton of the web application 2023-07-23 00:11:00 +02:00
Makefile Add Debian package 2023-07-27 20:00:08 +02:00
demo.sql Use HTTP Host to establish the request’s company 2023-08-03 20:21:21 +02:00
go.mod Add the skeleton of the web application 2023-07-23 00:11:00 +02:00
go.sum Add the skeleton of the web application 2023-07-23 00:11:00 +02:00
sqitch.conf Add empty Sqitch configuration anq plan files 2023-07-20 23:43:23 +02:00
sqitch.plan Add add_campsite_type function and call it from Go with a proper form 2023-08-04 19:59:58 +02:00