diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2015-09-11 19:29:00 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2015-09-11 19:29:00 +0200 |
commit | 78c50bf4993790a8a19f676f1ffc6099cf16978e (patch) | |
tree | 392910708c15816e99a20d7d73e6e3f39f973cb2 /blog | |
parent | f2f64c97b673904728fd3e63585d5b2619ddf3f2 (diff) | |
download | norsk-urskog-main-78c50bf4993790a8a19f676f1ffc6099cf16978e.tar.gz norsk-urskog-main-78c50bf4993790a8a19f676f1ffc6099cf16978e.tar.bz2 norsk-urskog-main-78c50bf4993790a8a19f676f1ffc6099cf16978e.zip |
Add language switcher to menu bar.
Diffstat (limited to 'blog')
-rw-r--r-- | blog/_assets/stylesheets/_navbar.scss | 4 | ||||
-rw-r--r-- | blog/_i18n/en.yml | 2 | ||||
-rw-r--r-- | blog/_includes/language-switcher.html | 7 | ||||
-rw-r--r-- | blog/_includes/menubar.html | 3 |
4 files changed, 13 insertions, 3 deletions
diff --git a/blog/_assets/stylesheets/_navbar.scss b/blog/_assets/stylesheets/_navbar.scss index 90c2c20..754169f 100644 --- a/blog/_assets/stylesheets/_navbar.scss +++ b/blog/_assets/stylesheets/_navbar.scss @@ -21,8 +21,10 @@ color: $nav-link-hover-color; } } - &.menu-flags { + .language-switcher { float: right; + border-left: 1px solid $nav-link-hover-bg; + padding-left: 2mm; } } } diff --git a/blog/_i18n/en.yml b/blog/_i18n/en.yml index 1c812b4..17e123c 100644 --- a/blog/_i18n/en.yml +++ b/blog/_i18n/en.yml @@ -1,6 +1,6 @@ --- global: - norwegian: norsk + norwegian: Norsk english: English read_more: Read more... diff --git a/blog/_includes/language-switcher.html b/blog/_includes/language-switcher.html new file mode 100644 index 0000000..22f2e05 --- /dev/null +++ b/blog/_includes/language-switcher.html @@ -0,0 +1,7 @@ +<span class="language-switcher"> + {% if site.lang == "nb" %} + <a href="{{ site.baseurl_root | append: "en" }}">{% t global.english %}</a> + {% else if site.lang == "en" %} + <a href="{{ site.baseurl_root }}">{% t global.norwegian %}</a> + {% endif %} +</span>
\ No newline at end of file diff --git a/blog/_includes/menubar.html b/blog/_includes/menubar.html index 76d49cc..cc7de78 100644 --- a/blog/_includes/menubar.html +++ b/blog/_includes/menubar.html @@ -1,8 +1,9 @@ <nav class="site-nav"> - <a class="page-link" href="{{ site.baseurl | append: "/" }}">{% t titles.home %}</a> + <a class="page-link" href="{{ site.baseurl }}">{% t titles.home %}</a> {% for page in site.pages %} {% if page.title %} <a class="page-link" href="{{ page.url | prepend: site.baseurl }}">{% page_title page.title %}</a> {% endif %} {% endfor %} + {% include language-switcher.html %} </nav> |