Make the home page into reusable and translatable blocks (#10071)

* Make navigation and UI strings i18n friendly

This commit

* Extracts most UI strings into i18n bundles so they can be translated
* Makes a proper Hugo menu out of the hardcoded menu that is shown on smaller screens
* Changes the language selector logic to navigate to the current page in the other language if possible (e.g. the translation). If not possible, it takes you to the home page for that language.

For testing, this commit also adds Norwegian as a new language. This is turned off.

* Make the home page into reusable and translatable blocks

This commit adds a set of block type shortcodes that is then used to build the home page.

* These shortcodes gets common image resources from a new headless bundle. These resources can be inherited or overridden by translations.
* The hardcoded case studies section on the home page is replaced with a query and a loop.
* The hardcoded feature list on the home page is replaed qith a query and a loop.
This commit is contained in:
Bjørn Erik Pedersen
2018-09-14 23:47:24 +02:00
committed by k8s-ci-robot
parent 0df6621652
commit 1b5ff98a44
49 changed files with 501 additions and 2181 deletions
+64
View File
@@ -0,0 +1,64 @@
# i18n strings for the English (main) site.
[main_read_about]
other = "Read about"
[main_read_more]
other = "Read more"
[main_github_invite]
other = "Interested in hacking on the core Kubernetes code base?"
[main_github_view_on]
other = "View On Github"
[main_github_create_an_issue]
other = "Create an Issue"
[main_community_explore]
other = "Explore the community"
[main_kubernetes_features]
other = "Kubernetes Features"
[main_cncf_project]
other = """We are a <a href="https://cncf.io/">CNCF</a> graduated project</p>"""
[main_contribute]
other = "Contribute"
[main_edit_this_page]
other = "Edit This Page"
[main_page_history]
other ="Page History"
[main_page_last_modified_on]
other = "Page last modified on"
[main_by]
other = "by"
[main_documentation_license]
other = """The Kubernetes Authors | Documentation Distributed under <a href="https://git.k8s.io/website/LICENSE" class="light-text">CC BY 4.0</a>"""
[main_copyright_notice]
other = """The Linux Foundation &reg;. All rights reserved. The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text">Trademark Usage page</a>"""
# Community links
[community_twitter_name]
other = "Twitter"
[community_github_name]
other = "GitHub"
[community_slack_name]
other = "Slack"
[community_stack_overflow_name]
other = "Stack Overflow"
[community_forum_name]
other = "Forum"
[community_events_calendar]
other = "Events Calendar"
# UI elements
[ui_search_placeholder]
other = "Search"
+64
View File
@@ -0,0 +1,64 @@
# i18n strings for the Norwegian translation.
[main_read_about]
other = "Les om"
[main_read_more]
other = "Les mer"
[main_github_invite]
other = "Interessert kode i Kubernetes?"
[main_github_view_on]
other = "Åpne på Github"
[main_github_create_an_issue]
other = "Opprett en issue"
[main_community_explore]
other = "Utforsk folkene bak Kubernetes"
[main_kubernetes_features]
other = "Egenskaper i Kubernetes"
[main_cncf_project]
other = """Vi er et <a href="https://cncf.io/">CNCF</a>-prosjekt</p>"""
[main_contribute]
other = "Bidra"
[main_edit_this_page]
other = "Endre denne siden"
[main_page_history]
other ="Side-historikk"
[main_page_last_modified_on]
other = "Side sist endret"
[main_by]
other = "av"
[main_documentation_license]
other = """Kubernetes-forfatterene | Dokumentasjonen er utgitt med <a href="https://git.k8s.io/website/LICENSE" class="light-text">CC BY 4.0-lisens</a>"""
[main_copyright_notice]
other = """The Linux Foundation &reg;. Alle retter er reservert. The Linux Foundation har registrerte varemerker. For en oversikt, se <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text">Bruk av varemerker</a>"""
# Community links
[community_twitter_name]
other = "Twitter"
[community_github_name]
other = "GitHub"
[community_slack_name]
other = "Slack"
[community_stack_overflow_name]
other = "Stack Overflow"
[community_forum_name]
other = "Forum"
[community_events_calendar]
other = "Kalender"
# UI elements
[ui_search_placeholder]
other = "Søk"