mirror of
https://github.com/gethinode/hinode.git
synced 2025-10-08 02:24:20 +00:00
Compare commits
7 Commits
v0.23.0-be
...
v0.23.0-be
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4db9c6fde8 | ||
![]() |
67ad2fe076 | ||
![]() |
00e169512c | ||
![]() |
3171f065eb | ||
![]() |
5dcb44b2d0 | ||
![]() |
b54c415f39 | ||
![]() |
7ecc818ca1 |
@@ -1,31 +1,3 @@
|
|||||||
{{- define "partials/optional-scripts.html" -}}
|
|
||||||
{{ $page_modules := slice }}
|
|
||||||
{{ if reflect.IsMap .Params.modules }}
|
|
||||||
{{ $page_modules = .Params.modules }}
|
|
||||||
{{ else }}
|
|
||||||
{{ $page_modules = $page_modules | append .Params.modules }}
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
{{- $modules := site.Params.modules.optional | intersect $page_modules -}}
|
|
||||||
{{- range $index, $mod := $modules -}}
|
|
||||||
{{- $filename := printf "js/%s.bundle.js" $mod -}}
|
|
||||||
{{- $match := printf "js/modules/%s/**.js" $mod -}}
|
|
||||||
{{- $skipTemplate := false -}}
|
|
||||||
{{- if reflect.IsSlice site.Params.modules.disableTemplate -}}
|
|
||||||
{{- if in site.Params.modules.disableTemplate $mod}}
|
|
||||||
{{- $skipTemplate = true -}}
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{ $state := "" }}
|
|
||||||
{{- with (index site.Params.modules $mod) -}}
|
|
||||||
{{- with index . "state" }}{{ $state = . }}{{ end -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{- partial "footer/scripts.html" (dict "filename" $filename "match" $match "header" false "skipTemplate" $skipTemplate "state" $state "page" .) }}
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{- /* Set version-aware sidebar menu */ -}}
|
{{- /* Set version-aware sidebar menu */ -}}
|
||||||
{{- $version := partial "utilities/GetVersion.html" (dict "page" . "base" true) -}}
|
{{- $version := partial "utilities/GetVersion.html" (dict "page" . "base" true) -}}
|
||||||
{{- $.Scratch.Set "version" $version -}}
|
{{- $.Scratch.Set "version" $version -}}
|
||||||
@@ -99,6 +71,6 @@
|
|||||||
|
|
||||||
{{- partial "footer/toast-container.html" . -}}
|
{{- partial "footer/toast-container.html" . -}}
|
||||||
{{- partialCached "footer/scripts.html" (dict "header" false "page" . "core" true) }}
|
{{- partialCached "footer/scripts.html" (dict "header" false "page" . "core" true) }}
|
||||||
{{- partial "partials/optional-scripts.html" . -}}
|
{{- partial "footer/optional-scripts.html" . -}}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -1,48 +1,18 @@
|
|||||||
{{- define "partials/single-main.html" -}}
|
|
||||||
{{- $breakpoint := $.Scratch.Get "breakpoint" -}}
|
|
||||||
{{ if .Site.Params.navigation.breadcrumb }}{{ partial "assets/breadcrumb.html" (dict "page" .) }}{{ end -}}
|
|
||||||
|
|
||||||
{{ .Render "single/header" }}
|
|
||||||
|
|
||||||
{{- if and .Site.Params.navigation.toc .Params.includeToc | default true -}}
|
|
||||||
<div class="d-{{ $breakpoint.current }}-none pb-5">{{ partial "assets/toc-dropdown.html" (dict "page" .) }}</div>
|
|
||||||
{{- end -}}
|
|
||||||
{{ .Render "single/body" }}
|
|
||||||
|
|
||||||
{{ .Render "single/footer" }}
|
|
||||||
{{ end -}}
|
|
||||||
|
|
||||||
{{ define "main" -}}
|
{{ define "main" -}}
|
||||||
{{- $menu := .Scratch.Get "sidebar" -}}
|
|
||||||
{{- $version := .Scratch.Get "version" -}}
|
|
||||||
{{- $breakpoint := $.Scratch.Get "breakpoint" -}}
|
{{- $breakpoint := $.Scratch.Get "breakpoint" -}}
|
||||||
|
{{ $sidebar := .Render "single/sidebar" }}
|
||||||
{{ $sidebar := "" }}
|
|
||||||
{{- $hasSidebar := .Site.Params.navigation.sidebar | default true -}}
|
|
||||||
{{ if and $menu $hasSidebar }}{{ $sidebar = partial "assets/sidebar.html" (dict "page" . "menu" $menu "version" $version) }}{{ end }}
|
|
||||||
|
|
||||||
{{ $toc := .Render "single/panel-toc" }}
|
{{ $toc := .Render "single/panel-toc" }}
|
||||||
|
|
||||||
{{ with $sidebar -}}
|
{{ $sidebar | safeHTML }}
|
||||||
<div class="offcanvas offcanvas-start" tabindex="-1" id="offcanvass-sidebar" aria-inledby="offcanvas-label">
|
|
||||||
<div class="offcanvas-header">
|
|
||||||
<h5 class="offcanvas-title" id="offcanvas-label">{{ strings.FirstUpper $.Section }}</h5>
|
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="{{ T "close" }}"></button>
|
|
||||||
</div>
|
|
||||||
<div class="offcanvas-body">
|
|
||||||
{{ . | safeHTML }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
<div class="container-xxl flex-fill p-4 px-xxl-0">
|
<div class="container-xxl flex-fill p-4 px-xxl-0">
|
||||||
{{ if $hasSidebar -}}
|
{{ if $sidebar -}}
|
||||||
<div class="row row-cols-1 row-cols-{{ $breakpoint.current }}-2 row-cols-{{ $breakpoint.next }}-3">
|
<div class="row row-cols-1 row-cols-{{ $breakpoint.current }}-2 row-cols-{{ $breakpoint.next }}-3">
|
||||||
<div class="col col-{{ $breakpoint.next }}-2 d-none d-{{ $breakpoint.next }}-block sidebar-overflow sticky-top pt-5">
|
<div class="col col-{{ $breakpoint.next }}-2 d-none d-{{ $breakpoint.next }}-block sidebar-overflow sticky-top pt-5">
|
||||||
{{ $sidebar | safeHTML }}
|
{{ $sidebar | safeHTML }}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-{{ $breakpoint.current }}-9 col-{{ $breakpoint.next }}-8 mb-5 p-4">
|
<div class="col-12 col-{{ $breakpoint.current }}-9 col-{{ $breakpoint.next }}-8 mb-5 p-4">
|
||||||
{{ partial "partials/single-main.html" . }}
|
{{ .Render "single/main" }}
|
||||||
</div>
|
</div>
|
||||||
<div class="col col-{{ $breakpoint.current }}-3 col-{{ $breakpoint.next }}-2 d-none d-{{ $breakpoint.current }}-block pt-5">
|
<div class="col col-{{ $breakpoint.current }}-3 col-{{ $breakpoint.next }}-2 d-none d-{{ $breakpoint.current }}-block pt-5">
|
||||||
{{ $toc | safeHTML }}
|
{{ $toc | safeHTML }}
|
||||||
@@ -51,7 +21,7 @@
|
|||||||
{{ else }}
|
{{ else }}
|
||||||
<div class="row row-cols-1 row-cols-{{ $breakpoint.current }}-2">
|
<div class="row row-cols-1 row-cols-{{ $breakpoint.current }}-2">
|
||||||
<div class="col col-{{ $breakpoint.prev }}-12 col-{{ $breakpoint.current }}-9">
|
<div class="col col-{{ $breakpoint.prev }}-12 col-{{ $breakpoint.current }}-9">
|
||||||
{{ partial "partials/single-main.html" . }}
|
{{ .Render "single/main" }}
|
||||||
</div>
|
</div>
|
||||||
<div class="col col-{{ $breakpoint.current }}-3 d-none d-{{ $breakpoint.current }}-block">
|
<div class="col col-{{ $breakpoint.current }}-3 d-none d-{{ $breakpoint.current }}-block">
|
||||||
{{ $toc | safeHTML }}
|
{{ $toc | safeHTML }}
|
||||||
|
11
layouts/_default/single/main.html
Normal file
11
layouts/_default/single/main.html
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{{- $breakpoint := $.Scratch.Get "breakpoint" -}}
|
||||||
|
{{ if .Site.Params.navigation.breadcrumb }}{{ partial "assets/breadcrumb.html" (dict "page" .) }}{{ end -}}
|
||||||
|
|
||||||
|
{{ .Render "single/header" }}
|
||||||
|
|
||||||
|
{{- if and .Site.Params.navigation.toc .Params.includeToc | default true -}}
|
||||||
|
<div class="d-{{ $breakpoint.current }}-none pb-5">{{ partial "assets/toc-dropdown.html" (dict "page" .) }}</div>
|
||||||
|
{{- end -}}
|
||||||
|
{{ .Render "single/body" }}
|
||||||
|
|
||||||
|
{{ .Render "single/footer" }}
|
19
layouts/_default/single/sidebar.html
Normal file
19
layouts/_default/single/sidebar.html
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{{- $menu := .Scratch.Get "sidebar" -}}
|
||||||
|
{{- $version := .Scratch.Get "version" -}}
|
||||||
|
{{ $sidebar := "" }}
|
||||||
|
{{- $hasSidebar := .Site.Params.navigation.sidebar | default true -}}
|
||||||
|
{{ if and $menu $hasSidebar }}{{ $sidebar = partial "assets/sidebar.html" (dict "page" . "menu" $menu "version" $version) }}{{ end }}
|
||||||
|
|
||||||
|
{{ if $sidebar -}}
|
||||||
|
<div class="offcanvas offcanvas-start" tabindex="-1" id="offcanvass-sidebar" aria-inledby="offcanvas-label">
|
||||||
|
<div class="offcanvas-header">
|
||||||
|
<h5 class="offcanvas-title" id="offcanvas-label">{{ strings.FirstUpper $.Section }}</h5>
|
||||||
|
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="{{ T "close" }}"></button>
|
||||||
|
</div>
|
||||||
|
<div class="offcanvas-body">
|
||||||
|
{{ $sidebar | safeHTML }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{ else if .Site.Params.navigation.sidebar }}
|
||||||
|
|
||||||
|
{{ end }}
|
25
layouts/partials/footer/optional-scripts.html
Normal file
25
layouts/partials/footer/optional-scripts.html
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{{ $page_modules := slice }}
|
||||||
|
{{ if reflect.IsMap .Params.modules }}
|
||||||
|
{{ $page_modules = .Params.modules }}
|
||||||
|
{{ else }}
|
||||||
|
{{ $page_modules = $page_modules | append .Params.modules }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{- $modules := site.Params.modules.optional | intersect $page_modules -}}
|
||||||
|
{{- range $index, $mod := $modules -}}
|
||||||
|
{{- $filename := printf "js/%s.bundle.js" $mod -}}
|
||||||
|
{{- $match := printf "js/modules/%s/**.js" $mod -}}
|
||||||
|
{{- $skipTemplate := false -}}
|
||||||
|
{{- if reflect.IsSlice site.Params.modules.disableTemplate -}}
|
||||||
|
{{- if in site.Params.modules.disableTemplate $mod}}
|
||||||
|
{{- $skipTemplate = true -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{ $state := "" }}
|
||||||
|
{{- with (index site.Params.modules $mod) -}}
|
||||||
|
{{- with index . "state" }}{{ $state = . }}{{ end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- partial "footer/scripts.html" (dict "filename" $filename "match" $match "header" false "skipTemplate" $skipTemplate "state" $state "page" .) }}
|
||||||
|
{{- end -}}
|
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@gethinode/hinode",
|
"name": "@gethinode/hinode",
|
||||||
"version": "0.23.0-beta",
|
"version": "0.23.0-beta2",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@gethinode/hinode",
|
"name": "@gethinode/hinode",
|
||||||
"version": "0.23.0-beta",
|
"version": "0.23.0-beta2",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@fullhuman/postcss-purgecss": "^5.0.0",
|
"@fullhuman/postcss-purgecss": "^5.0.0",
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@gethinode/hinode",
|
"name": "@gethinode/hinode",
|
||||||
"version": "0.23.0-beta",
|
"version": "0.23.0-beta2",
|
||||||
"description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator",
|
"description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"hugo",
|
"hugo",
|
||||||
|
Reference in New Issue
Block a user