Skip to content

Commit 11f9ed7

Browse files
authored
Merge pull request #83 from gethinode/develop
Fixes
2 parents 69ec3be + 0c3a381 commit 11f9ed7

File tree

6 files changed

+74
-39
lines changed

6 files changed

+74
-39
lines changed

config/_default/params.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@
253253
repository_child = "https://github.com/gethinode/child.git"
254254
repository_docs = "https://github.com/gethinode/docs.git"
255255
repository_owner = "https://github.com/markdumay/"
256+
repository_leaflet = "https://github.com/gethinode/leaflet-demo"
256257
repository_tag = "https://github.com/gethinode/hinode/releases/tag/"
257258
semver = "https://semver.org"
258259
siteground_compression = "https://www.siteground.com/blog/brotli-vs-gzip-compression"

content/en/docs/0.9/components/navbar.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
author: Mark Dumay
33
title: Navbar
4-
date: 2023-05-21
4+
date: 2023-05-23
55
description: Use the navbar shortcode to display a navigation header with a toggler.
66
layout: docs
77
icon: fas bars
@@ -14,7 +14,7 @@ Use the `navbar` shortcode to display a navigation header with a toggler. The me
1414

1515
<!-- markdownlint-disable MD037 -->
1616
{{< example lang="hugo" >}}
17-
{{</* navbar path="credits" color="body" size="md" search="false" menus="sample" title="Brand" mode="false" */>}}
17+
{{</* navbar id="navbar-overview" path="credits" color="body" size="md" search="false" menus="sample" title="Brand" mode="false" */>}}
1818
{{< /example >}}
1919
<!-- markdownlint-enable MD037 -->
2020

@@ -45,15 +45,15 @@ Set the argument `logo` to an image to add a brand logo to the left of the navba
4545

4646
<!-- markdownlint-disable MD037 -->
4747
{{< example lang="hugo" >}}
48-
{{</* navbar logo="/img/logo_icon.svg" path="credits" color="body" size="md" search="false" menus="sample" mode="false" */>}}
48+
{{</* navbar id="navbar-logo" logo="/img/logo_icon.svg" path="credits" color="body" size="md" search="false" menus="sample" mode="false" */>}}
4949
{{< /example >}}
5050
<!-- markdownlint-enable MD037 -->
5151

5252
Set the argument `title` to add a brand text to the left of the navbar. The text moves to the center on smaller screens, pending on the `size` setting.
5353

5454
<!-- markdownlint-disable MD037 -->
5555
{{< example lang="hugo" >}}
56-
{{</* navbar title="Brand" path="credits" color="body" size="md" search="false" menus="sample" mode="false" */>}}
56+
{{</* navbar id="navbar-title" title="Brand" path="credits" color="body" size="md" search="false" menus="sample" mode="false" */>}}
5757
{{< /example >}}
5858
<!-- markdownlint-enable MD037 -->
5959

@@ -71,16 +71,16 @@ Set the `color` argument to define the background color with a matching title co
7171

7272
<!-- markdownlint-disable MD037 -->
7373
{{< example lang="hugo" >}}
74-
<div class="mb-3">{{</* navbar path="credits" color="primary" size="sm" search="false" menus="sample" mode="false" */>}}</div>
75-
<div class="mb-3">{{</* navbar path="credits" color="secondary" size="sm" search="false" menus="sample" mode="false" */>}}</div>
76-
<div class="mb-3">{{</* navbar path="credits" color="success" size="sm" search="false" menus="sample" mode="false" */>}}</div>
77-
<div class="mb-3">{{</* navbar path="credits" color="danger" size="sm" search="false" menus="sample" mode="false" */>}}</div>
78-
<div class="mb-3">{{</* navbar path="credits" color="warning" size="sm" search="false" menus="sample" mode="false" */>}}</div>
79-
<div class="mb-3">{{</* navbar path="credits" color="info" size="sm" search="false" menus="sample" mode="false" */>}}</div>
80-
<div class="mb-3">{{</* navbar path="credits" color="white" size="sm" search="false" menus="sample" mode="false" */>}}</div>
81-
<div class="mb-3">{{</* navbar path="credits" color="black" size="sm" search="false" menus="sample" mode="false" */>}}</div>
82-
<div class="mb-3">{{</* navbar path="credits" color="body" size="sm" search="false" menus="sample" mode="false" */>}}</div>
83-
<div class="mb-3">{{</* navbar path="credits" color="body-tertiary" size="sm" search="false" menus="sample" mode="false" */>}}</div>
74+
<div class="mb-3">{{</* navbar id="navbar-color-1" path="credits" color="primary" size="sm" search="false" menus="sample" mode="false" */>}}</div>
75+
<div class="mb-3">{{</* navbar id="navbar-color-2" path="credits" color="secondary" size="sm" search="false" menus="sample" mode="false" */>}}</div>
76+
<div class="mb-3">{{</* navbar id="navbar-color-3" path="credits" color="success" size="sm" search="false" menus="sample" mode="false" */>}}</div>
77+
<div class="mb-3">{{</* navbar id="navbar-color-4" path="credits" color="danger" size="sm" search="false" menus="sample" mode="false" */>}}</div>
78+
<div class="mb-3">{{</* navbar id="navbar-color-5" path="credits" color="warning" size="sm" search="false" menus="sample" mode="false" */>}}</div>
79+
<div class="mb-3">{{</* navbar id="navbar-color-6" path="credits" color="info" size="sm" search="false" menus="sample" mode="false" */>}}</div>
80+
<div class="mb-3">{{</* navbar id="navbar-color-7" path="credits" color="white" size="sm" search="false" menus="sample" mode="false" */>}}</div>
81+
<div class="mb-3">{{</* navbar id="navbar-color-8" path="credits" color="black" size="sm" search="false" menus="sample" mode="false" */>}}</div>
82+
<div class="mb-3">{{</* navbar id="navbar-color-9" path="credits" color="body" size="sm" search="false" menus="sample" mode="false" */>}}</div>
83+
<div class="mb-3">{{</* navbar id="navbar-color-10" path="credits" color="body-tertiary" size="sm" search="false" menus="sample" mode="false" */>}}</div>
8484
{{< /example >}}
8585
<!-- markdownlint-enable MD037 -->
8686

@@ -90,15 +90,15 @@ Set the argument `search` to `true` to enable search input.
9090

9191
<!-- markdownlint-disable MD037 -->
9292
{{< example lang="hugo" >}}
93-
{{</* navbar search="true" path="credits" color="body" size="md" menus="sample" mode="false" */>}}
93+
{{</* navbar id="navbar-search-1" search="true" path="credits" color="body" size="md" menus="sample" mode="false" */>}}
9494
{{< /example >}}
9595
<!-- markdownlint-enable MD037 -->
9696

9797
Set the argument `search` to `false` to disable search input.
9898

9999
<!-- markdownlint-disable MD037 -->
100100
{{< example lang="hugo" >}}
101-
{{</* navbar search="false" path="credits" color="body" size="md" menus="sample" mode="false" */>}}
101+
{{</* navbar id="navbar-search-2" search="false" path="credits" color="body" size="md" menus="sample" mode="false" */>}}
102102
{{< /example >}}
103103
<!-- markdownlint-enable MD037 -->
104104

@@ -112,15 +112,15 @@ Set the argument `mode` to `true` to enable the mode switcher.
112112

113113
<!-- markdownlint-disable MD037 -->
114114
{{< example lang="hugo" >}}
115-
{{</* navbar mode="true" search="false" path="credits" color="body" size="md" menus="sample" */>}}
115+
{{</* navbar id="navbar-mode-1" mode="true" search="false" path="credits" color="body" size="md" menus="sample" */>}}
116116
{{< /example >}}
117117
<!-- markdownlint-enable MD037 -->
118118

119119
Set the argument `mode` to `false` to disable the mode switcher.
120120

121121
<!-- markdownlint-disable MD037 -->
122122
{{< example lang="hugo" >}}
123-
{{</* navbar mode="false" search="false" path="credits" color="body" size="md" menus="sample" */>}}
123+
{{</* navbar id="navbar-mode-2" mode="false" search="false" path="credits" color="body" size="md" menus="sample" */>}}
124124
{{< /example >}}
125125
<!-- markdownlint-enable MD037 -->
126126

content/en/guides/packages.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ photoSource: <a href="https://unsplash.com/photos/7KKy7-TeeVs">Unsplash</a>
1414

1515
Hinode uses [npm packages]({{< ref "/docs/0.9/advanced-settings/overview#npm-packages" >}}) and [mounted folders]({{< param "links.hugo_mounts" >}}) to create a flexible, automated build system. This guide shows how to add an npm package to your site. It installs Leaflet as an example. [Leaflet]({{< param "links.leaflet" >}}) is an open-source JavaScript library to add mobile-friendly interactive maps to your site. This guide assumes you have a working site already. Check the [introduction]({{< relref "introduction" >}}) on how to set up a site with Hinode.
1616

17+
{{< alert color="info" >}}
18+
A full working example of this guide is available on [GitHub]({{< param "links.repository_leaflet" >}}).
19+
{{< /alert >}}
20+
1721
## Step 1 - Setting up leaflet
1822

1923
As first step we will install the Leaflet package with npm. Next, we will mount the JavaScript library. Lastly, we will import Leaflet's stylesheet.
@@ -37,11 +41,22 @@ Using Hugo's module mounts, Hinode bundles all JavaScript files found in the `as
3741
includeFiles = "leaflet.js"
3842
```
3943

44+
The default marker from Leaflet requires several images. Mount these images to `static/css/images` for them to become available.
45+
46+
```toml
47+
[[module.mounts]]
48+
source = "node_modules/leaflet/dist/images"
49+
target = "static/css/images"
50+
includeFiles = "*.png"
51+
```
52+
4053
### Importing the css file
4154

42-
Leaflet requires the presence of several style elements. Similarly to the JavaScript bundle, add the following statement to `assets/scss/app.scss` to include Leaflet's <abbr title="Cascading Stylesheet">CSS</abbr> file in your main style. Please note that the file extension `.css` should be omitted.
55+
Leaflet requires the presence of several style elements. Similarly to the JavaScript bundle, add an import statement to `assets/scss/app.scss` to include Leaflet's <abbr title="Cascading Stylesheet">CSS</abbr> file in your main style. You can copy the basic file from the Hinode repository and add the statement to the bottom of the file. Please note that the file extension `.css` should be omitted.
4356

4457
```scss
58+
[...]
59+
4560
// Import Leaflet
4661
@import "leaflet/dist/leaflet";
4762
```
@@ -62,18 +77,21 @@ Add a `map` placeholder to your (Markdown) content file. The following placehold
6277
<div id="map" class="ratio ratio-16x9 w-100"></div>
6378
```
6479

65-
Next, initialize the map placeholder with the OpenStreetMap content. The following code uses the city of London as an example. The `mapID` refers to the ID of the placeholder. The code tests if an element with the `map` ID is present and initializes the placeholder accordingly. You can place the code in `assets/js/leaflet.js`, where Hinode will pick it up automatically.
80+
Next, initialize the map placeholder with the OpenStreetMap content. The following code uses the city of London as an example. The `mapID` refers to the ID of the placeholder. The code tests if an element with the `map` ID is present and initializes the placeholder accordingly. It adds a marker with a default icon next. You can place the code in `assets/js/leaflet.js`, where Hinode will pick it up automatically.
6681

6782
```js
6883
const mapID = 'map'
6984

7085
if (document.getElementById(mapID) !== null) {
7186
const map = L.map(mapID).setView([51.505, -0.09], 13)
7287

73-
const tiles = L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
74-
maxZoom: 19,
75-
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
76-
}).addTo(map)
88+
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
89+
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
90+
}).addTo(map);
91+
92+
L.marker([51.5, -0.09]).addTo(map)
93+
.bindPopup('A pretty CSS popup.<br> Easily customizable.')
94+
.openPopup();
7795
}
7896
```
7997

hugo_stats.json

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
"zero-width"
6060
],
6161
"classes": [
62-
"%!s(\u003cnil\u003e)",
6362
"accordion",
6463
"accordion-body",
6564
"accordion-button",
@@ -934,18 +933,35 @@
934933
"nav-users-btn-0",
935934
"nav-users-btn-1",
936935
"nav-users-btn-2",
936+
"navbar-collapse-0",
937+
"navbar-collapse-1",
938+
"navbar-collapse-10",
939+
"navbar-collapse-2",
940+
"navbar-collapse-3",
941+
"navbar-collapse-4",
942+
"navbar-collapse-5",
943+
"navbar-collapse-6",
944+
"navbar-collapse-7",
945+
"navbar-collapse-8",
946+
"navbar-collapse-9",
947+
"navbar-color-1",
948+
"navbar-color-10",
949+
"navbar-color-2",
950+
"navbar-color-3",
951+
"navbar-color-4",
952+
"navbar-color-5",
953+
"navbar-color-6",
954+
"navbar-color-7",
955+
"navbar-color-8",
956+
"navbar-color-9",
937957
"navbar-color-theme",
938-
"navbarSupportedContent-0",
939-
"navbarSupportedContent-1",
940-
"navbarSupportedContent-10",
941-
"navbarSupportedContent-2",
942-
"navbarSupportedContent-3",
943-
"navbarSupportedContent-4",
944-
"navbarSupportedContent-5",
945-
"navbarSupportedContent-6",
946-
"navbarSupportedContent-7",
947-
"navbarSupportedContent-8",
948-
"navbarSupportedContent-9",
958+
"navbar-logo",
959+
"navbar-mode-1",
960+
"navbar-mode-2",
961+
"navbar-overview",
962+
"navbar-search-1",
963+
"navbar-search-2",
964+
"navbar-title",
949965
"nested-list",
950966
"new-feature",
951967
"npm-packages",

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gethinode/docs",
3-
"version": "0.10.3",
3+
"version": "0.10.4",
44
"description": "The source for https://gethinode.com",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)