Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 50 additions & 24 deletions config/_default/menus/menus.en.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
[[main]]
name = "About"
url = "/about/"
pageRef = "/about/"
weight = 10
[main.params]
alias = true

[[main]]
name = "Docs"
url = "/docs/"
pageRef = "/docs/"
weight = 20

[[main]]
name = "Components"
url = "/components/"
pageRef = "/components/"
weight = 30
[main.params]
alias = true

[[main]]
name = "Guides"
url = "/guides/"
pageRef = "/guides/"
weight = 40

[[social]]
Expand All @@ -26,26 +30,44 @@

# toml-docs-start sample-navigation
[[sample]]
name = "Blog"
url = "/blog/"
name = "About"
pageRef = "/about/"
weight = 10
[sample.params]
alias = true

[[sample]]
name = "Projects"
url = "/projects/"
name = "About (no alias)"
pageRef = "/about/"
weight = 20

[[sample]]
name = "Sample project"
url = "/en/projects/sample-project/"
parent = "Projects"
weight = 1
name = "Guides"
pageRef = "/guides/"
weight = 30

[[sample]]
parent = "Guides"
name = "Getting started"
pageRef = "/guides/editing/"
weight = 10

[[sample]]
parent = "Guides"
name = "Adding packages"
pageRef = "/guides/packages/"
weight = 20

[[sample]]
name = "Another project"
url = "/en/projects/another-project/"
parent = "Projects"
weight = 2
parent = "Guides"
name = "Optimization"
pageRef = "/guides/optimization/"
weight = 30

[[sample]]
name = "GitHub"
url = "https://github.com/gethinode/hinode"
weight = 40
# toml-docs-end sample-navigation

[[footer]]
Expand All @@ -55,26 +77,30 @@
[[footer]]
parent = "Links"
name = "Home"
url = "/"
pageRef = "/"
weight = 1

[[footer]]
parent = "Links"
name = "About"
url = "/about/"
pageRef = "/about/"
weight = 10
[footer.params]
alias = true

[[footer]]
parent = "Links"
name = "Docs"
url = "/docs/"
pageRef = "/docs/"
weight = 20

[[footer]]
parent = "Links"
name = "Components"
url = "/components/"
pageRef = "/components/"
weight = 30
[footer.params]
alias = true

[[footer]]
name = "Guides"
Expand All @@ -83,19 +109,19 @@
[[footer]]
parent = "Guides"
name = "Getting started"
url = "/guides/editing"
pageRef = "/guides/editing"
weight = 10

[[footer]]
parent = "Guides"
name = "Adding packages"
url = "/guides/packages"
pageRef = "/guides/packages"
weight = 20

[[footer]]
parent = "Guides"
name = "Optimization"
url = "/guides/optimization"
pageRef = "/guides/optimization"
weight = 30

[[footer]]
Expand All @@ -117,5 +143,5 @@
[[footer]]
parent = "Community"
name = "Contribute"
url = "/contribute"
pageRef = "/contribute"
weight = 30
8 changes: 4 additions & 4 deletions content/en/docs/0.9/configuration/navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ The main navigation uses [Hugo's menu system]({{< param "links.hugo_menus" >}})

### Menus

The navigation bar uses [Hugo's menu system]({{< param "links.hugo_menus" >}}) to generate the menu items. The navigation supports nesting at one level depth. The following example defines an example menu configuration called `sample` (the main configuration is called `main`).
The navigation bar uses [Hugo's menu system]({{< param "links.hugo_menus" >}}) to generate the menu items. The navigation supports nesting at one level deep. Hinode supports an additional parameter called `alias`. If set, the active menu item is linked to the specific menu entry instead of being derived from the target URL. The following example defines an example menu configuration called `sample` (the main configuration is called `main`).

{{< docs name="sample-navigation" file="config/_default/menus/menus.en.toml" >}}
{{< docs name="sample-navigation" file="./config/_default/menus/menus.en.toml" >}}

### Example

Using the sample configuration defined in the previous paragraph, the navigation bar looks like this:
The example below illustrates the navigation bar based on the sample configuration defined in the previous paragraph. The `About` and `About (no alias)` menu entries illustrate the behavior of the `alias` parameter. The `GitHub` menu entry shows an icon to indicate it is an external link and opens in a new window.

{{< navbar color="light" size="sm" search="false" menus="sample" title="Sample" >}}
{{< navbar color="body-tertiary" size="sm" search="false" menus="sample" title="Sample" >}}

### Customization

Expand Down
2 changes: 2 additions & 0 deletions hugo_stats.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"mark",
"meta",
"nav",
"noscript",
"ol",
"p",
"pre",
Expand All @@ -57,6 +58,7 @@
"zero-width"
],
"classes": [
"%!s(\u003cnil\u003e)",
"accordion",
"accordion-body",
"accordion-button",
Expand Down
10 changes: 3 additions & 7 deletions layouts/partials/footer/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,9 @@
<div class="col-md-2 col-4 pt-5 pt-md-0">
<div class="fs-md-5 fs-6 fw-bold footer-muted">{{ .Name }}</div>
{{- range .Children -}}
{{- $url := urls.Parse .URL -}}
{{- $external := ne $url.Host $baseurl.Host -}}
<div class="py-1"><a class="link-bg-footer"
href="{{ .URL | relLangURL }}" {{ if $external }}target="_blank" rel="noopener noreferrer" {{ end }}>
{{ .Name }}
{{- if $external }} {{ partial "assets/icon.html" (dict "icon" "fas up-right-from-square fa-2xs") }}{{ end -}}
</a></div>
<div class="py-1">
{{- partial "assets/navbar-item.html" (dict "menu" . "page" $page "class" "link-bg-footer") -}}
</div>
{{- end -}}
</div>
{{- end -}}
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"devDependencies": {
"@fortawesome/fontawesome-free": "^6.4.0",
"@fullhuman/postcss-purgecss": "^5.0.0",
"@gethinode/hinode": "^0.13.2",
"@gethinode/hinode": "^0.14.0",
"autoprefixer": "^10.4.14",
"bootstrap": "^5.3.0-alpha3",
"cssnano": "^6.0.1",
Expand Down