Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable i18n for "Home" link in site navigation #2312

Merged
merged 1 commit into from
Dec 20, 2019
Merged

Conversation

stomar
Copy link
Contributor

@stomar stomar commented Dec 15, 2019

Integrate "Home" link with the other sitelinks to allow for localization via the _data/locales/*.yml files. For en:

sitelinks:
- text: Home
  url: /en
  home: true

The home tag is introduced because the "Home" link requires special treatment; it needs the CSS class "home" which controls the link's visibility (it is only displayed in the hamburger menu for mobile view) and ensures proper highlighting when selected.

As a side effect of this change the "Home" link is added to the sitelinks in the footer, since the footer also uses _includes/sitelinks.html. To keep the appearance of the site unchanged, the footer "Home" link is set to display: none.

Copy link
Contributor

@hasantezcan hasantezcan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for supporting.

Integrate "Home" link with the other sitelinks to allow for
localization via the `_data/locales/*.yml` files. For `en`:

```yaml
sitelinks:
- text: Home
  url: /en
  home: true
```

The `home` tag is introduced because the "Home" link requires special
treatment; it needs the CSS class "home" which controls the link's
visibility (it is only displayed in the hamburger menu for mobile view)
and ensures proper highlighting when selected.

As a side effect of this change the "Home" link is added to the sitelinks
in the footer, since the footer also uses `_includes/sitelinks.html`.
To keep the appearance of the site unchanged, the footer "Home" link
is set to `display: none`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants