Browse Source

feat(feature/section-menu): add support for multiple nav menus

there's a bunch of refactoring as well. see the changes to the docs site for an example of how to
update and leverage the hugo debugger in v0.54.0 to fix any bugs in your custom layouts

BREAKING CHANGE: removes disqus entirely, previously a deprecated feature
Josh Habdas 2 months ago
parent
commit
427f9d2541
No account linked to committer's email address
46 changed files with 227 additions and 149 deletions
  1. 28
    30
      README.md
  2. 1
    1
      assets/css/theme.css
  3. 4
    2
      bin/install
  4. 4
    3
      docs/config.toml
  5. 2
    2
      docs/content/_index.md
  6. 79
    11
      docs/content/feature/section-menu.md
  7. 1
    1
      docs/content/feature/snippets.md
  8. 2
    2
      docs/layouts/extra/list.html
  9. 1
    1
      docs/layouts/extra/single.html
  10. 2
    1
      docs/layouts/feature/list.html
  11. 1
    1
      docs/layouts/feature/single.html
  12. 14
    12
      docs/layouts/index.html
  13. 1
    1
      docs/layouts/module/list.html
  14. 1
    1
      docs/layouts/module/single.html
  15. 30
    0
      docs/layouts/partials/masthead.html
  16. 0
    22
      docs/layouts/partials/menu.html
  17. 2
    2
      docs/layouts/shortcode/list.html
  18. 1
    1
      docs/layouts/shortcode/single.html
  19. BIN
      docs/static/images/minimal-mac_1600x1200-fs8.png
  20. BIN
      docs/static/images/minimal-mac_2400x1800-fs8.png
  21. BIN
      docs/static/images/minimal-mac_800x600-fs8.png
  22. BIN
      docs/static/images/screenshots/example-landing-page-fs8.png
  23. 1
    7
      layouts/404.html
  24. 9
    4
      layouts/_default/baseof.html
  25. 1
    1
      layouts/_default/list.html
  26. 1
    1
      layouts/_default/search.html
  27. 1
    1
      layouts/_default/single.html
  28. 1
    1
      layouts/_default/taxonomy.html
  29. 1
    1
      layouts/_default/terms.html
  30. 1
    1
      layouts/index.html
  31. 0
    0
      layouts/partials/components/external.html
  32. 11
    0
      layouts/partials/components/navmenu.html
  33. 0
    0
      layouts/partials/components/snippets/textattrs.html
  34. 1
    1
      layouts/partials/components/textarea.html
  35. 1
    1
      layouts/partials/components/textinput.html
  36. 0
    0
      layouts/partials/head/modules.html
  37. 11
    0
      layouts/partials/masthead.html
  38. 0
    3
      layouts/partials/menu.html
  39. 0
    8
      layouts/partials/meta/name-author.html
  40. 0
    0
      layouts/partials/meta/verifications.html
  41. 0
    7
      layouts/partials/modules-footer.html
  42. 0
    7
      layouts/partials/shortcode/navmenu.html
  43. 1
    6
      layouts/post/single.html
  44. 1
    1
      layouts/shortcodes/blockquote.html
  45. 3
    3
      layouts/shortcodes/external.html
  46. 8
    1
      layouts/shortcodes/navmenu.html

+ 28
- 30
README.md View File

@@ -11,66 +11,64 @@
11 11
 
12 12
 ## Features
13 13
 
14
-- [Streamlined Workflow](https://after-dark.habd.as/#feature-workflow)
15
-- [Unparalleled Speed](https://after-dark.habd.as/#feature-speed)
16
-- [Advanced Graphics](https://after-dark.habd.as/#feature-graphics)
17
-- [Rewards System](https://after-dark.habd.as/#feature-rewards)
18
-- [Fuzzy Search](https://after-dark.habd.as/#feature-search)
19
-- [Easily Customized](https://after-dark.habd.as/#feature-customize)
20
-- [Securely Designed](https://after-dark.habd.as/#feature-security)
21
-- [Privacy Focused](https://after-dark.habd.as/#feature-privacy)
22
-
23
-Visit the [After Dark Docs](https://after-dark.habd.as) site to learn more.
14
+- [Streamlined Workflow](https://after-dark.habd.as/#feature-workflow) – cross-platform, 1 dependency, single-codebase
15
+- [Unparalleled Speed](https://after-dark.habd.as/#feature-speed) – ~0.615s builds, 100-200ms page loads
16
+- [Advanced Graphics](https://after-dark.habd.as/#feature-graphics) – responsive post images with lqip
17
+- [Rewards System](https://after-dark.habd.as/#feature-rewards) – monetize attention and earn borderless income
18
+- [Fuzzy Search](https://after-dark.habd.as/#feature-search) – automatic indexing and no third-parties
19
+- [Easily Customized](https://after-dark.habd.as/#feature-customize) – change skins, strip styles, create layouts
20
+- [Securely Designed](https://after-dark.habd.as/#feature-security) – verify release hashes even offline
21
+- [Privacy Focused](https://after-dark.habd.as/#feature-privacy) – no cookies and no external requests
24 22
 
25 23
 ## Screenshots
26 24
 
27
-<table role="presentation">
25
+<table>
28 26
   <tr>
29 27
     <td>
30
-      <a target="_blank" href="https://after-dark.habd.as/images/screenshots/example-landing-page-fs8.png">
31
-        <img alt="Example Landing Page screenshot" src="https://after-dark.habd.as/images/screenshots/example-landing-page-fs8.png">
28
+      <a href="https://after-dark.habd.as/">
29
+        <img alt src="https://after-dark.habd.as/images/screenshots/after-dark-v6.15.0-homepage-fs8.png">
32 30
       </a>
33 31
     </td>
34 32
     <td>
35
-      <a target="_blank" href="https://after-dark.habd.as/images/screenshots/feature-online-help-fs8.png">
36
-        <img alt="Online Help screenshot" src="https://after-dark.habd.as/images/screenshots/feature-online-help-fs8.png">
33
+      <a href="https://after-dark.habd.as/feature/">
34
+        <img alt src="https://after-dark.habd.as/images/screenshots/feature-online-help-fs8.png">
37 35
       </a>
38 36
     </td>
39 37
     <td>
40
-      <a target="_blank" href="https://after-dark.habd.as/images/screenshots/feature-error-page-fs8.png">
41
-        <img alt="Error Page screenshot" src="https://after-dark.habd.as/images/screenshots/feature-error-page-fs8.png">
38
+      <a href="https://after-dark.habd.as/404.html">
39
+        <img alt src="https://after-dark.habd.as/images/screenshots/feature-error-page-fs8.png">
42 40
       </a>
43 41
     </td>
44 42
   </tr>
45 43
   <tr>
46
-    <th scope="col">Landing Page Example</th>
47
-    <th scope="col">Online Help</th>
48
-    <th scope="col">Error Page</th>
44
+    <th scope="col"><center>Multilingual Docs</center></th>
45
+    <th scope="col"><center>Comprehensive Features</center></th>
46
+    <th scope="col"><center>Canvas Animations</center></th>
49 47
   </tr>
50 48
 </table>
51 49
 
52
-<table role="presentation">
50
+<table>
53 51
   <tr>
54 52
     <td>
55
-      <a target="_blank" href="https://after-dark.habd.as/images/screenshots/module-toxic-swamp-fs8.png">
56
-        <img alt="Webmining screenshot" src="https://after-dark.habd.as/images/screenshots/module-toxic-swamp-fs8.png">
53
+      <a href="https://after-dark.habd.as/module/toxic-swamp/">
54
+        <img alt src="https://after-dark.habd.as/images/screenshots/module-toxic-swamp-fs8.png">
57 55
       </a>
58 56
     </td>
59 57
     <td>
60
-      <a target="_blank" href="https://after-dark.habd.as/images/screenshots/shortcode-button-fs8.png">
61
-        <img alt="Form Controls screenshot" src="https://after-dark.habd.as/images/screenshots/shortcode-button-fs8.png">
58
+      <a href="https://after-dark.habd.as/shortcode/button/">
59
+        <img alt src="https://after-dark.habd.as/images/screenshots/shortcode-button-fs8.png">
62 60
       </a>
63 61
     </td>
64 62
     <td>
65
-      <a target="_blank" href="https://after-dark.habd.as/images/screenshots/extra-high-tea-fs8.png">
66
-        <img alt="Extras screenshot" src="https://after-dark.habd.as/images/screenshots/extra-high-tea-fs8.png">
63
+      <a href="https://after-dark.habd.as/extra/">
64
+        <img alt src="https://after-dark.habd.as/images/screenshots/extra-high-tea-fs8.png">
67 65
       </a>
68 66
     </td>
69 67
   </tr>
70 68
   <tr>
71
-    <th scope="col">Rewards System</th>
72
-    <th scope="col">Form Controls</th>
73
-    <th scope="col">Extras</th>
69
+    <th scope="col"><center>Web Mining Add-on</center></th>
70
+    <th scope="col"><center>Composable Shortcodes</center></th>
71
+    <th scope="col"><center>IndieWeb Extras</center></th>
74 72
   </tr>
75 73
 </table>
76 74
 

+ 1
- 1
assets/css/theme.css View File

@@ -3,7 +3,7 @@
3 3
   --screen-size-small: 30em; /* breakpoint reference only */
4 4
 }
5 5
 @keyframes intro {
6
-  0% { opacity: 0 }; 100% { opacity: 1 }
6
+  0% { opacity: 0 } 100% { opacity: 1 }
7 7
 }
8 8
 .blur-up {
9 9
   -webkit-filter: blur(5px);

+ 4
- 2
bin/install View File

@@ -73,13 +73,15 @@ footnoteReturnLinkContents = "↩" # Provides a nicer footnote return link
73 73
 [params]
74 74
   description = "" # Suggested, controls default description meta
75 75
   author = "" # Optional, controls author name display on posts
76
-  hide_author = true # Optional, set true to hide author name on posts
77
-  show_menu = false # Optional, set true to enable section menu
76
+  hide_author = false # Optional, set true to hide author name on posts
78 77
   has_cookies = false # Optional, set true to disable cookie disclaimer
79 78
   images = [
80 79
     "https://source.unsplash.com/collection/983219/2000x1322"
81 80
   ] # Suggested, controls default Open Graph images
82 81
 
82
+[params.layout.menu.main]
83
+  hidden = true # Optional, set false or remove to show section menu
84
+
83 85
 [params.modules.fractal_forest]
84 86
   enabled = true # Optional, set false to disable module
85 87
   decoders = ["bpgdec8a"] # Optional, 8-bit javascript decoder with animation

+ 4
- 3
docs/config.toml View File

@@ -4,7 +4,6 @@ paginate = 33 # Number of items to show before paginating
4 4
 
5 5
 # Controls default theme and theme components
6 6
 theme = [
7
-  "toxic-swamp",
8 7
   "after-dark"
9 8
 ]
10 9
 
@@ -27,12 +26,14 @@ footnoteReturnLinkContents = "↩" # Provides a nicer footnote return link
27 26
   description = "After Dark is free and open-source software you can use to create a website, blog or app." # Suggested, controls default description meta
28 27
   author = "Josh Habdas" # Optional, controls author name display on posts
29 28
   hide_author = true # Optional, set true to hide author name on posts
30
-  show_menu = true # Optional, set true to enable section menu
31 29
   has_cookies = false # Optional, set true to disable cookie disclaimer
32 30
   images = [
33
-    "https://source.unsplash.com/collection/983219/2000x1322"
31
+    "https://after-dark.habd.as/images/screenshots/after-dark-v6.15.0-homepage-fs8.png"
34 32
   ] # Suggested, controls default Open Graph images
35 33
 
34
+[params.layout.menu.main]
35
+  hidden = false # Optional, set false or remove to show section menu
36
+
36 37
 [outputs]
37 38
   home = ["HTML", "RSS", "JSON"]
38 39
 

+ 2
- 2
docs/content/_index.md View File

@@ -29,11 +29,11 @@ images = [
29 29
       </svg>&nbsp;&nbsp;Quick Install
30 30
     {{< /hackcss-button >}}
31 31
   {{< /hackcss-form >}}
32
-  <img height="28" class="lazyload" alt="npm downloads" data-src="https://img.shields.io/npm/dt/after-dark.svg?colorA=000000&colorB=000000&style=for-the-badge">
32
+  <img height="28" class="lazyload" alt="total downloads" data-src="https://img.shields.io/npm/dt/after-dark.svg?colorA=000000&colorB=000000&style=for-the-badge">
33 33
 </section>
34 34
 
35 35
 <section class="hero">
36
-  {{< figure alt="After Dark screenshots" src="/images/minimal-mac_1600x1200-fs8.png" lqipsrc="/images/minimal-mac_800x600-fs8.png" >}}
36
+  {{< figure alt="After Dark screenshots" src="/images/minimal-mac_2400x1800-fs8.png" lqipsrc="/images/minimal-mac_800x600-fs8.png" >}}
37 37
 </section>
38 38
 
39 39
 <section id="feature-workflow" class="capabilities">

+ 79
- 11
docs/content/feature/section-menu.md View File

@@ -15,23 +15,18 @@ After Dark uses Hugo's {{< external href="https://gohugo.io/templates/menu-templ
15 15
   {{< navmenu >}}
16 16
 {{< /hackcss-card >}}
17 17
 
18
-Enable it by toggling the `show_menu` setting in your site configuration:
18
+Enable it from `menu.main` layout config in your site configuration:
19 19
 
20 20
 ```toml
21
-[params]
22
-  show_menu = false # set to `true` to enable section menu
21
+[params.layout.menu.main]
22
+  hidden = true # set `false` or remove to show section menu
23 23
 ```
24 24
 
25 25
 With the menu enabled navigation links will begin appearing automatically on a per-section basis whenever {{< external href="https://gohugo.io/getting-started/usage/#draft-future-and-expired-content" text="Published Content" />}} is available within that section.
26 26
 
27
-Link to stand-alone pages from {{< external href="https://gohugo.io/content-management/front-matter/" text="Front Matter" />}} by specifying `menu = "main"`:
27
+## Customizing
28 28
 
29
-```toml
30
-title = "About"
31
-menu = "main"
32
-```
33
-
34
-Adjust link names and menu position by adding the following code block to your {{< external href="https://gohugo.io/getting-started/configuration/" text="Site Configuration" />}} and modifying it to meet your needs:
29
+Adjust link names and menu positions by adding the following code block to your {{< external href="https://gohugo.io/getting-started/configuration/" text="Site Configuration" />}} and modifying it to meet your needs:
35 30
 
36 31
 ```toml
37 32
 [[menu.main]]
@@ -47,6 +42,13 @@ Adjust link names and menu position by adding the following code block to your {
47 42
   url = "/post/"
48 43
 ```
49 44
 
45
+Exclude menu items by identifier:
46
+
47
+```toml
48
+[params.layout.menu.main]
49
+  exclude = ["home", "search"] # exclude homepage and blog postings
50
+```
51
+
50 52
 Decorate links with SVG icons using `pre` and `post`:
51 53
 
52 54
 ```toml
@@ -57,4 +59,70 @@ Decorate links with SVG icons using `pre` and `post`:
57 59
   post = "<svg aria-hidden=\"true\" class=\"i-search\" viewBox=\"0 0 32 32\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentcolor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"3\"><circle cx=\"14\" cy=\"14\" r=\"12\" /><path d=\"M23 23 L30 30\" /></svg>"
58 60
 ```
59 61
 
60
-See {{< external href="https://gohugo.io/content-management/menus/" text="Menus in Hugo" />}} for additional information.
62
+Link to stand-alone pages using {{< external href="https://gohugo.io/content-management/front-matter/" text="Front Matter" />}} menu setting:
63
+
64
+```toml
65
+title = "About"
66
+menu = "main"
67
+```
68
+
69
+Change the link title to differentiate from page:
70
+
71
+```toml
72
+title = "About Us"
73
+menu = "main"
74
+linktitle = "About"
75
+```
76
+
77
+Position items using {{< external "https://gohugo.io/variables/menus/#menu-entry-variables" "Menu Entry Variables" />}} for more control:
78
+
79
+```toml
80
+title = "About Us"
81
+[menu.main]
82
+  name = "About"
83
+  weight = 5
84
+```
85
+
86
+Provide your own config settings for use in [Custom Layouts]({{< relref "custom-layouts" >}}):
87
+
88
+```toml
89
+[params.layout.menu.main.custom]
90
+  social_icons = ["telegram", "mastodon", "keybase"]
91
+```
92
+
93
+And access them via your customized `navmenu.html`, if present:
94
+
95
+```go-html-template
96
+{{ range .settings.custom.social_icons }}
97
+  {{ partial "social-links.html" . }}
98
+{{ end }}
99
+```
100
+
101
+Create a second menu immediately after the first:
102
+
103
+```toml
104
+[[menu.main]]
105
+  name = "Posts"
106
+  weight = 2
107
+  identifier = "post"
108
+  url = "/post/"
109
+
110
+[[menu.utility]]
111
+  name = "Email"
112
+  weight = 1
113
+  identifier = "email"
114
+  url = "mailto:d0x3d@posteo.com"
115
+```
116
+
117
+And position it to the right using [Custom Styles]({{< relref "custom-styles" >}}):
118
+
119
+```css
120
+.hack > header {
121
+  display: grid;
122
+  grid-template-columns: 1fr minmax(min-content, auto);
123
+  column-gap: 20px;
124
+  grid-template-areas: "nav nav";
125
+}
126
+```
127
+
128
+See {{< external href="https://gohugo.io/content-management/menus/" text="Menus in Hugo" />}} for additional capabilities. For help with CSS Grid Layout get your feet wet at {{< external "https://cssgridgarden.com" />}}.

+ 1
- 1
docs/content/feature/snippets.md View File

@@ -1,6 +1,6 @@
1 1
 +++
2 2
 title = "Snippets"
3
-description = "Share code between Shortcodes and Custom Templates."
3
+description = "Share code between Shortcodes and Custom Layouts."
4 4
 categories = ["customizing"]
5 5
 tags = ["shortcodes", "templating", "layout"]
6 6
 features = ["related content", "code highlighter", "snippets"]

+ 2
- 2
docs/layouts/extra/list.html View File

@@ -1,5 +1,5 @@
1 1
 {{ define "header" }}
2
-  {{ partial "menu.html" . }}
2
+  {{ partial "masthead.html" . }}
3 3
 {{ end }}
4 4
 {{ define "main" }}
5 5
   <header>
@@ -9,7 +9,7 @@
9 9
     {{ end }}
10 10
   </header>
11 11
   <table>
12
-    <legend>Extras are companion software packages you may find valuable to augment your workflow. Unlike <a href="/ module/">Modules</a> and <a href="/shortcode/">Shortcodes</a> extras are ancillary to your website.</legend>
12
+    <legend>Extras are companion software packages you may find valuable to augment your workflow. Unlike <a href="/module/">Modules</a> and <a href="/shortcode/">Shortcodes</a> extras are ancillary to your website.</legend>
13 13
     <thead>
14 14
       <tr>
15 15
         <th scope="col">{{ .Title | singularize }}</th>

+ 1
- 1
docs/layouts/extra/single.html View File

@@ -2,7 +2,7 @@
2 2
   {{ .Title }} | {{ .Site.Title }}
3 3
 {{- end }}
4 4
 {{ define "header" }}
5
-  {{ partial "menu.html" . }}
5
+  {{ partial "masthead.html" . }}
6 6
 {{ end }}
7 7
 {{ define "main" }}
8 8
   <header>

+ 2
- 1
docs/layouts/feature/list.html View File

@@ -1,5 +1,5 @@
1 1
 {{ define "header" }}
2
-  {{ partial "menu.html" . }}
2
+  {{ partial "masthead.html" . }}
3 3
 {{ end }}
4 4
 {{ define "main" }}
5 5
   <header>
@@ -52,4 +52,5 @@
52 52
 {{ define "footer" }}
53 53
   {{ partial "pagination.html" . }}
54 54
   {{ partial "powered-by.html" . }}
55
+  {{ partial "cookie-disclaimer.html" . }}
55 56
 {{ end }}

+ 1
- 1
docs/layouts/feature/single.html View File

@@ -2,7 +2,7 @@
2 2
   {{ .Title }} | {{ .Site.Title }}
3 3
 {{- end }}
4 4
 {{ define "header" }}
5
-  {{ partial "menu.html" . }}
5
+  {{ partial "masthead.html" . }}
6 6
 {{ end }}
7 7
 {{ define "main" }}
8 8
   <header>

+ 14
- 12
docs/layouts/index.html View File

@@ -2,7 +2,7 @@
2 2
   {{ .Params.title }} | Semantic Design System for Hugo
3 3
 {{- end }}
4 4
 {{ define "header" }}
5
-  {{ partial "menu.html" . }}
5
+  {{ partial "masthead.html" . }}
6 6
   <style>
7 7
     :root {
8 8
       --vertical-rhythm: 5rem;
@@ -13,9 +13,20 @@
13 13
       text-align: center;
14 14
     }
15 15
     nav[itemtype*="SiteNavigationElement"] {
16
-      visibility: hidden;
16
+      opacity: 0;
17
+      transition: opacity 300ms ease;
18
+    }
19
+    nav[itemtype*="SiteNavigationElement"]:focus-within {
20
+      opacity: 1;
21
+      transition: opacity 300ms ease;
17 22
     }
18 23
     @media screen and (max-width: 768px) {
24
+      nav[itemtype*="SiteNavigationElement"] {
25
+        display: none;
26
+      }
27
+      .hack header h1 {
28
+        margin-top: 2rem !important;
29
+      }
19 30
       .grid {
20 31
         flex-direction: row;
21 32
       }
@@ -105,7 +116,7 @@
105 116
       margin: var(--vertical-rhythm) 0;
106 117
     }
107 118
     .hack section.hero {
108
-      margin-top: -1rem;
119
+      margin-top: -2rem;
109 120
       margin-bottom: 0;
110 121
     }
111 122
     .hack section.hero figure {
@@ -168,13 +179,4 @@
168 179
 {{ define "footer" }}
169 180
   {{ partial "powered-by.html" . }}
170 181
   {{ partial "cookie-disclaimer.html" . }}
171
-  <script>
172
-    /*!
173
-     * baffle 0.3.6 - A tiny javascript library for obfuscating and revealing text in DOM elements.
174
-     * Copyright (c) 2016 Cam Wiegert <cam@camwiegert.com> - https://camwiegert.github.io/baffle
175
-     * License: MIT
176
-     */
177
-    !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.baffle=e():t.baffle=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}var i=n(2),o=r(i);t.exports=o["default"]},function(t,e){"use strict";function n(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function r(t,e){return t.split("").map(e).join("")}function i(t){return t[Math.floor(Math.random()*t.length)]}function o(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)}function u(t){return t.map(function(t,e){return!!t&&e}).filter(function(t){return t!==!1})}function s(t){return"string"==typeof t?[].slice.call(document.querySelectorAll(t)):[NodeList,HTMLCollection].some(function(e){return t instanceof e})?[].slice.call(t):t.nodeType?[t]:t}Object.defineProperty(e,"__esModule",{value:!0}),e.extend=n,e.mapString=r,e.sample=i,e.each=o,e.getTruthyIndices=u,e.getElements=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=n(1),u=n(3),s=r(u),c={characters:"AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz~!@#$%^&*()-+=[]{}|;:,./<>?",exclude:[" "],speed:50},a=function(){function t(e,n){i(this,t),this.options=(0,o.extend)(Object.create(c),n),this.elements=(0,o.getElements)(e).map(s["default"]),this.running=!1}return t.prototype.once=function(){var t=this;return(0,o.each)(this.elements,function(e){return e.write(t.options.characters,t.options.exclude)}),this.running=!0,this},t.prototype.start=function(){var t=this;return clearInterval(this.interval),(0,o.each)(this.elements,function(t){return t.init()}),this.interval=setInterval(function(){return t.once()},this.options.speed),this.running=!0,this},t.prototype.stop=function(){return clearInterval(this.interval),this.running=!1,this},t.prototype.set=function(t){return(0,o.extend)(this.options,t),this.running&&this.start(),this},t.prototype.text=function(t){var e=this;return(0,o.each)(this.elements,function(n){n.text(t(n.value)),e.running||n.write()}),this},t.prototype.reveal=function(){var t=this,e=arguments.length<=0||void 0===arguments[0]?0:arguments[0],n=arguments.length<=1||void 0===arguments[1]?0:arguments[1],r=e/this.options.speed||1,i=function(){clearInterval(t.interval),t.running=!0,t.interval=setInterval(function(){var e=t.elements.filter(function(t){return!t.bitmap.every(function(t){return!t})});(0,o.each)(e,function(e){var n=Math.ceil(e.value.length/r);e.decay(n).write(t.options.characters,t.options.exclude)}),e.length||(t.stop(),(0,o.each)(t.elements,function(t){return t.init()}))},t.options.speed)};return setTimeout(i,n),this},t}();e["default"]=function(t,e){return new a(t,e)}},function(t,e,n){"use strict";function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var u=n(1),s=function(){function t(e){o(this,t),this.value=e,this.init()}return t.prototype.init=function(){return this.bitmap=this.value.split("").map(function(){return 1}),this},t.prototype.render=function(){var t=this,e=arguments.length<=0||void 0===arguments[0]?[]:arguments[0],n=arguments.length<=1||void 0===arguments[1]?[]:arguments[1];return e.length?(0,u.mapString)(this.value,function(r,i){return n.indexOf(r)>-1?r:t.bitmap[i]?(0,u.sample)(e):r}):this.value},t.prototype.decay=function(){for(var t=arguments.length<=0||void 0===arguments[0]?1:arguments[0];t--;){var e=(0,u.getTruthyIndices)(this.bitmap);this.bitmap[(0,u.sample)(e)]=0}return this},t.prototype.text=function(){var t=arguments.length<=0||void 0===arguments[0]?this.value:arguments[0];return this.value=t,this.init(),this},t}(),c=function(t){function e(n){o(this,e);var i=r(this,t.call(this,n.textContent));return i.element=n,i}return i(e,t),e.prototype.write=function(t,e){return this.element.textContent=this.render(t,e),this},e}(s);e["default"]=function(t){return new c(t)}}])});
178
-    baffle('header h2.muted').start().reveal(1000);
179
-  </script>
180 182
 {{ end }}

+ 1
- 1
docs/layouts/module/list.html View File

@@ -1,5 +1,5 @@
1 1
 {{ define "header" }}
2
-  {{ partial "menu.html" . }}
2
+  {{ partial "masthead.html" . }}
3 3
 {{ end }}
4 4
 {{ define "main" }}
5 5
   <header>

+ 1
- 1
docs/layouts/module/single.html View File

@@ -2,7 +2,7 @@
2 2
   {{ .Title }} | {{ .Site.Title }}
3 3
 {{- end }}
4 4
 {{ define "header" }}
5
-  {{ partial "menu.html" . }}
5
+  {{ partial "masthead.html" . }}
6 6
 {{ end }}
7 7
 {{ define "main" }}
8 8
   <header>

+ 30
- 0
docs/layouts/partials/masthead.html View File

@@ -0,0 +1,30 @@
1
+{{ $is_section_menu_enabled := ne .Site.Params.show_menu false }}
2
+{{ range $name, $entries := .Site.Menus }}
3
+  {{ if or (ne $name "main") (and (eq $name "main") $is_section_menu_enabled) }}
4
+    {{ with $.Site.Params.layout.menu }}
5
+      {{ $settings := (index . $name) | default dict }}
6
+      {{ partial "components/navmenu.html" (dict "name" $name "entries" $entries "settings" $settings "page" $)}}
7
+    {{ else }}
8
+      {{ partial "components/navmenu.html" (dict "name" $name "entries" $entries "settings" dict "page" $)}}
9
+    {{ end }}
10
+  {{ end }}
11
+{{ end }}
12
+<nav itemscope itemtype="http://schema.org/SiteNavigationElement">
13
+  <meta itemprop="name" content="Translation Menu">
14
+  {{ if ne .Page .Site.Home }}
15
+    {{ if .IsTranslated }}
16
+      {{ range .Translations }}
17
+        <a itemprop="url" href="{{ .Permalink }}">
18
+          {{ .Language.LanguageName }}
19
+          <svg aria-hidden="true" class="i-flag" viewBox="0 0 32 32" width="14" height="14" fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"><path d="M6 2 L6 30 M6 6 L26 6 20 12 26 18 6 18" /></svg>
20
+        </a>
21
+      {{ end }}
22
+    {{ else if .Site.IsMultiLingual }}
23
+      {{ $current_lang := .Page.Lang }}
24
+      {{ range where .Site.Home.AllTranslations "Lang" "!=" $current_lang }}
25
+        {{ .Language.LanguageName }}
26
+        <svg aria-hidden="true" class="i-flag" viewBox="0 0 32 32" width="14" height="14" fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"><path d="M6 2 L6 30 M6 6 L26 6 20 12 26 18 6 18" /></svg>
27
+      {{ end }}
28
+    {{ end }}
29
+  {{ end }}
30
+</nav>

+ 0
- 22
docs/layouts/partials/menu.html View File

@@ -1,22 +0,0 @@
1
-{{ if and (ne .Site.Params.show_menu false) (index .Site.Menus "main") }}
2
-  {{ partial "shortcode/navmenu.html" (dict "name" "main" "menus" .Site.Menus "page" .)}}
3
-  <nav itemscope itemtype="http://schema.org/SiteNavigationElement">
4
-    <meta itemprop="name" content="Translation Menu">
5
-    {{ if ne .Page .Site.Home }}
6
-      {{ if .IsTranslated }}
7
-        {{ range .Translations }}
8
-          <a itemprop="url" href="{{ .Permalink }}">
9
-            {{ .Language.LanguageName }}
10
-            <svg aria-hidden="true" class="i-flag" viewBox="0 0 32 32" width="14" height="14" fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"><path d="M6 2 L6 30 M6 6 L26 6 20 12 26 18 6 18" /></svg>
11
-          </a>
12
-        {{ end }}
13
-      {{ else if .Site.IsMultiLingual }}
14
-        {{ $current_lang := .Page.Lang }}
15
-        {{ range where .Site.Home.AllTranslations "Lang" "!=" $current_lang }}
16
-          {{ .Language.LanguageName }}
17
-          <svg aria-hidden="true" class="i-flag" viewBox="0 0 32 32" width="14" height="14" fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"><path d="M6 2 L6 30 M6 6 L26 6 20 12 26 18 6 18" /></svg>
18
-        {{ end }}
19
-      {{ end }}
20
-    {{ end }}
21
-  </nav>
22
-{{ end }}

+ 2
- 2
docs/layouts/shortcode/list.html View File

@@ -1,5 +1,5 @@
1 1
 {{ define "header" }}
2
-  {{ partial "menu.html" . }}
2
+  {{ partial "masthead.html" . }}
3 3
 {{ end }}
4 4
 {{ define "main" }}
5 5
   <header>
@@ -27,7 +27,7 @@
27 27
       </nav>
28 28
     </tbody>
29 29
   </table>
30
-  <p>In addition to the above you may {{ partial "shortcode/external.html" (dict "href" "https://gohugo.io/content-management/shortcodes/#use-hugo-s-built-in-shortcodes" "body" "Use Hugo's Built-in Shortcodes") }} as well.</p>
30
+  <p>In addition to the above you may {{ partial "components/external.html" (dict "href" "https://gohugo.io/content-management/shortcodes/#use-hugo-s-built-in-shortcodes" "body" "Use Hugo's Built-in Shortcodes") }} as well.</p>
31 31
 {{ end }}
32 32
 {{ define "footer" }}
33 33
   {{ partial "pagination.html" . }}

+ 1
- 1
docs/layouts/shortcode/single.html View File

@@ -2,7 +2,7 @@
2 2
   {{ .Title }} | {{ .Site.Title }}
3 3
 {{- end }}
4 4
 {{ define "header" }}
5
-  {{ partial "menu.html" . }}
5
+  {{ partial "masthead.html" . }}
6 6
 {{ end }}
7 7
 {{ define "main" }}
8 8
   <header>

BIN
docs/static/images/minimal-mac_1600x1200-fs8.png View File


BIN
docs/static/images/minimal-mac_2400x1800-fs8.png View File


BIN
docs/static/images/minimal-mac_800x600-fs8.png View File


BIN
docs/static/images/screenshots/example-landing-page-fs8.png View File


+ 1
- 7
layouts/404.html View File

@@ -6,15 +6,9 @@
6 6
   <title>404 Error | {{ .Site.Title }}</title>
7 7
   {{ partial "head/favicon.html" . }}
8 8
   {{ partial "meta/theme-color.html" . }}
9
-  {{ template "_internal/google_analytics_async.html" . }}
10 9
   <style media="screen">
11 10
     @keyframes intro {
12
-      0% {
13
-        opacity: 0;
14
-      }
15
-      100% {
16
-        opacity: 1;
17
-      }
11
+      0% { opacity: 0; } 100% { opacity: 1; }
18 12
     }
19 13
     @font-face {
20 14
       font-family: 'Londrina Outline';

+ 9
- 4
layouts/_default/baseof.html View File

@@ -13,17 +13,16 @@
13 13
     {{ if or (in $noindex_kinds .Kind) ($is_noindex_true) }}
14 14
       <meta name="robots" content="noindex">
15 15
     {{ end }}
16
-    {{ partial "meta/name-author.html" . }}
17 16
     {{ template "_internal/opengraph.html" . }}
18 17
     {{ template "_internal/twitter_cards.html" . }}
19 18
     {{ partial "meta/ogimage-maybe.html" . }}
20 19
     {{ partial "meta/telegram-channel-maybe.html" . }}
21 20
     {{ if eq .Kind "home" }}
22
-      {{ partial "head/site-verification.html" . }}
21
+      {{ partial "meta/verifications.html" . }}
23 22
     {{ end }}
24 23
     {{ partial "meta/http-referrer.html" . }}
25 24
     {{ partial "async-scripts.html" . }}
26
-    {{ partial "modules.html" . }}
25
+    {{ partial "head/modules.html" . }}
27 26
     {{ if .RSSLink }}
28 27
       <link href="{{ .RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}">
29 28
     {{ end }}
@@ -51,6 +50,12 @@
51 50
     <header>{{ block "header" . }}{{ end }}</header>
52 51
     <main>{{ block "main" . }}{{ end }}</main>
53 52
     <footer>{{ block "footer" . }}{{ end }}</footer>
54
-    {{ partial "modules-footer.html" . }}
53
+    {{ $defaults := .Site.Params.defaults.modules }}
54
+    {{ $modules := .Site.Params.modules }}
55
+    {{ if (or $modules $defaults) }}
56
+      {{ with (default $modules.toxic_swamp $defaults.toxic_swamp) }}
57
+        {{ partial "modules/toxic-swamp/toolbar.html" dict }}
58
+      {{ end }}
59
+    {{ end }}
55 60
   </body>
56 61
 </html>

+ 1
- 1
layouts/_default/list.html View File

@@ -1,5 +1,5 @@
1 1
 {{ define "header" }}
2
-  {{ partial "menu.html" . }}
2
+  {{ partial "masthead.html" . }}
3 3
 {{ end }}
4 4
 {{ define "main" }}
5 5
   <header>

+ 1
- 1
layouts/_default/search.html View File

@@ -2,7 +2,7 @@
2 2
   {{ .Title }} | {{ .Site.Title }}
3 3
 {{- end }}
4 4
 {{ define "header" }}
5
-  {{ partial "menu.html" . }}
5
+  {{ partial "masthead.html" . }}
6 6
 {{ end }}
7 7
 {{ define "main" }}
8 8
   <header>

+ 1
- 1
layouts/_default/single.html View File

@@ -2,7 +2,7 @@
2 2
   {{ .Title }} | {{ .Site.Title }}
3 3
 {{- end }}
4 4
 {{ define "header" }}
5
-  {{ partial "menu.html" . }}
5
+  {{ partial "masthead.html" . }}
6 6
 {{ end }}
7 7
 {{ define "main" }}
8 8
   <header>

+ 1
- 1
layouts/_default/taxonomy.html View File

@@ -1,5 +1,5 @@
1 1
 {{ define "header" }}
2
-  {{ partial "menu.html" . }}
2
+  {{ partial "masthead.html" . }}
3 3
 {{ end }}
4 4
 {{ define "main" }}
5 5
   <header>

+ 1
- 1
layouts/_default/terms.html View File

@@ -1,5 +1,5 @@
1 1
 {{ define "header" }}
2
-  {{ partial "menu.html" . }}
2
+  {{ partial "masthead.html" . }}
3 3
 {{ end }}
4 4
 {{ define "main" }}
5 5
   <header>

+ 1
- 1
layouts/index.html View File

@@ -2,7 +2,7 @@
2 2
   {{ .Site.Title }}
3 3
 {{- end }}
4 4
 {{ define "header" }}
5
-  {{ partial "menu.html" . }}
5
+  {{ partial "masthead.html" . }}
6 6
 {{ end }}
7 7
 {{ define "main" }}
8 8
   <header>

layouts/partials/shortcode/external.html → layouts/partials/components/external.html View File


+ 11
- 0
layouts/partials/components/navmenu.html View File

@@ -0,0 +1,11 @@
1
+{{ if not (eq .settings.hidden true) }}
2
+  <nav itemscope itemtype="http://schema.org/SiteNavigationElement">
3
+    <meta itemprop="name" content="{{ .name | humanize }} Menu">
4
+    {{ range .entries }}
5
+      {{ $is_active := or ($.page.IsMenuCurrent $.name .) ($.page.HasMenuCurrent $.name .) }}
6
+      {{ if (not (in $.settings.exclude .Identifier)) }}
7
+        <a itemprop="url"{{ if $is_active }} class="active"{{ end }} href="{{ .URL }}">{{ if .Pre }}{{ .Pre | safeHTML }} {{ end }}{{ .Name }}{{ if .Post }} {{ .Post | safeHTML }}{{ end }}</a>
8
+      {{ end }}
9
+    {{ end }}
10
+  </nav>
11
+{{ end }}

layouts/partials/components/common/textattrs.html → layouts/partials/components/snippets/textattrs.html View File


+ 1
- 1
layouts/partials/components/textarea.html View File

@@ -1,6 +1,6 @@
1 1
 {{ $permitted_attrs := .permitted_attrs | default (slice "id" "name" "class" "autocomplete" "autofocus" "cols" "disabled" "form" "maxlength" "minlength" "name" "placeholder" "readonly" "required" "rows" "spellcheck" "wrap" "tabindex") }}
2 2
 {{ $boolean_attrs := .boolean_attrs | default (slice "autofocus" "disabled" "readonly" "required") }}
3 3
 {{ $validations := .validations | default (dict "spellcheck" (slice "true" "default" "false") "autocomplete" (slice "on" "off") "wrap" (slice "hard" "soft" "off")) }}
4
-<textarea {{ partial "components/common/textattrs.html" (dict "attrs" .attrs "permitted_attrs" $permitted_attrs "boolean_attrs" $boolean_attrs "validations" $validations) | safeHTMLAttr }}>
4
+<textarea {{ partial "components/snippets/textattrs.html" (dict "attrs" .attrs "permitted_attrs" $permitted_attrs "boolean_attrs" $boolean_attrs "validations" $validations) | safeHTMLAttr }}>
5 5
   {{- with .body }}{{ . }}{{ end -}}
6 6
 </textarea>

+ 1
- 1
layouts/partials/components/textinput.html View File

@@ -1,4 +1,4 @@
1 1
 {{ $permitted_attrs := .permitted_attrs | default (slice "id" "name" "class" "autocomplete" "autofocus" "disabled" "form" "formaction" "formmethod" "formnovalidate" "formtarget" "height" "max" "maxlength" "min" "minlength" "multiple" "pattern" "placeholder" "readonly" "required" "size" "spellcheck" "step" "tabindex" "type" "value" "width") }}
2 2
 {{ $boolean_attrs := .boolean_attrs | default (slice "autofocus" "disabled" "readonly" "required") }}
3 3
 {{ $validations := .validations | default (dict "type" (slice "email" "hidden" "number" "password" "search" "tel" "text" "url") "spellcheck" (slice "true" "default" "false") "autocomplete" (slice "off" "on" "name" "honorific-prefix" "given-name" "additional-name" "family-name" "honorific-suffix" "nickname" "email" "username" "new-password" "current-password" "organization-title" "organization" "street-address" "address-line1" "address-line2" "address-line3" "address-level4" "address-level3" "address-level2" "address-level1" "country" "country-name" "postal-code" "cc-name" "cc-given-name" "cc-additional-name" "cc-family-name" "cc-number" "cc-exp" "cc-exp-month" "cc-exp-year" "cc-csc" "cc-type" "transaction-currency" "transaction-amount" "language" "bday" "bday-day" "bday-month" "bday-year" "sex" "tel" "tel-country-code" "tel-national" "tel-area-code" "tel-local" "tel-extension" "email" "impp" "url" "photo")) }}
4
-<input {{ partial "components/common/textattrs.html" (dict "attrs" .attrs "permitted_attrs" $permitted_attrs "boolean_attrs" $boolean_attrs "validations" $validations) | safeHTMLAttr }}>
4
+<input {{ partial "components/snippets/textattrs.html" (dict "attrs" .attrs "permitted_attrs" $permitted_attrs "boolean_attrs" $boolean_attrs "validations" $validations) | safeHTMLAttr }}>

layouts/partials/modules.html → layouts/partials/head/modules.html View File


+ 11
- 0
layouts/partials/masthead.html View File

@@ -0,0 +1,11 @@
1
+{{ $is_section_menu_enabled := ne .Site.Params.show_menu false }}
2
+{{ range $name, $entries := .Site.Menus }}
3
+  {{ if or (ne $name "main") (and (eq $name "main") $is_section_menu_enabled) }}
4
+    {{ with $.Site.Params.layout.menu }}
5
+      {{ $settings := (index . $name) | default dict }}
6
+      {{ partial "components/navmenu.html" (dict "name" $name "entries" $entries "settings" $settings "page" $)}}
7
+    {{ else }}
8
+      {{ partial "components/navmenu.html" (dict "name" $name "entries" $entries "settings" dict "page" $)}}
9
+    {{ end }}
10
+  {{ end }}
11
+{{ end }}

+ 0
- 3
layouts/partials/menu.html View File

@@ -1,3 +0,0 @@
1
-{{ if and (ne .Site.Params.show_menu false) (index .Site.Menus "main") }}
2
-  {{ partial "shortcode/navmenu.html" (dict "name" "main" "menus" .Site.Menus "page" .)}}
3
-{{ end }}

+ 0
- 8
layouts/partials/meta/name-author.html View File

@@ -1,8 +0,0 @@
1
-<!-- {{/*
2
-  Undocumented Facebook feature parses author name for social sharing
3
-*/}}-->
4
-{{ if isset .Params "author" }}
5
-  <meta name="author" content="{{ index .Params "author" }}">
6
-{{ else }}
7
-  <meta name="author" content="{{ .Site.Params.author }}">
8
-{{ end }}

layouts/partials/head/site-verification.html → layouts/partials/meta/verifications.html View File


+ 0
- 7
layouts/partials/modules-footer.html View File

@@ -1,7 +0,0 @@
1
-{{ $defaults := .Site.Params.defaults.modules }}
2
-{{ $modules := .Site.Params.modules }}
3
-{{ if (or $modules $defaults) }}
4
-  {{ with (default $modules.toxic_swamp $defaults.toxic_swamp) }}
5
-    {{ partial "modules/toxic-swamp/toolbar.html" (dict) }}
6
-  {{ end }}
7
-{{ end }}

+ 0
- 7
layouts/partials/shortcode/navmenu.html View File

@@ -1,7 +0,0 @@
1
-<nav itemscope itemtype="http://schema.org/SiteNavigationElement">
2
-  <meta itemprop="name" content="{{ .name | humanize }} Menu">
3
-  {{ range (index .menus .name) }}
4
-    {{ $is_active := or ($.page.IsMenuCurrent $.name .) ($.page.HasMenuCurrent $.name .) }}
5
-    <a itemprop="url"{{ if $is_active }} class="active"{{ end }} href="{{ .URL }}">{{ if .Pre }}{{ .Pre | safeHTML }} {{ end }}{{ .Name }}{{ if .Post }} {{ .Post | safeHTML }}{{ end }}</a>
6
-  {{- end }}
7
-</nav>

+ 1
- 6
layouts/post/single.html View File

@@ -1,5 +1,5 @@
1 1
 {{ define "header" }}
2
-  {{ partial "menu.html" . }}
2
+  {{ partial "masthead.html" . }}
3 3
 {{ end }}
4 4
 {{ define "main" }}
5 5
   <article itemscope itemtype="http://schema.org/BlogPosting">
@@ -96,11 +96,6 @@
96 96
     <div itemprop="articleBody">
97 97
       {{ .Content }}
98 98
     </div>
99
-    {{ if .Site.DisqusShortname }}
100
-      <article>
101
-        {{ template "_internal/disqus.html" . }}
102
-      </article>
103
-    {{ end }}
104 99
     <footer>
105 100
       <hr>
106 101
       {{ partial "post/byline.html" . }}

+ 1
- 1
layouts/shortcodes/blockquote.html View File

@@ -5,7 +5,7 @@
5 5
 <blockquote{{ with $class }} class="{{ . }}"{{ end }}{{ with $citelink }} cite="{{ . }}"{{ end }}>
6 6
   <p>{{- $body | plainify -}}</p>
7 7
   {{ if $citelink }}
8
-    <cite>{{ partial "shortcode/external.html" (dict "href" $citelink "body" $cite) }}</cite>
8
+    <cite>{{ partial "components/external.html" (dict "href" $citelink "body" $cite) }}</cite>
9 9
   {{ else if $cite }}
10 10
     <cite>{{ $cite }}</cite>
11 11
   {{ else }}

+ 3
- 3
layouts/shortcodes/external.html View File

@@ -8,11 +8,11 @@
8 8
 {{ $rel := .Get "rel" -}}
9 9
 {{ $itemtype := .Get "itemtype" -}}
10 10
 {{- if .IsNamedParams -}}
11
-  {{ partial "shortcode/external.html" (dict "href" $href "body" $body "class" $class "referrerpolicy" $referrerpolicy "target" $target "type" $type "title" $title "rel" $rel "itemtype" $itemtype "suppress_external" (and .Inner (eq (len (findRE "external" $rel)) 0))) }}
11
+  {{ partial "components/external.html" (dict "href" $href "body" $body "class" $class "referrerpolicy" $referrerpolicy "target" $target "type" $type "title" $title "rel" $rel "itemtype" $itemtype "suppress_external" (and .Inner (eq (len (findRE "external" $rel)) 0))) }}
12 12
 {{- else if gt (len .Params) 1 -}}
13
-  {{ partial "shortcode/external.html" (dict "href" (.Get 0) "body" (.Get 1)) }}
13
+  {{ partial "components/external.html" (dict "href" (.Get 0) "body" (.Get 1)) }}
14 14
 {{- else -}}
15
-  {{ partial "shortcode/external.html" (dict "href" (.Get 0)) }}
15
+  {{ partial "components/external.html" (dict "href" (.Get 0)) }}
16 16
 {{- end -}}
17 17
 {{- if or (and .IsNamedParams (eq $href nil)) (and (eq .IsNamedParams false) (eq (.Get 0) nil)) }}
18 18
   <p>{{ partial "components/alert.html" (dict "type" "error" "body" (errorf "Invalid use of external shortcode. Please provide a URL.")) }}</p>

+ 8
- 1
layouts/shortcodes/navmenu.html View File

@@ -10,4 +10,11 @@ Display custom navigation menu:
10 10
 */}} -->
11 11
 
12 12
 {{ $name := .Get 0 | default "main" }}
13
-{{ partial "shortcode/navmenu.html" (dict "name" $name "menus" .Site.Menus "page" .Page.Page)}}
13
+{{ $entries := index .Site.Menus $name }}
14
+{{ $page := .Page.Page }}
15
+{{ with $.Site.Params.layout.menu }}
16
+  {{ $settings := index . $name | default dict }}
17
+  {{ partial "components/navmenu.html" (dict "name" $name "entries" $entries "settings" $settings "page" $page)}}
18
+{{ else }}
19
+  {{ partial "components/navmenu.html" (dict "name" $name "entries" $entries "settings" dict "page" $page)}}
20
+{{ end }}

Loading…
Cancel
Save