diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 3b3f60d885..0000000000 --- a/.gitmodules +++ /dev/null @@ -1,9 +0,0 @@ -[submodule "themes/hugo-darktable-docs-theme"] - path = themes/hugo-darktable-docs-theme - url = https://github.com/pixlsus/hugo-darktable-docs-theme.git -[submodule "themes/hugo-darktable-docs-pdf-theme"] - path = themes/hugo-darktable-docs-pdf-theme - url = https://github.com/pixlsus/hugo-darktable-docs-pdf-theme.git -[submodule "themes/hugo-darktable-docs-epub-theme"] - path = themes/hugo-darktable-docs-epub-theme - url = https://github.com/pixlsus/hugo-darktable-docs-epub-theme.git diff --git a/themes/hugo-darktable-docs-epub-theme b/themes/hugo-darktable-docs-epub-theme deleted file mode 160000 index e378baf97e..0000000000 --- a/themes/hugo-darktable-docs-epub-theme +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e378baf97e67d4a9569f67e72093e80d91d20238 diff --git a/themes/hugo-darktable-docs-epub-theme/.gitignore b/themes/hugo-darktable-docs-epub-theme/.gitignore new file mode 100644 index 0000000000..c2022ca816 --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/.gitignore @@ -0,0 +1,2 @@ +.directory +*/node_modules/* \ No newline at end of file diff --git a/themes/hugo-darktable-docs-epub-theme/LICENSE b/themes/hugo-darktable-docs-epub-theme/LICENSE new file mode 100644 index 0000000000..faff36ecad --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2020 YOUR_NAME_HERE + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/themes/hugo-darktable-docs-epub-theme/assets/sass/main.scss b/themes/hugo-darktable-docs-epub-theme/assets/sass/main.scss new file mode 100644 index 0000000000..91b2720202 --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/assets/sass/main.scss @@ -0,0 +1,13 @@ +/* Override any bootstrap variables here before importing bootstrap itself */ +@import 'modules/fonts'; +@import 'modules/typography'; +@import 'modules/page'; +@import 'modules/cover-front'; +@import 'modules/cover-back'; +@import 'modules/body-page'; +@import 'modules/toc'; +@import 'modules/bookmarks'; +@import 'modules/numbering'; + +/* Theme customizations */ +@import 'modules/images'; diff --git a/themes/hugo-darktable-docs-epub-theme/assets/sass/modules/body-page.scss b/themes/hugo-darktable-docs-epub-theme/assets/sass/modules/body-page.scss new file mode 100644 index 0000000000..fc65b99272 --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/assets/sass/modules/body-page.scss @@ -0,0 +1,61 @@ +#body > .section { + page: body; +} + +#cover-front > .title { + string-set: front-cover-title content(); +} + +#body > .section > .head1.title { + string-set: chapter content(); +} + +#body > .section > .section > .head1.title { + string-set: section content(); +} + +@mixin border-top { + border-top: 1px solid gray; +} + +@mixin border-bottom { + border-bottom: 1px solid gray; +} + +@page body { + @include border-top; + @include border-bottom; + padding-top: 6px; + padding-bottom: 6px; + @top-left-corner { + content: ""; + } + @top-left { + content: string(chapter); + } + @top-center { + content: ""; + } + @top-right { + content: string(section); + } + @top-right-corner { + content: ""; + } + + @bottom-left-corner { + content: ""; + } + @bottom-left { + content: string(front-cover-title); + } + @bottom-center { + content: ""; + } + @bottom-right { + content: counter(page); + } + @bottom-right-corner { + content: ""; + } +} diff --git a/themes/hugo-darktable-docs-epub-theme/assets/sass/modules/bookmarks.scss b/themes/hugo-darktable-docs-epub-theme/assets/sass/modules/bookmarks.scss new file mode 100644 index 0000000000..226f77a277 --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/assets/sass/modules/bookmarks.scss @@ -0,0 +1,42 @@ +.section { + .title { + bookmark-level: 1; + } + .content { + .head1, + .head2, + .head3 { + bookmark-level: none; + } + } +} + +.section > .section { + .title { + bookmark-level: 2; + } +} + +.section > .section > .section { + .title { + bookmark-level: 3; + } +} + +.section > .section > .section > .section { + .title { + bookmark-level: 4; + } +} + +.section > .section > .section > .section > .section { + .title { + bookmark-level: 5; + } +} + +.section > .section > .section > .section > .section > .section { + .title { + bookmark-level: 6; + } +} diff --git a/themes/hugo-darktable-docs-epub-theme/assets/sass/modules/cover-back.scss b/themes/hugo-darktable-docs-epub-theme/assets/sass/modules/cover-back.scss new file mode 100644 index 0000000000..166c50a0c4 --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/assets/sass/modules/cover-back.scss @@ -0,0 +1,40 @@ +#cover-back { + page: cover-back; + break-before: always; + text-align: center; + margin-top: 95%; +} + +@page cover-front { + @top-left-corner { + content: none; + } + @top-left { + content: none; + } + @top-center { + content: none; + } + @top-right { + content: none; + } + @top-right-corner { + content: none; + } + + @bottom-left-corner { + content: none; + } + @bottom-left { + content: none; + } + @bottom-center { + content: none; + } + @bottom-right { + content: none; + } + @bottom-right-corner { + content: none; + } +} diff --git a/themes/hugo-darktable-docs-epub-theme/assets/sass/modules/cover-front.scss b/themes/hugo-darktable-docs-epub-theme/assets/sass/modules/cover-front.scss new file mode 100644 index 0000000000..202ef61426 --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/assets/sass/modules/cover-front.scss @@ -0,0 +1,55 @@ +#cover-front { + page: cover-front; + break-after: always; + padding-top: 35%; + height: 11in; + width: 8.5in; + .title { + text-align: center; + font-size: 48px; + line-height: 52px; + } + .title::before { + content: url(darktable-logo.svg); + display: block; + transform: scale(0.5); + margin: 0px auto; + margin-bottom: -10rem; + } +} + +@page cover-front { + margin: 0; + padding: 0; + @top-left-corner { + content: none; + } + @top-left { + content: none; + } + @top-center { + content: none; + } + @top-right { + content: none; + } + @top-right-corner { + content: none; + } + + @bottom-left-corner { + content: none; + } + @bottom-left { + content: none; + } + @bottom-center { + content: none; + } + @bottom-right { + content: none; + } + @bottom-right-corner { + content: none; + } +} diff --git a/themes/hugo-darktable-docs-epub-theme/assets/sass/modules/fonts.scss b/themes/hugo-darktable-docs-epub-theme/assets/sass/modules/fonts.scss new file mode 100644 index 0000000000..b1272d9c44 --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/assets/sass/modules/fonts.scss @@ -0,0 +1,7 @@ +* { + font-family: sans-serif; +} + +pre, code { + font-family: monospace; +} diff --git a/themes/hugo-darktable-docs-epub-theme/assets/sass/modules/images.scss b/themes/hugo-darktable-docs-epub-theme/assets/sass/modules/images.scss new file mode 100644 index 0000000000..51b3110397 --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/assets/sass/modules/images.scss @@ -0,0 +1,39 @@ +img { + display: block; + max-width: 100%; +} + +.icon { + width: 25px; + display: inline-block; + vertical-align: middle; +} + +.inline { + display: inline; + vertical-align: middle; +} + +.w25 { + width: 24%; +} + +.w33 { + width: 33%; +} + +.w50 { + width: 48%; +} + +.w66 { + width: 66%; +} + +.w75 { + width: 72%; +} + +.w100 { + width: 100%; +} diff --git a/themes/hugo-darktable-docs-epub-theme/assets/sass/modules/numbering.scss b/themes/hugo-darktable-docs-epub-theme/assets/sass/modules/numbering.scss new file mode 100644 index 0000000000..fd48aede3f --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/assets/sass/modules/numbering.scss @@ -0,0 +1,45 @@ +// The counters for the sections and ToC are presented together to keep the numbering consistent. + +// Section 1 +#body > .section, +#toc-body > ul > li { + counter-increment: section-1; +} + +#body > .section > .title:before, +#toc-body > ul > li > a:before { + content: counter(section-1) ". "; +} + +// Section 2 +#body > .section > .section, +#toc-body > ul > li > ul > li { + counter-increment: section-2; +} + +#body > .section > .section > .title:before, +#toc-body > ul > li > ul > li > a:before { + content: counter(section-1) "." counter(section-2) ". "; +} + +// Section 3 +#body > .section > .section > .section, +#toc-body > ul > li > ul > li > ul > li { + counter-increment: section-3; +} + +#body > .section > .section > .section > .title:before, +#toc-body > ul > li > ul > li > ul > li > a:before { + content: counter(section-1) "." counter(section-2) "." counter(section-3) ". "; +} + +// Section 4 +#body > .section > .section > .section > .section, +#toc-body > ul > li > ul > li > ul > li > ul > li { + counter-increment: section-4; +} + +#body > .section > .section > .section > .section > .title:before, +#toc-body > ul > li > ul > li > ul > li > ul > li > a:before { + content: counter(section-1) "." counter(section-2) "." counter(section-3) "." counter(section-4) ". "; +} diff --git a/themes/hugo-darktable-docs-epub-theme/assets/sass/modules/page.scss b/themes/hugo-darktable-docs-epub-theme/assets/sass/modules/page.scss new file mode 100644 index 0000000000..b7dc04cb93 --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/assets/sass/modules/page.scss @@ -0,0 +1,9 @@ +// Basic page definition + +@page { + size: letter portrait; + margin-top: 0.5in; + margin-bottom: 0.5in; + margin-right: 0.25in; + margin-left: 0.25in; +} diff --git a/themes/hugo-darktable-docs-epub-theme/assets/sass/modules/toc.scss b/themes/hugo-darktable-docs-epub-theme/assets/sass/modules/toc.scss new file mode 100644 index 0000000000..26a9fef70a --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/assets/sass/modules/toc.scss @@ -0,0 +1,24 @@ +#toc { + break-after: always; + .title { + font-size: 2.323em; + } + #toc-body { + columns: 2; + ul { + list-style-type: none; + padding-left: 15px; + li { + padding-top: 1px; + padding-bottom: 2px; + a { + color: black; + text-decoration: none; + } + a:after { + content: " " target-counter(attr(href), page); + } + } + } + } +} diff --git a/themes/hugo-darktable-docs-epub-theme/assets/sass/modules/typography.scss b/themes/hugo-darktable-docs-epub-theme/assets/sass/modules/typography.scss new file mode 100644 index 0000000000..ac985f4d3f --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/assets/sass/modules/typography.scss @@ -0,0 +1,138 @@ +// Major Second typographical rhythm from https://type-scale.com/ + +html { + font-size: 100%; /*16px*/ +} + +body { + background-color: white; + font-family: 'Fira Sans', sans-serif; + font-weight: 400; + line-height: 1.65; + color: #333; +} + +pre, code, kbd { + font-family: 'Fira Mono', monospace; + font-size: 0.9em; + color: navy; +} + +p { + margin-bottom: 1rem; + margin-top: 1rem; + margin-left: 0; + margin-right: 0; + text-indent: 0; +} + +.head1, .head2, .head3, .head4, .head5 { + margin-top: 0.5em; + margin-bottom: 1em; + font-family: 'Fira Sans', sans-serif; + font-weight: 400; + line-height: 1.15; +} + +.head1 { + font-size: 1.7em; + margin: 0; +} + +.head1.title.depth-1 { + margin-top: 0.5em; + margin-bottom: 1.2em; + font-size: 3em; +} + +.head1.title.depth-2 { + margin-top: 0.5em; + margin-bottom: 1.2em; + font-size: 2.6em; +} + +.head1.title.depth-3, +.head1.title.depth-4, +.head1.title.depth-5 { + margin-top: 0.5em; + margin-bottom: 1.2em; + font-size: 2.2em; +} + +.head1+.head2 { + margin-top: 0; +} + +.head2 { + font-size: 1.4em; +} + +.head2+.head3 { + margin-top: 0; +} + +.head3 { + + font-size: 1.2em; + font-style: italic; +} + +.head4, +.head5, +.head6 { + color: red; + :before { + content: "We only allow H1, H2, or H3 headings in body content." + } +} + +small, .text_small { + font-size: 0.889em; +} + +dd, pre { + margin-left: 20px; +} + +dt { + margin-top: 1rem; + font-weight: bold; +} + +ul { + margin-top: 0; + margin-bottom: 0; +} + +article ul li, +article ul li p, +dd p { + margin-top: 0.7rem; + margin-bottom: 0.7rem; +} + +nav ol, +nav ol li, +nav ol li ol +{ + list-style-type: none; + padding-left: 1em; + margin-left: 0; + text-indent: 0; +} + +nav ol +{ + padding-left: 0em; +} + +.webonly +{ + display: none; +} + +hr +{ + margin-top: 1em; + margin-bottom: 1em; +} diff --git a/themes/hugo-darktable-docs-epub-theme/i18n/en.yaml b/themes/hugo-darktable-docs-epub-theme/i18n/en.yaml new file mode 100644 index 0000000000..435bd3b903 --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/i18n/en.yaml @@ -0,0 +1,8 @@ +- id: toc + translation: "Table of Contents" + +- id: copyright + translation: "Copyright" + +- id: copyrightEntity + translation: "Someone or something" diff --git a/themes/hugo-darktable-docs-epub-theme/i18n/pt_br.yaml b/themes/hugo-darktable-docs-epub-theme/i18n/pt_br.yaml new file mode 100644 index 0000000000..d66fc0fb88 --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/i18n/pt_br.yaml @@ -0,0 +1,8 @@ +- id: toc + translation: "Índice" + +- id: copyright + translation: "Copyright" + +- id: copyrightEntity + translation: "Alguém ou alguma coisa" diff --git a/themes/hugo-darktable-docs-epub-theme/layouts/_default/_markup/render-heading.html b/themes/hugo-darktable-docs-epub-theme/layouts/_default/_markup/render-heading.html new file mode 100644 index 0000000000..db98045960 --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/layouts/_default/_markup/render-heading.html @@ -0,0 +1 @@ +

{{ .Text | safeHTML }}

diff --git a/themes/hugo-darktable-docs-epub-theme/layouts/_default/_markup/render-image.html b/themes/hugo-darktable-docs-epub-theme/layouts/_default/_markup/render-image.html new file mode 100644 index 0000000000..a3996f88e7 --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/layouts/_default/_markup/render-image.html @@ -0,0 +1,10 @@ +{{ $link := string .Destination }} +{{ $imgBase := path.Base .Destination }} + +{{ $classSplit := split $imgBase "#" }} + +{{ if hasPrefix $link "http" }} +{{ .Text }} +{{ else }} +{{ .Text }} +{{ end }} diff --git a/themes/hugo-darktable-docs-epub-theme/layouts/_default/_markup/render-link.html b/themes/hugo-darktable-docs-epub-theme/layouts/_default/_markup/render-link.html new file mode 100644 index 0000000000..d3386785b6 --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/layouts/_default/_markup/render-link.html @@ -0,0 +1,20 @@ +{{ $link := strings.Replace .Destination "_index.md" "" }} +{{- /* This comment removes newlines. */ -}} +{{ $isRemote := strings.HasPrefix $link "http" }} +{{- /* This comment removes newlines. */ -}} +{{- if not $isRemote -}} +{{- /* This comment removes newlines. */ -}} +{{ $url := urls.Parse $link }} +{{- /* This comment removes newlines. */ -}} +{{- if $url.Path -}} +{{- /* This comment removes newlines. */ -}} +{{ $fragment := "" }} +{{- /* This comment removes newlines. */ -}} +{{- with $url.Fragment }}{{ $fragment = printf "#%s" . }}{{ end -}} +{{- /* This comment removes newlines. */ -}} +{{- with .Page.GetPage $url.Path }}{{ $link = printf "%s%s" .RelPermalink $fragment }}{{ end }}{{ end -}} +{{- /* This comment removes newlines. */ -}} +{{- end -}} +{{- /* This comment removes newlines. */ -}} +{{ .Text | safeHTML }} +{{- /* This comment removes newlines. */ -}} diff --git a/themes/hugo-darktable-docs-epub-theme/layouts/_default/baseof.html b/themes/hugo-darktable-docs-epub-theme/layouts/_default/baseof.html new file mode 100644 index 0000000000..0aaca3358e --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/layouts/_default/baseof.html @@ -0,0 +1,17 @@ +{{- printf "" | safeHTML }} +{{- .Scratch.Set "depth" ( strings.Count "/" .Permalink ) -}} + + + {{ partial "css.html" . }} + + +
+ {{ block "main" .}} + + {{ end }} +
+ + + diff --git a/themes/hugo-darktable-docs-epub-theme/layouts/_default/index.html b/themes/hugo-darktable-docs-epub-theme/layouts/_default/index.html new file mode 100644 index 0000000000..a470a5263a --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/layouts/_default/index.html @@ -0,0 +1,15 @@ +{{ define "title" }}{{ .Title | markdownify }} | {{ .Site.Title }}{{ end }} +{{ define "main" }} +{{ $dateFormat := default "Mon Jan 2, 2006" (index .Site.Params "date_format") }} + +
+ +

+ {{ .Site.Title | markdownify }} +

+ + {{ .Content }} + +
+ +{{ end }} diff --git a/themes/hugo-darktable-docs-epub-theme/layouts/_default/index.ncx b/themes/hugo-darktable-docs-epub-theme/layouts/_default/index.ncx new file mode 100644 index 0000000000..e3fe5deefc --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/layouts/_default/index.ncx @@ -0,0 +1,34 @@ +{{- printf "" | safeHTML }} + + + + + + + + {{ .Site.Params.title }} + {{ .Site.Params.creator }} + + + + + + darktable user manual + + + + + + + darktable user manual + + + + + {{ partial "nav.ncx" . }} + + + diff --git a/themes/hugo-darktable-docs-epub-theme/layouts/_default/index.opf b/themes/hugo-darktable-docs-epub-theme/layouts/_default/index.opf new file mode 100644 index 0000000000..879869d373 --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/layouts/_default/index.opf @@ -0,0 +1,51 @@ +{{- printf "" | safeHTML }} + + + + {{ .Site.Params.bookid | default now.Unix }} + {{ .Lang }} + {{ .Site.Title }} + {{ .Site.Params.description }} + {{ .Site.Params.creator }} + {{ .Site.Params.creator }} + aut + {{ now.Format "2006-01-02T15:04:05Z" }} + {{ now.Format "2006-01-02T15:04:05 MST" }} + {{ .Site.Params.publisher }} + application/epub+zip + Text + {{ range .Site.Params.subject -}} + {{ . }} + {{ end -}} + {{ .Site.Params.audience }} + scrolled-doc + + + + + + + + + + + + + {{ partial "manifest.opf" . }} + + + + + + + + {{ partial "spine.opf" . }} + + + diff --git a/themes/hugo-darktable-docs-epub-theme/layouts/_default/index.xhtml b/themes/hugo-darktable-docs-epub-theme/layouts/_default/index.xhtml new file mode 100644 index 0000000000..328064956f --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/layouts/_default/index.xhtml @@ -0,0 +1,21 @@ + + + + Darktable User Manual + {{ partial "css.html" . }} + + + +

Table of Contents

+ + + diff --git a/themes/hugo-darktable-docs-epub-theme/layouts/_default/list.html b/themes/hugo-darktable-docs-epub-theme/layouts/_default/list.html new file mode 100644 index 0000000000..2e7add47ae --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/layouts/_default/list.html @@ -0,0 +1,23 @@ +{{ define "main" }} + +
+

{{ .Title }}

+ +
+ +{{ end }} diff --git a/themes/hugo-darktable-docs-epub-theme/layouts/_default/single.html b/themes/hugo-darktable-docs-epub-theme/layouts/_default/single.html new file mode 100644 index 0000000000..beec1b4881 --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/layouts/_default/single.html @@ -0,0 +1,15 @@ +{{ define "title" }}{{ .Title | markdownify }} | {{ .Site.Title }}{{ end }} +{{ define "main" }} +{{ $dateFormat := default "Mon Jan 2, 2006" (index .Site.Params "date_format") }} + +
+ +

+ {{ .Title | markdownify }} +

+ + {{ .Content }} + +
+ +{{ end }} diff --git a/themes/hugo-darktable-docs-epub-theme/layouts/mimetype b/themes/hugo-darktable-docs-epub-theme/layouts/mimetype new file mode 100644 index 0000000000..57ef03f24a --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/layouts/mimetype @@ -0,0 +1 @@ +application/epub+zip \ No newline at end of file diff --git a/themes/hugo-darktable-docs-epub-theme/layouts/partials/content_gen.html b/themes/hugo-darktable-docs-epub-theme/layouts/partials/content_gen.html new file mode 100644 index 0000000000..314fb6d0d8 --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/layouts/partials/content_gen.html @@ -0,0 +1,20 @@ +
+ {{ with .Site.GetPage "/" }} + {{ range .Sections.ByWeight }} + {{/* We don't want a menu item for specific pages listed here */}} + {{ if (and (ne .Title "Posts") (ne .Title "Test Page")) }} +
+

+ {{ .Title }} +

+ {{ if gt (countwords .Content) 1 }} +
+ {{- .Content -}} +
+ {{ end }} + {{ partial "content_recursive.html" . }} +
+ {{ end }} + {{ end }} + {{ end }} +
diff --git a/themes/hugo-darktable-docs-epub-theme/layouts/partials/content_recursive.html b/themes/hugo-darktable-docs-epub-theme/layouts/partials/content_recursive.html new file mode 100644 index 0000000000..828bacb6c5 --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/layouts/partials/content_recursive.html @@ -0,0 +1,14 @@ +{{ $child_pages := union .Sections .Pages }} +{{ range $child_pages.ByWeight }} +
+

+ {{ .Title }} +

+ {{ if gt (countwords .Content) 1 }} +
+ {{- .Content -}} +
+ {{ end }} + {{ partial "content_recursive.html" . }} +
+{{ end }} diff --git a/themes/hugo-darktable-docs-epub-theme/layouts/partials/cover-back.html b/themes/hugo-darktable-docs-epub-theme/layouts/partials/cover-back.html new file mode 100644 index 0000000000..3924ebb71f --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/layouts/partials/cover-back.html @@ -0,0 +1,8 @@ +
+
+ {{ .Site.Title }} +
+
+ {{ now.Format "January 2, 2006" }} +
+
diff --git a/themes/hugo-darktable-docs-epub-theme/layouts/partials/cover-front.html b/themes/hugo-darktable-docs-epub-theme/layouts/partials/cover-front.html new file mode 100644 index 0000000000..d2bf43ea5b --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/layouts/partials/cover-front.html @@ -0,0 +1,5 @@ +
+
+ {{ .Site.Title }} +
+
diff --git a/themes/hugo-darktable-docs-epub-theme/layouts/partials/css.html b/themes/hugo-darktable-docs-epub-theme/layouts/partials/css.html new file mode 100644 index 0000000000..383cd754cf --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/layouts/partials/css.html @@ -0,0 +1,5 @@ + + +{{ $options := (dict "targetPath" "style.css" "enableSourceMap" true) }} +{{ $style := resources.Get "sass/main.scss" | resources.ToCSS $options }} + diff --git a/themes/hugo-darktable-docs-epub-theme/layouts/partials/head-meta.xhtml b/themes/hugo-darktable-docs-epub-theme/layouts/partials/head-meta.xhtml new file mode 100644 index 0000000000..eeb88a15d9 --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/layouts/partials/head-meta.xhtml @@ -0,0 +1,3 @@ + +{{ block "title" . }}{{ .Site.Title }}{{ if .Title }} - {{ .Title }}{{ end }}{{ end }} + diff --git a/themes/hugo-darktable-docs-epub-theme/layouts/partials/manifest.opf b/themes/hugo-darktable-docs-epub-theme/layouts/partials/manifest.opf new file mode 100644 index 0000000000..9a6544527a --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/layouts/partials/manifest.opf @@ -0,0 +1,14 @@ +{{- with .Site.GetPage "/" -}} +{{- template "manifest-children" (dict "Section" . "CurrentPage" .) -}} +{{- end -}} + +{{- define "manifest-children" -}}{{- /* (dict "Section" .Section "CurrentPage" .CurrentPage) */ -}} + {{- range .Section.Pages -}} + {{ if .IsSection }} + + {{ template "manifest-children" (dict "Section" . "CurrentPage" $.CurrentPage) }} + {{ else if and .IsPage .Content }} + + {{ end }} + {{- end -}} +{{- end -}} diff --git a/themes/hugo-darktable-docs-epub-theme/layouts/partials/nav.ncx b/themes/hugo-darktable-docs-epub-theme/layouts/partials/nav.ncx new file mode 100644 index 0000000000..8ac7873082 --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/layouts/partials/nav.ncx @@ -0,0 +1,34 @@ +{{- .Scratch.Set "i" 2 -}} +{{- with .Site.GetPage "/" -}} +{{- template "nav-children" (dict "Section" . "CurrentPage" .) -}} +{{- end -}} + +{{- define "nav-children" -}}{{- /* (dict "Section" .Section "CurrentPage" .CurrentPage) */ -}} + {{- range .Section.Pages -}} + {{ $i := ( $.CurrentPage.Scratch.Get "i" ) -}} + {{ if .IsSection }} + + + {{ .Title }} + + + {{ $i := ( $.CurrentPage.Scratch.Get "i" ) -}} + {{ $i = add $i 1 -}} + {{- $.CurrentPage.Scratch.Set "i" $i -}} + {{ template "nav-children" (dict "Section" . "CurrentPage" $.CurrentPage) }} + + {{ else if and .IsPage .Content }} + + + {{ .Title }} + + + + {{ $i := ( $.CurrentPage.Scratch.Get "i" ) -}} + {{ $i = add $i 1 -}} + {{- $.CurrentPage.Scratch.Set "i" $i -}} + {{ end }} + {{- end -}} +{{- end -}} diff --git a/themes/hugo-darktable-docs-epub-theme/layouts/partials/nav.xhtml b/themes/hugo-darktable-docs-epub-theme/layouts/partials/nav.xhtml new file mode 100644 index 0000000000..c4139abf13 --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/layouts/partials/nav.xhtml @@ -0,0 +1,21 @@ +{{- .Scratch.Set "i" 1 -}} +{{- with .Site.GetPage "/" -}} +{{- template "nav-nav-children" (dict "Section" . "CurrentPage" .) -}} +{{- end -}} + +{{- define "nav-nav-children" -}}{{- /* (dict "Section" .Section "CurrentPage" .CurrentPage) */ -}} + {{- range .Section.Pages -}} + {{ $i := ( $.CurrentPage.Scratch.Get "i" ) -}} + {{ if .IsSection }} +
  • + {{ .Title }} + {{ $i := ( $.CurrentPage.Scratch.Get "i" ) -}} +
      + {{ template "nav-nav-children" (dict "Section" . "CurrentPage" $.CurrentPage) }} +
    +
  • + {{ else if and .IsPage .Content }} +
  • {{ .Title }}
  • + {{ end }} + {{- end -}} +{{- end -}} diff --git a/themes/hugo-darktable-docs-epub-theme/layouts/partials/spine.opf b/themes/hugo-darktable-docs-epub-theme/layouts/partials/spine.opf new file mode 100644 index 0000000000..bc77520177 --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/layouts/partials/spine.opf @@ -0,0 +1,14 @@ +{{- with .Site.GetPage "/" -}} +{{- template "spine-children" (dict "Section" . "CurrentPage" .) -}} +{{- end -}} + +{{- define "spine-children" -}}{{- /* (dict "Section" .Section "CurrentPage" .CurrentPage) */ -}} + {{- range .Section.Pages -}} + {{ if .IsSection }} + + {{ template "spine-children" (dict "Section" . "CurrentPage" $.CurrentPage) }} + {{ else if and .IsPage .Content }} + + {{ end }} + {{- end -}} +{{- end -}} diff --git a/themes/hugo-darktable-docs-epub-theme/layouts/partials/toc.html b/themes/hugo-darktable-docs-epub-theme/layouts/partials/toc.html new file mode 100644 index 0000000000..a8bc084738 --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/layouts/partials/toc.html @@ -0,0 +1,8 @@ +
    +

    + {{ i18n "toc" }} +

    +
    + {{ partial "toc_gen.html" . }} +
    +
    diff --git a/themes/hugo-darktable-docs-epub-theme/layouts/partials/toc_gen.html b/themes/hugo-darktable-docs-epub-theme/layouts/partials/toc_gen.html new file mode 100644 index 0000000000..5861990b55 --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/layouts/partials/toc_gen.html @@ -0,0 +1,17 @@ +
      + {{ with .Site.GetPage "/" }} + {{ range .Sections.ByWeight }} + {{/* We don't want a menu item for specific pages listed here */}} + {{ if (and (ne .Title "Posts") (ne .Title "Test Page")) }} +
    • + + {{ .Title }} + + + {{ partial "toc_recursive.html" . }} +
    • + {{ end }} + {{ end }} + {{ end }} +
    diff --git a/themes/hugo-darktable-docs-epub-theme/layouts/partials/toc_recursive.html b/themes/hugo-darktable-docs-epub-theme/layouts/partials/toc_recursive.html new file mode 100644 index 0000000000..6092358b9d --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/layouts/partials/toc_recursive.html @@ -0,0 +1,11 @@ + {{ $child_pages := union .Sections .Pages }} +
      + {{ range $child_pages.ByWeight }} +
    • + + {{ .Title }} + + {{ partial "toc_recursive.html" . }} +
    • + {{ end }} +
    diff --git a/themes/hugo-darktable-docs-epub-theme/static/META-INF/container.xml b/themes/hugo-darktable-docs-epub-theme/static/META-INF/container.xml new file mode 100644 index 0000000000..6e11836876 --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/static/META-INF/container.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/themes/hugo-darktable-docs-epub-theme/static/OEBPS/front-cover.html b/themes/hugo-darktable-docs-epub-theme/static/OEBPS/front-cover.html new file mode 100644 index 0000000000..37efd4a4d9 --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/static/OEBPS/front-cover.html @@ -0,0 +1,7 @@ + + +
    + + diff --git a/themes/hugo-darktable-docs-epub-theme/static/OEBPS/front-cover.png b/themes/hugo-darktable-docs-epub-theme/static/OEBPS/front-cover.png new file mode 100644 index 0000000000..b54457a039 Binary files /dev/null and b/themes/hugo-darktable-docs-epub-theme/static/OEBPS/front-cover.png differ diff --git a/themes/hugo-darktable-docs-epub-theme/static/mimetype b/themes/hugo-darktable-docs-epub-theme/static/mimetype new file mode 100644 index 0000000000..57ef03f24a --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/static/mimetype @@ -0,0 +1 @@ +application/epub+zip \ No newline at end of file diff --git a/themes/hugo-darktable-docs-epub-theme/theme.toml b/themes/hugo-darktable-docs-epub-theme/theme.toml new file mode 100644 index 0000000000..3dfbada0d6 --- /dev/null +++ b/themes/hugo-darktable-docs-epub-theme/theme.toml @@ -0,0 +1,15 @@ +# theme.toml template for a Hugo theme +# See https://github.com/gohugoio/hugoThemes#themetoml for an example + +name = "Hugo Darktable Docs Pdf Theme" +license = "MIT" +licenselink = "https://gitlab.com/pixlsus/hugo-darktable-docs-pdf-theme/blob/master/LICENSE" +description = "" +homepage = "https://gitlab.com/pixlsus/hugo-darktable-docs-pdf-theme" +tags = [] +features = [] +min_version = "0.41.0" + +[author] + name = "Mica Semrick" + homepage = "https://silentumbrella.com" diff --git a/themes/hugo-darktable-docs-pdf-theme b/themes/hugo-darktable-docs-pdf-theme deleted file mode 160000 index 1ca027b0bc..0000000000 --- a/themes/hugo-darktable-docs-pdf-theme +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1ca027b0bc73051ec1128dbbcba54691bae36828 diff --git a/themes/hugo-darktable-docs-pdf-theme/LICENSE b/themes/hugo-darktable-docs-pdf-theme/LICENSE new file mode 100644 index 0000000000..faff36ecad --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2020 YOUR_NAME_HERE + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/themes/hugo-darktable-docs-pdf-theme/assets/sass/main.scss b/themes/hugo-darktable-docs-pdf-theme/assets/sass/main.scss new file mode 100644 index 0000000000..91b2720202 --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/assets/sass/main.scss @@ -0,0 +1,13 @@ +/* Override any bootstrap variables here before importing bootstrap itself */ +@import 'modules/fonts'; +@import 'modules/typography'; +@import 'modules/page'; +@import 'modules/cover-front'; +@import 'modules/cover-back'; +@import 'modules/body-page'; +@import 'modules/toc'; +@import 'modules/bookmarks'; +@import 'modules/numbering'; + +/* Theme customizations */ +@import 'modules/images'; diff --git a/themes/hugo-darktable-docs-pdf-theme/assets/sass/modules/body-page.scss b/themes/hugo-darktable-docs-pdf-theme/assets/sass/modules/body-page.scss new file mode 100644 index 0000000000..fc28af21f5 --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/assets/sass/modules/body-page.scss @@ -0,0 +1,61 @@ +#body > .section { + page: body; +} + +#cover-front > .title { + string-set: front-cover-title content(); +} + +#body > .section > h1.title { + string-set: chapter content(); +} + +#body > .section > .section > h1.title { + string-set: section content(); +} + +@mixin border-top { + border-top: 1px solid gray; +} + +@mixin border-bottom { + border-bottom: 1px solid gray; +} + +@page body { + @include border-top; + @include border-bottom; + padding-top: 6px; + padding-bottom: 6px; + @top-left-corner { + content: ""; + } + @top-left { + content: string(chapter); + } + @top-center { + content: ""; + } + @top-right { + content: string(section); + } + @top-right-corner { + content: ""; + } + + @bottom-left-corner { + content: ""; + } + @bottom-left { + content: string(front-cover-title); + } + @bottom-center { + content: ""; + } + @bottom-right { + content: counter(page); + } + @bottom-right-corner { + content: ""; + } +} diff --git a/themes/hugo-darktable-docs-pdf-theme/assets/sass/modules/bookmarks.scss b/themes/hugo-darktable-docs-pdf-theme/assets/sass/modules/bookmarks.scss new file mode 100644 index 0000000000..1fa501ff59 --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/assets/sass/modules/bookmarks.scss @@ -0,0 +1,42 @@ +.section { + .title { + bookmark-level: 1; + } + .content { + h1, + h2, + h3 { + bookmark-level: none; + } + } +} + +.section > .section { + .title { + bookmark-level: 2; + } +} + +.section > .section > .section { + .title { + bookmark-level: 3; + } +} + +.section > .section > .section > .section { + .title { + bookmark-level: 4; + } +} + +.section > .section > .section > .section > .section { + .title { + bookmark-level: 5; + } +} + +.section > .section > .section > .section > .section > .section { + .title { + bookmark-level: 6; + } +} diff --git a/themes/hugo-darktable-docs-pdf-theme/assets/sass/modules/cover-back.scss b/themes/hugo-darktable-docs-pdf-theme/assets/sass/modules/cover-back.scss new file mode 100644 index 0000000000..166c50a0c4 --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/assets/sass/modules/cover-back.scss @@ -0,0 +1,40 @@ +#cover-back { + page: cover-back; + break-before: always; + text-align: center; + margin-top: 95%; +} + +@page cover-front { + @top-left-corner { + content: none; + } + @top-left { + content: none; + } + @top-center { + content: none; + } + @top-right { + content: none; + } + @top-right-corner { + content: none; + } + + @bottom-left-corner { + content: none; + } + @bottom-left { + content: none; + } + @bottom-center { + content: none; + } + @bottom-right { + content: none; + } + @bottom-right-corner { + content: none; + } +} diff --git a/themes/hugo-darktable-docs-pdf-theme/assets/sass/modules/cover-front.scss b/themes/hugo-darktable-docs-pdf-theme/assets/sass/modules/cover-front.scss new file mode 100644 index 0000000000..202ef61426 --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/assets/sass/modules/cover-front.scss @@ -0,0 +1,55 @@ +#cover-front { + page: cover-front; + break-after: always; + padding-top: 35%; + height: 11in; + width: 8.5in; + .title { + text-align: center; + font-size: 48px; + line-height: 52px; + } + .title::before { + content: url(darktable-logo.svg); + display: block; + transform: scale(0.5); + margin: 0px auto; + margin-bottom: -10rem; + } +} + +@page cover-front { + margin: 0; + padding: 0; + @top-left-corner { + content: none; + } + @top-left { + content: none; + } + @top-center { + content: none; + } + @top-right { + content: none; + } + @top-right-corner { + content: none; + } + + @bottom-left-corner { + content: none; + } + @bottom-left { + content: none; + } + @bottom-center { + content: none; + } + @bottom-right { + content: none; + } + @bottom-right-corner { + content: none; + } +} diff --git a/themes/hugo-darktable-docs-pdf-theme/assets/sass/modules/fonts.scss b/themes/hugo-darktable-docs-pdf-theme/assets/sass/modules/fonts.scss new file mode 100644 index 0000000000..b1272d9c44 --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/assets/sass/modules/fonts.scss @@ -0,0 +1,7 @@ +* { + font-family: sans-serif; +} + +pre, code { + font-family: monospace; +} diff --git a/themes/hugo-darktable-docs-pdf-theme/assets/sass/modules/images.scss b/themes/hugo-darktable-docs-pdf-theme/assets/sass/modules/images.scss new file mode 100644 index 0000000000..ee110db79b --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/assets/sass/modules/images.scss @@ -0,0 +1,39 @@ +img { + display: block; + max-width: 100%; +} + +.icon { + width: 25px !important; + display: inline; + vertical-align: middle; +} + +.inline { + display: inline; + vertical-align: middle; +} + +.w25 { + width: 24%; +} + +.w33 { + width: 33%; +} + +.w50 { + width: 48%; +} + +.w66 { + width: 66%; +} + +.w75 { + width: 72%; +} + +.w100 { + width: 100%; +} diff --git a/themes/hugo-darktable-docs-pdf-theme/assets/sass/modules/numbering.scss b/themes/hugo-darktable-docs-pdf-theme/assets/sass/modules/numbering.scss new file mode 100644 index 0000000000..fd48aede3f --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/assets/sass/modules/numbering.scss @@ -0,0 +1,45 @@ +// The counters for the sections and ToC are presented together to keep the numbering consistent. + +// Section 1 +#body > .section, +#toc-body > ul > li { + counter-increment: section-1; +} + +#body > .section > .title:before, +#toc-body > ul > li > a:before { + content: counter(section-1) ". "; +} + +// Section 2 +#body > .section > .section, +#toc-body > ul > li > ul > li { + counter-increment: section-2; +} + +#body > .section > .section > .title:before, +#toc-body > ul > li > ul > li > a:before { + content: counter(section-1) "." counter(section-2) ". "; +} + +// Section 3 +#body > .section > .section > .section, +#toc-body > ul > li > ul > li > ul > li { + counter-increment: section-3; +} + +#body > .section > .section > .section > .title:before, +#toc-body > ul > li > ul > li > ul > li > a:before { + content: counter(section-1) "." counter(section-2) "." counter(section-3) ". "; +} + +// Section 4 +#body > .section > .section > .section > .section, +#toc-body > ul > li > ul > li > ul > li > ul > li { + counter-increment: section-4; +} + +#body > .section > .section > .section > .section > .title:before, +#toc-body > ul > li > ul > li > ul > li > ul > li > a:before { + content: counter(section-1) "." counter(section-2) "." counter(section-3) "." counter(section-4) ". "; +} diff --git a/themes/hugo-darktable-docs-pdf-theme/assets/sass/modules/page.scss b/themes/hugo-darktable-docs-pdf-theme/assets/sass/modules/page.scss new file mode 100644 index 0000000000..b7dc04cb93 --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/assets/sass/modules/page.scss @@ -0,0 +1,9 @@ +// Basic page definition + +@page { + size: letter portrait; + margin-top: 0.5in; + margin-bottom: 0.5in; + margin-right: 0.25in; + margin-left: 0.25in; +} diff --git a/themes/hugo-darktable-docs-pdf-theme/assets/sass/modules/toc.scss b/themes/hugo-darktable-docs-pdf-theme/assets/sass/modules/toc.scss new file mode 100644 index 0000000000..b175c23783 --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/assets/sass/modules/toc.scss @@ -0,0 +1,24 @@ +#toc { + break-after: always; + .title { + font-size: 2.323em; + } + #toc-body { + columns: 2; + ul { + list-style-type: none; + padding-left: 15px !important; + li { + padding-top: 1px; + padding-bottom: 2px; + a { + color: black; + text-decoration: none; + } + a:after { + content: " " target-counter(attr(href), page); + } + } + } + } +} diff --git a/themes/hugo-darktable-docs-pdf-theme/assets/sass/modules/typography.scss b/themes/hugo-darktable-docs-pdf-theme/assets/sass/modules/typography.scss new file mode 100644 index 0000000000..ab17fd32ba --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/assets/sass/modules/typography.scss @@ -0,0 +1,139 @@ +* { + widows: 5; + orphans: 5; + font-size: 12px; + line-height: 1.2em; +} + +#body { + + // The heading sizes for nested sections + + // Nesting level 1 + .section { + break-after: always; + .title { + font-size: 2.323em; + } + .content{ + h1, + h2, + h3, + h4, + h5, + h6 { + color: red; + } + } + } // End section 1 + + // Nesting level 2 + .section > .section { + break-after: auto; + .title { + font-size: 2.178em; + font-weight: normal; + break-after: avoid; + } + .content{ + h1, h2, h3 { + color: black; + font-weight: normal; + } + h1 { + font-size: 2.041em; + } + h2 { + font-size: 1.913em; + } + h3 { + font-size: 1.793em; + } + } + } // End Nesting level 2 + + // Nesting level 3 + .section > .section > .section { + break-after: auto; + .title { + font-size: 1.68em; + font-weight: normal; + break-after: avoid; + } + .content{ + h1, h2, h3 { + color: black; + font-weight: normal; + } + h1 { + font-size: 1.575em; + } + h2 { + font-size: 1.476em; + } + h3 { + font-size: 1.383em; + } + } + } // End section 3 + + + // Nesting level 4 + .section > .section > .section > .section { + break-after: auto; + .title { + font-size: 1.2961em; + font-weight: normal; + break-after: avoid; + + } + .content{ + h1, h2, h3 { + color: black; + font-weight: normal; + } + h1 { + font-size: 1.215em; + } + h2 { + font-size: 1.138em; + } + h3 { + font-size: 1.067em; + } + } + } // End section 4 + + + dt { + font-weight: bold; + break-after: avoid; + margin-top: 2px; + margin-bottom: 3px; + } + + dd { + margin-left: 10px; + margin-top: 2px; + margin-bottom: 3px; + } + + img { + max-width: 100%; + max-height: 100%; + } + + p, li { + break-before: avoid; + } + + h1, h2, h3, h4, h5, h6 { + break-after: avoid; + } + +} // End #body + +.webonly +{ + display: none; +} diff --git a/themes/hugo-darktable-docs-pdf-theme/i18n/en.yaml b/themes/hugo-darktable-docs-pdf-theme/i18n/en.yaml new file mode 100644 index 0000000000..435bd3b903 --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/i18n/en.yaml @@ -0,0 +1,8 @@ +- id: toc + translation: "Table of Contents" + +- id: copyright + translation: "Copyright" + +- id: copyrightEntity + translation: "Someone or something" diff --git a/themes/hugo-darktable-docs-pdf-theme/i18n/pt_br.yaml b/themes/hugo-darktable-docs-pdf-theme/i18n/pt_br.yaml new file mode 100644 index 0000000000..d66fc0fb88 --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/i18n/pt_br.yaml @@ -0,0 +1,8 @@ +- id: toc + translation: "Índice" + +- id: copyright + translation: "Copyright" + +- id: copyrightEntity + translation: "Alguém ou alguma coisa" diff --git a/themes/hugo-darktable-docs-pdf-theme/layouts/_default/_markup/render-heading.html b/themes/hugo-darktable-docs-pdf-theme/layouts/_default/_markup/render-heading.html new file mode 100644 index 0000000000..02af2f905f --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/layouts/_default/_markup/render-heading.html @@ -0,0 +1 @@ +{{ .Text | safeHTML }} diff --git a/themes/hugo-darktable-docs-pdf-theme/layouts/_default/_markup/render-image.html b/themes/hugo-darktable-docs-pdf-theme/layouts/_default/_markup/render-image.html new file mode 100644 index 0000000000..4c3f02ce83 --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/layouts/_default/_markup/render-image.html @@ -0,0 +1,17 @@ +{{ $link := string .Destination }} +{{ $imgBase := path.Base .Destination }} +{{ $Scratch := newScratch }} +{{ $Scratch.Set "enLink" .Page.RelPermalink }} + +{{ $classSplit := split $imgBase "#" }} + +{{ if hasPrefix $link "http" }} + {{ .Text }} +{{ else }} + {{ range .Page.Translations }} + {{ if eq .Language.LanguageName "English" }} + {{ $Scratch.Set "enLink" .RelPermalink }} + {{ end }} + {{ end }} + {{ .Text }} +{{ end }} diff --git a/themes/hugo-darktable-docs-pdf-theme/layouts/_default/_markup/render-link.html b/themes/hugo-darktable-docs-pdf-theme/layouts/_default/_markup/render-link.html new file mode 100644 index 0000000000..c20c7ef38e --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/layouts/_default/_markup/render-link.html @@ -0,0 +1,17 @@ +{{ $link := strings.Replace .Destination "_index.md" "" }} +{{ $isRemote := strings.HasPrefix $link "http" }} +{{ $isAnchored := strings.HasPrefix $link "#" }} +{{- if not $isRemote -}} +{{ $url := urls.Parse $link }} +{{- if $url.Path -}} +{{ $fragment := "" }} +{{- with $url.Fragment }}{{ $fragment = printf "#%s" . }}{{ end -}} +{{- with .Page.GetPage $url.Path }}{{ $link = printf "%s%s" .Page.File.UniqueID $fragment }}{{ end }}{{ end -}} +{{- end -}} +{{ if $isRemote }} + {{ .Text | safeHTML }} +{{ else if $isAnchored }} + {{ .Text | safeHTML }} +{{ else }} +{{ .Text | safeHTML }} +{{ end }} diff --git a/themes/hugo-darktable-docs-pdf-theme/layouts/_default/baseof.html b/themes/hugo-darktable-docs-pdf-theme/layouts/_default/baseof.html new file mode 100644 index 0000000000..eb31991d7b --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/layouts/_default/baseof.html @@ -0,0 +1,19 @@ + + + + {{ partial "head-meta.html" . }} + {{ partial "css.html" . }} + + + {{ partial "cover-front.html" . }} + + {{ partial "toc.html" . }} + + {{ block "main" .}} + + {{ end }} + + {{ partial "cover-back.html" . }} + + + diff --git a/themes/hugo-darktable-docs-pdf-theme/layouts/_default/list.html b/themes/hugo-darktable-docs-pdf-theme/layouts/_default/list.html new file mode 100644 index 0000000000..35c8157c31 --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/layouts/_default/list.html @@ -0,0 +1,23 @@ +{{ define "main" }} + +
    +

    {{ .Title }}

    + +
    + +{{ end }} diff --git a/themes/hugo-darktable-docs-pdf-theme/layouts/_default/single.html b/themes/hugo-darktable-docs-pdf-theme/layouts/_default/single.html new file mode 100644 index 0000000000..6a981534e2 --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/layouts/_default/single.html @@ -0,0 +1,25 @@ +{{ define "title" }}{{ .Title | markdownify }} | {{ .Site.Title }}{{ end }} +{{ define "main" }} +{{ $dateFormat := default "Mon Jan 2, 2006" (index .Site.Params "date_format") }} + + + + +{{ end }} diff --git a/themes/hugo-darktable-docs-pdf-theme/layouts/index.html b/themes/hugo-darktable-docs-pdf-theme/layouts/index.html new file mode 100644 index 0000000000..f557eab79b --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/layouts/index.html @@ -0,0 +1,15 @@ +{{ define "title" }}{{ .Title | markdownify }} | {{ .Site.Title }}{{ end }} +{{ define "main" }} +{{ $dateFormat := default "Mon Jan 2, 2006" (index .Site.Params "date_format") }} + + + + +{{ .Content }} + +{{ partial "content_gen.html" . }} + + + + +{{ end }} diff --git a/themes/hugo-darktable-docs-pdf-theme/layouts/partials/content_gen.html b/themes/hugo-darktable-docs-pdf-theme/layouts/partials/content_gen.html new file mode 100644 index 0000000000..314fb6d0d8 --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/layouts/partials/content_gen.html @@ -0,0 +1,20 @@ +
    + {{ with .Site.GetPage "/" }} + {{ range .Sections.ByWeight }} + {{/* We don't want a menu item for specific pages listed here */}} + {{ if (and (ne .Title "Posts") (ne .Title "Test Page")) }} +
    +

    + {{ .Title }} +

    + {{ if gt (countwords .Content) 1 }} +
    + {{- .Content -}} +
    + {{ end }} + {{ partial "content_recursive.html" . }} +
    + {{ end }} + {{ end }} + {{ end }} +
    diff --git a/themes/hugo-darktable-docs-pdf-theme/layouts/partials/content_recursive.html b/themes/hugo-darktable-docs-pdf-theme/layouts/partials/content_recursive.html new file mode 100644 index 0000000000..828bacb6c5 --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/layouts/partials/content_recursive.html @@ -0,0 +1,14 @@ +{{ $child_pages := union .Sections .Pages }} +{{ range $child_pages.ByWeight }} +
    +

    + {{ .Title }} +

    + {{ if gt (countwords .Content) 1 }} +
    + {{- .Content -}} +
    + {{ end }} + {{ partial "content_recursive.html" . }} +
    +{{ end }} diff --git a/themes/hugo-darktable-docs-pdf-theme/layouts/partials/cover-back.html b/themes/hugo-darktable-docs-pdf-theme/layouts/partials/cover-back.html new file mode 100644 index 0000000000..3924ebb71f --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/layouts/partials/cover-back.html @@ -0,0 +1,8 @@ +
    +
    + {{ .Site.Title }} +
    +
    + {{ now.Format "January 2, 2006" }} +
    +
    diff --git a/themes/hugo-darktable-docs-pdf-theme/layouts/partials/cover-front.html b/themes/hugo-darktable-docs-pdf-theme/layouts/partials/cover-front.html new file mode 100644 index 0000000000..d2bf43ea5b --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/layouts/partials/cover-front.html @@ -0,0 +1,5 @@ +
    +
    + {{ .Site.Title }} +
    +
    diff --git a/themes/hugo-darktable-docs-pdf-theme/layouts/partials/css.html b/themes/hugo-darktable-docs-pdf-theme/layouts/partials/css.html new file mode 100644 index 0000000000..961c878925 --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/layouts/partials/css.html @@ -0,0 +1,5 @@ + + +{{ $options := (dict "targetPath" "style.css" "enableSourceMap" true) }} +{{ $style := resources.Get "sass/main.scss" | resources.ToCSS $options | minify | fingerprint }} + diff --git a/themes/hugo-darktable-docs-pdf-theme/layouts/partials/head-meta.html b/themes/hugo-darktable-docs-pdf-theme/layouts/partials/head-meta.html new file mode 100644 index 0000000000..eeb88a15d9 --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/layouts/partials/head-meta.html @@ -0,0 +1,3 @@ + +{{ block "title" . }}{{ .Site.Title }}{{ if .Title }} - {{ .Title }}{{ end }}{{ end }} + diff --git a/themes/hugo-darktable-docs-pdf-theme/layouts/partials/toc.html b/themes/hugo-darktable-docs-pdf-theme/layouts/partials/toc.html new file mode 100644 index 0000000000..a8bc084738 --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/layouts/partials/toc.html @@ -0,0 +1,8 @@ +
    +

    + {{ i18n "toc" }} +

    +
    + {{ partial "toc_gen.html" . }} +
    +
    diff --git a/themes/hugo-darktable-docs-pdf-theme/layouts/partials/toc_gen.html b/themes/hugo-darktable-docs-pdf-theme/layouts/partials/toc_gen.html new file mode 100644 index 0000000000..5861990b55 --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/layouts/partials/toc_gen.html @@ -0,0 +1,17 @@ +
      + {{ with .Site.GetPage "/" }} + {{ range .Sections.ByWeight }} + {{/* We don't want a menu item for specific pages listed here */}} + {{ if (and (ne .Title "Posts") (ne .Title "Test Page")) }} +
    • + + {{ .Title }} + + + {{ partial "toc_recursive.html" . }} +
    • + {{ end }} + {{ end }} + {{ end }} +
    diff --git a/themes/hugo-darktable-docs-pdf-theme/layouts/partials/toc_recursive.html b/themes/hugo-darktable-docs-pdf-theme/layouts/partials/toc_recursive.html new file mode 100644 index 0000000000..6092358b9d --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/layouts/partials/toc_recursive.html @@ -0,0 +1,11 @@ + {{ $child_pages := union .Sections .Pages }} +
      + {{ range $child_pages.ByWeight }} +
    • + + {{ .Title }} + + {{ partial "toc_recursive.html" . }} +
    • + {{ end }} +
    diff --git a/themes/hugo-darktable-docs-pdf-theme/theme.toml b/themes/hugo-darktable-docs-pdf-theme/theme.toml new file mode 100644 index 0000000000..3dfbada0d6 --- /dev/null +++ b/themes/hugo-darktable-docs-pdf-theme/theme.toml @@ -0,0 +1,15 @@ +# theme.toml template for a Hugo theme +# See https://github.com/gohugoio/hugoThemes#themetoml for an example + +name = "Hugo Darktable Docs Pdf Theme" +license = "MIT" +licenselink = "https://gitlab.com/pixlsus/hugo-darktable-docs-pdf-theme/blob/master/LICENSE" +description = "" +homepage = "https://gitlab.com/pixlsus/hugo-darktable-docs-pdf-theme" +tags = [] +features = [] +min_version = "0.41.0" + +[author] + name = "Mica Semrick" + homepage = "https://silentumbrella.com" diff --git a/themes/hugo-darktable-docs-theme b/themes/hugo-darktable-docs-theme deleted file mode 160000 index 4677c7d8b2..0000000000 --- a/themes/hugo-darktable-docs-theme +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4677c7d8b25cd0a164d596401a049b03d635f7e5 diff --git a/themes/hugo-darktable-docs-theme/.gitignore b/themes/hugo-darktable-docs-theme/.gitignore new file mode 100644 index 0000000000..c2022ca816 --- /dev/null +++ b/themes/hugo-darktable-docs-theme/.gitignore @@ -0,0 +1,2 @@ +.directory +*/node_modules/* \ No newline at end of file diff --git a/themes/hugo-darktable-docs-theme/LICENSE b/themes/hugo-darktable-docs-theme/LICENSE new file mode 100644 index 0000000000..faff36ecad --- /dev/null +++ b/themes/hugo-darktable-docs-theme/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2020 YOUR_NAME_HERE + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/themes/hugo-darktable-docs-theme/README.md b/themes/hugo-darktable-docs-theme/README.md new file mode 100644 index 0000000000..ba78c599d1 --- /dev/null +++ b/themes/hugo-darktable-docs-theme/README.md @@ -0,0 +1,28 @@ +# hugo-darktable-docs-theme + +A bootstrap v4 theme for darktable's documentation. + +This theme was designed to run using only `hugo` and `yarn`. Javascript and SCSS are compiled using hugo's pipeline feature. + +## Fetching assests + +To fetch the assests: + +``` +cd assets +yarn install +``` + +## Site Search + +`lunr.js` in the bundle to provide search functionality. In the `/content` folder you need to add a search page: + +``` +--- +title: 'Search' +layout: 'search' +menu: 'main' +--- +``` + +The important bit is `layout: 'search'`, which calls the search template. diff --git a/themes/hugo-darktable-docs-theme/archetypes/default.md b/themes/hugo-darktable-docs-theme/archetypes/default.md new file mode 100644 index 0000000000..ac36e06227 --- /dev/null +++ b/themes/hugo-darktable-docs-theme/archetypes/default.md @@ -0,0 +1,2 @@ ++++ ++++ diff --git a/themes/hugo-darktable-docs-theme/assets/js/app.js b/themes/hugo-darktable-docs-theme/assets/js/app.js new file mode 100644 index 0000000000..0e2d2304c3 --- /dev/null +++ b/themes/hugo-darktable-docs-theme/assets/js/app.js @@ -0,0 +1,204 @@ +var lunrIndex; +var pagesIndex; +var pagesMap = {}; +var SEARCH_RESULT_LIMIT = 20; +var SEARCH_RESULT_EXCERPT_LENGTH = 160; + +function sanitizeRegex(src) { + return src.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); +} + +// Initialize lunrjs using our generated index file +function initLunr() { + var request = new XMLHttpRequest(); + request.open('GET', indexURL, true); + + request.onload = function () { + if (request.status >= 200 && request.status < 400) { + pagesIndex = JSON.parse(request.responseText); + console.log('index:', pagesIndex); + + pagesIndex.forEach(function (page) { + pagesMap[page.href] = page; + }); + + // Set up lunrjs by declaring the fields we use + // Also provide their boost level for the ranking + lunrIndex = lunr(function () { + this.pipeline.remove(lunr.stemmer); + this.searchPipeline.remove(lunr.stemmer); + + this.field('title', { boost: 5 }); + this.field('content', { boost: 2 }); + this.field('tags', { boost: 1 }); + + // ref is the result item identifier (I chose the page URL) + this.ref('href'); + this.add({ field: 'test', text: 'hello' }); + for (var i = 0; i < pagesIndex.length; ++i) { + this.add(pagesIndex[i]); + } + }); + } else { + var err = textStatus + ', ' + error; + console.error('Error getting Hugo index flie:', err); + } + }; + + request.send(); +} + +function search(queryString, limit) { + var queryTerms = lunr.tokenizer(queryString); + var searchResults = lunrIndex.query(function (query) { + queryTerms.forEach(function (queryTerm) { + // look for an exact match and apply a large positive boost + query.term(queryTerm, { + usePipeline: true, + boost: 100, + }); + + // look for terms that start or end with queryTerm and apply a medium boost + query.term(queryTerm, { + usePipeline: false, + boost: 5, + wildcard: + lunr.Query.wildcard.LEADING | lunr.Query.wildcard.TRAILING, + }); + + // look for terms that match with an edit distance of 1 and apply a small boost + query.term(queryTerm, { + usePipeline: false, + editDistance: 1, + boost: 1, + }); + }); + }); + + // Sort results by relevance + searchResults.sort((a, b) => b.score - a.score); + + searchResults = searchResults.slice(0, limit); + + return searchResults; +} + +function highlightKeyword(sourceText, keyword, tag) { + if (!tag) tag = 'mark'; + + return sourceText.replace(new RegExp(keyword, 'ig'), function (match) { + return '<' + tag + '>' + match + ''; + }); +} + +function getTextExcerpt(text, keyword, length) { + if (!length) length = 80; + + var index = text.search(new RegExp(keyword, 'ig')); + var excerpt = text; + + if (index === -1) excerpt = text.substring(0, length) + '...'; + + var halfLength = Math.round(length / 2); + var excerpt = text.substring( + Math.max(0, index - halfLength), + Math.min(text.length, index + halfLength) + ); + + if (index - halfLength > 0) excerpt = '...' + excerpt; + if (index + halfLength < text.length) excerpt = excerpt + '...'; + + return excerpt; +} + +function renderResults(results) { + var searchResults = document.getElementById('search-results'); + var $searchResults = $(searchResults); + + if (!results.length) { + $searchResults.hide(); + return; + } + + var resultsFragment = document.createDocumentFragment(); + // Only show the first twenty results + results.forEach(function (result) { + var page = pagesMap[result.ref]; + var matchedTerms = Object.keys(result.matchData.metadata) + .map(sanitizeRegex) + .join('|'); + var link = document.createElement('a'); + var title = document.createElement('b'); + var content = document.createElement('small'); + + link.className = 'search-results__item'; + title.className = 'search-results__title'; + content.className = 'search-results__content'; + + link.href = page.href; + title.innerHTML = highlightKeyword(page.title, matchedTerms); + content.innerHTML = highlightKeyword( + getTextExcerpt( + page.content, + matchedTerms, + SEARCH_RESULT_EXCERPT_LENGTH + ), + matchedTerms + ); + + link.appendChild(title); + link.appendChild(content); + + resultsFragment.appendChild(link); + }); + searchResults.appendChild(resultsFragment); + + var header = document.querySelector('header.navbar'); + $searchResults.css('top', header.clientHeight); + $searchResults.css('height', window.innerHeight - header.clientHeight); + $searchResults.show(); +} + +function handleSearchInput() { + var $searchInput = $('#search-input'); + var $searchResults = $('#search-results'); + var query = $searchInput.val(); + + //trigger a search if a search term longer than two characters has been entered + $searchResults.empty().hide(); + + if (query.length < 2) { + return; + } + + renderResults(search(query, SEARCH_RESULT_LIMIT)); +} + +$(document).ready(function () { + var $searchInput = $('#search-input'); + var $searchResults = $('#search-results'); + + $searchResults.hide(); + $searchInput.focus(function () { + //load index file if it's not already been loaded + if (!lunrIndex) { + initLunr(); + } + }); + + $searchInput.keydown(function (e) { + if (e.keyCode === 27) { + $searchResults.hide(); + $searchInput.val(''); + } + + if (e.keyCode === 13) { + //enter key pressed - go to first search result if it exists + e.preventDefault(); + + $('#search-results a').first().get(0).click(); + } + }); + + $searchInput.on('input', handleSearchInput); +}); diff --git a/themes/hugo-darktable-docs-theme/assets/package.json b/themes/hugo-darktable-docs-theme/assets/package.json new file mode 100644 index 0000000000..688b31a1bf --- /dev/null +++ b/themes/hugo-darktable-docs-theme/assets/package.json @@ -0,0 +1,20 @@ +{ + "name": "hugo-bootstrap-bare", + "version": "1.0.0", + "description": "A minimal bootstrap theme for hugo.", + "repository": { + "type": "git", + "url": "https://gitlab.com/patdavid/hugo-bootstrap-bare" + }, + "keywords": "hugo bootstrap", + "author": "PIXLS.US community", + "license": "MIT", + "private": true, + "dependencies": { + "bootstrap": "^4.3.1", + "fork-awesome": "^1.1.7", + "jquery": "^3.4.1", + "lunr": "^2.3.9", + "popper.js": "^1.15.0" + } +} diff --git a/themes/hugo-darktable-docs-theme/assets/sass/main.scss b/themes/hugo-darktable-docs-theme/assets/sass/main.scss new file mode 100644 index 0000000000..cd146000db --- /dev/null +++ b/themes/hugo-darktable-docs-theme/assets/sass/main.scss @@ -0,0 +1,17 @@ +/* Override any bootstrap variables here before importing bootstrap itself */ + +@import 'modules/variables'; + +/* Import bootstrap's sass */ +@import 'bootstrap'; + +/* Import fork-awesome */ +@import 'fork-awesome'; + +/* Custom SASS imports */ + +@import 'modules/typography'; +@import 'modules/nav'; +@import 'modules/body'; +@import 'modules/images'; +@import 'modules/print'; diff --git a/themes/hugo-darktable-docs-theme/assets/sass/modules/body.scss b/themes/hugo-darktable-docs-theme/assets/sass/modules/body.scss new file mode 100644 index 0000000000..4016778695 --- /dev/null +++ b/themes/hugo-darktable-docs-theme/assets/sass/modules/body.scss @@ -0,0 +1,100 @@ +body, .card { + background-color: #CECECE; +} + +.content { + padding-left: 13%; + padding-right: 13%; + padding-top: 1rem; + a { + text-decoration: underline; + background-color: transparent; + } +} + +@include media-breakpoint-up(md) { + .content { + top: 4rem; + display: block; + position: sticky; + max-height: calc(100vh - 4em); + overflow-y: auto; + z-index: 1000; + } +} + +.next, .prev { + display: block; +} + +.next { + text-align: left; +} + +.prev { + text-align: right; +} + +.crumbs { + margin-bottom: 0.5rem; + text-align: center; + .crumb { + display: inline; + } +} + +a { + color: #444; +} + +section,article { + margin-top: 2.5rem; + margin-bottom: 2.5rem; +} + +.search-results { + position: absolute; + right: 0; + bottom: 0; + min-width: 20%; + background-color: white; + z-index: 1001; + display: none; + max-width: 100%; + width: 450px; + overflow-y: scroll; + + @extend .list-group; + @extend .shadow; + + &__item { + @extend .list-group-item; + @extend .list-group-item-action; + + position: relative; + display: block; + cursor: pointer; + line-height: 1.4rem; + + &:hover { + text-decoration: none + } + } + + &__title { + display: block; + @extend .mb-1; + } + + &__content { + @extend .mb-1; + + padding: 0; + margin: 0; + } + + mark { + padding: 0; + border-bottom: 2px solid red; + } +} diff --git a/themes/hugo-darktable-docs-theme/assets/sass/modules/images.scss b/themes/hugo-darktable-docs-theme/assets/sass/modules/images.scss new file mode 100644 index 0000000000..a712ea488a --- /dev/null +++ b/themes/hugo-darktable-docs-theme/assets/sass/modules/images.scss @@ -0,0 +1,37 @@ +img { + display: block; + max-width: 100%; +} + +.icon { + width: 30px !important; + display: inline; +} + +.inline { + display: inline; +} + +.w25 { + width: 24%; +} + +.w33 { + width: 33%; +} + +.w50 { + width: 48%; +} + +.w66 { + width: 66%; +} + +.w75 { + width: 72%; +} + +.w100 { + width: 100%; +} diff --git a/themes/hugo-darktable-docs-theme/assets/sass/modules/nav.scss b/themes/hugo-darktable-docs-theme/assets/sass/modules/nav.scss new file mode 100644 index 0000000000..355899a1f7 --- /dev/null +++ b/themes/hugo-darktable-docs-theme/assets/sass/modules/nav.scss @@ -0,0 +1,36 @@ +.translation-icon { + display: inline !important; +} + +.navigation { + padding-top: 1rem; + + ul { + padding-left: 0px; + list-style-type: none; + ul { + padding-left: 20px; + + } + } + +} + +.toggle, .no-toggle { + width: 1rem; +} + +@include media-breakpoint-up(md) { + .navigation { + top: 4rem; + display: block; + position: sticky; + max-height: calc(100vh - 4em); + overflow-y: auto; + z-index: 1000; + } +} + +.active { + font-weight: bold; +} diff --git a/themes/hugo-darktable-docs-theme/assets/sass/modules/print.scss b/themes/hugo-darktable-docs-theme/assets/sass/modules/print.scss new file mode 100644 index 0000000000..adbc5b5b80 --- /dev/null +++ b/themes/hugo-darktable-docs-theme/assets/sass/modules/print.scss @@ -0,0 +1,67 @@ +@media print { + + @page { margin: 0.25in } + + body { + background-color: #fff; + color: #000; + } + + .content { + width: 100%; + max-width: 100%; + flex: 0 0 100%; + margin-left: 0px; + margin-right: 0px; + } + + .navigation, .crumbs, .prev-next { + display: none; + } + + pre, code { + padding: 10px; + border-radius: 10px; + } + + a { + page-break-inside:avoid + } + blockquote { + page-break-inside: avoid; + } + h1, h2, h3, h4, h5, h6 { + page-break-after:avoid; + page-break-inside:avoid + } + img { + page-break-inside:avoid; + page-break-after:avoid; + } + table, pre { + page-break-inside:avoid; + } + ul, ol, dl { + page-break-before:avoid; + } + + a { + page-break-inside:avoid; + } + + a[href^=http]:after { + content:" <" attr(href) "> "; + } + + a:after > img { + content: ""; + } + + a[href^="#"]:after { + content: ""; + } + + a:not(:local-link):after { + content:" <" attr(href) "> "; + } +} diff --git a/themes/hugo-darktable-docs-theme/assets/sass/modules/typography.scss b/themes/hugo-darktable-docs-theme/assets/sass/modules/typography.scss new file mode 100644 index 0000000000..030638dc76 --- /dev/null +++ b/themes/hugo-darktable-docs-theme/assets/sass/modules/typography.scss @@ -0,0 +1,148 @@ +// Major Second typographical rhythm from https://type-scale.com/ + +html { + font-size: 100%; /*16px*/ +} + +body { + background-color: white; + font-family: 'Fira Sans', sans-serif; + font-weight: 400; + line-height: 1.65; + color: #333; +} + +pre, code, kbd { + font-family: 'Fira Mono', monospace; + font-size: 0.9em; + color: navy; +} + +p { + margin-bottom: 1rem; + margin-top: 1rem; +} + +h1, h2, h3, h4, h5 { + margin: 2.0rem 0 1.0rem; + font-family: 'Fira Sans', sans-serif; + font-weight: 400; + line-height: 1.15; + text-indent: -2.5rem; +} + +h1.title { + margin-top: 0; + margin-left: 2.5rem; + margin-bottom: 2rem; + font-size: 2.8em; +} + +h1 { + font-size: 2.2em; +} + +h1+h2 { + margin-top: 0; +} + +h2 { + font-size: 1.66em; +} + +h2+h3 { + margin-top: 0; +} + +h3 { + + font-size: 1.333em; +} + +h4, +h5, +h6 { + color: $red; + :before { + content: "We only allow H1, H2, or H3 headings in body content." + } +} + +small, .text_small { + font-size: 0.889em; +} + +dd, pre { + margin-left: 20px; +} + +dt { + margin-top: 1rem; +} + +ul { + margin-top: 0; + margin-bottom: 0; +} + +article ul li, +article ul li p, +dd p { + margin-top: 0.7rem; + margin-bottom: 0.7rem; +} + +h1 a:link, +h2 a:link, +h3 a:link { + opacity: 0; + font-size: 1.33rem; + color: dimgrey; + text-decoration: none; + width: 2.5rem; + display: inline-block; + vertical-align: middle; + text-indent: 0; +} + +h1:hover a, +h2:hover a, +h3:hover a +{ + opacity: 1; +} + +.toc ul +{ + list-style: none; + padding-left: 0; + margin-left: 0; +} + +.toc li +{ + margin-top: 0; + margin-bottom: 0; + padding-left: 2em; + margin-left: 0; +} + +h3.translations_head +{ + border-top: 1px solid black; + padding-top: 1em; + margin-top: 2em; + margin-left: 2.5rem; +} + +.translations li +{ + line-height: 1.1rem; + font-style: italic; +} + +.translations +{ + margin: 0; + padding-left: 1.5rem; +} diff --git a/themes/hugo-darktable-docs-theme/assets/sass/modules/variables.scss b/themes/hugo-darktable-docs-theme/assets/sass/modules/variables.scss new file mode 100644 index 0000000000..d390be5ad0 --- /dev/null +++ b/themes/hugo-darktable-docs-theme/assets/sass/modules/variables.scss @@ -0,0 +1,18 @@ +// Variables are taken from bootstrap's _variables.scss file + +// Color system + +$white: #fff !default; +$gray-100: #f8f9fa !default; +$gray-200: #e9ecef !default; +$gray-300: #dee2e6 !default; +$gray-400: #ced4da !default; +$gray-500: #adb5bd !default; +$gray-600: #6c757d !default; +$gray-700: #495057 !default; +$gray-800: #343a40 !default; +$gray-900: #212529 !default; +$black: #000 !default; + + +$code-color: $black; diff --git a/themes/hugo-darktable-docs-theme/assets/yarn.lock b/themes/hugo-darktable-docs-theme/assets/yarn.lock new file mode 100644 index 0000000000..b1958a2f9f --- /dev/null +++ b/themes/hugo-darktable-docs-theme/assets/yarn.lock @@ -0,0 +1,28 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +bootstrap@^4.3.1: + version "4.5.3" + resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.5.3.tgz#c6a72b355aaf323920be800246a6e4ef30997fe6" + integrity sha512-o9ppKQioXGqhw8Z7mah6KdTYpNQY//tipnkxppWhPbiSWdD+1raYsnhwEZjkTHYbGee4cVQ0Rx65EhOY/HNLcQ== + +fork-awesome@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/fork-awesome/-/fork-awesome-1.1.7.tgz#1427da1cac3d1713046ee88427e5fcecb9501d21" + integrity sha512-IHI7XCSXrKfUIWslse8c/PaaVDT1oBaYge+ju40ihL2ooiQeBpTr4wvIXhgTd2NuhntlvX+M5jYHAPTzNlmv0g== + +jquery@^3.4.1: + version "3.5.1" + resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.5.1.tgz#d7b4d08e1bfdb86ad2f1a3d039ea17304717abb5" + integrity sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg== + +lunr@^2.3.9: + version "2.3.9" + resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.3.9.tgz#18b123142832337dd6e964df1a5a7707b25d35e1" + integrity sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow== + +popper.js@^1.15.0: + version "1.16.1" + resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.16.1.tgz#2a223cb3dc7b6213d740e40372be40de43e65b1b" + integrity sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ== diff --git a/themes/hugo-darktable-docs-theme/i18n/en-us.yaml b/themes/hugo-darktable-docs-theme/i18n/en-us.yaml new file mode 100644 index 0000000000..702ff2e9f8 --- /dev/null +++ b/themes/hugo-darktable-docs-theme/i18n/en-us.yaml @@ -0,0 +1,20 @@ +- id: translations + translation: "Translations" + +- id: copyright + translation: "Copyright" + +- id: copyrightEntity + translation: "Someone or something" + +- id: search + translation: "Search" + +- id: results + translation: "Results" + +- id: current + translation: "(Current)" + +- id: table-of-contents + translation: "Table of Contents" diff --git a/themes/hugo-darktable-docs-theme/i18n/pt-br.yaml b/themes/hugo-darktable-docs-theme/i18n/pt-br.yaml new file mode 100644 index 0000000000..457fd9c0c5 --- /dev/null +++ b/themes/hugo-darktable-docs-theme/i18n/pt-br.yaml @@ -0,0 +1,20 @@ +- id: translations + translation: "Traduções" + +- id: copyright + translation: "Copyright" + +- id: copyrightEntity + translation: "Alguém ou alguma coisa" + +- id: search + translation: "Pesquisar" + +- id: results + translation: "Resultados" + +- id: current + translation: "(Atual)" + +- id: table-of-contents + translation: "Índice" diff --git a/themes/hugo-darktable-docs-theme/layouts/404.html b/themes/hugo-darktable-docs-theme/layouts/404.html new file mode 100644 index 0000000000..e69de29bb2 diff --git a/themes/hugo-darktable-docs-theme/layouts/_default/_markup/render-heading.html b/themes/hugo-darktable-docs-theme/layouts/_default/_markup/render-heading.html new file mode 100644 index 0000000000..5d9a744015 --- /dev/null +++ b/themes/hugo-darktable-docs-theme/layouts/_default/_markup/render-heading.html @@ -0,0 +1 @@ +🔗{{ .Text | safeHTML }} diff --git a/themes/hugo-darktable-docs-theme/layouts/_default/_markup/render-image.html b/themes/hugo-darktable-docs-theme/layouts/_default/_markup/render-image.html new file mode 100644 index 0000000000..5034d4bc9e --- /dev/null +++ b/themes/hugo-darktable-docs-theme/layouts/_default/_markup/render-image.html @@ -0,0 +1,17 @@ +{{ $link := string .Destination }} +{{ $imgBase := path.Base .Destination }} +{{ $Scratch := newScratch }} +{{ $Scratch.Set "enLink" .Page.RelPermalink }} + +{{ $classSplit := split $imgBase "#" }} + +{{ if hasPrefix $link "http" }} +{{ .Text }} +{{ else }} +{{ range .Page.Translations }} + {{ if eq .Language.LanguageName "English" }} + {{ $Scratch.Set "enLink" .RelPermalink }} + {{ end }} +{{ end }} +{{ .Text }} +{{ end }} diff --git a/themes/hugo-darktable-docs-theme/layouts/_default/_markup/render-link.html b/themes/hugo-darktable-docs-theme/layouts/_default/_markup/render-link.html new file mode 100644 index 0000000000..d3386785b6 --- /dev/null +++ b/themes/hugo-darktable-docs-theme/layouts/_default/_markup/render-link.html @@ -0,0 +1,20 @@ +{{ $link := strings.Replace .Destination "_index.md" "" }} +{{- /* This comment removes newlines. */ -}} +{{ $isRemote := strings.HasPrefix $link "http" }} +{{- /* This comment removes newlines. */ -}} +{{- if not $isRemote -}} +{{- /* This comment removes newlines. */ -}} +{{ $url := urls.Parse $link }} +{{- /* This comment removes newlines. */ -}} +{{- if $url.Path -}} +{{- /* This comment removes newlines. */ -}} +{{ $fragment := "" }} +{{- /* This comment removes newlines. */ -}} +{{- with $url.Fragment }}{{ $fragment = printf "#%s" . }}{{ end -}} +{{- /* This comment removes newlines. */ -}} +{{- with .Page.GetPage $url.Path }}{{ $link = printf "%s%s" .RelPermalink $fragment }}{{ end }}{{ end -}} +{{- /* This comment removes newlines. */ -}} +{{- end -}} +{{- /* This comment removes newlines. */ -}} +{{ .Text | safeHTML }} +{{- /* This comment removes newlines. */ -}} diff --git a/themes/hugo-darktable-docs-theme/layouts/_default/baseof.html b/themes/hugo-darktable-docs-theme/layouts/_default/baseof.html new file mode 100644 index 0000000000..95097d1f83 --- /dev/null +++ b/themes/hugo-darktable-docs-theme/layouts/_default/baseof.html @@ -0,0 +1,35 @@ + + + + {{ partial "head-meta.html" . }} + {{ partial "css.html" . }} + {{ partial "javascript.html" . }} + + + + + {{ partial "page-header-navbar-large.html" . }} + +
    +
    +
    + {{ block "main" .}} + + {{ end }} +
    + +
    + + + +
    + + + + + +{{ partial "navjs.html" . }} diff --git a/themes/hugo-darktable-docs-theme/layouts/_default/index.json b/themes/hugo-darktable-docs-theme/layouts/_default/index.json new file mode 100644 index 0000000000..bfd33dbf3a --- /dev/null +++ b/themes/hugo-darktable-docs-theme/layouts/_default/index.json @@ -0,0 +1,5 @@ +{{- $.Scratch.Add "index" slice -}} +{{- range .Site.RegularPages -}} + {{- $.Scratch.Add "index" (dict "title" .Title "tags" .Params.tags "categories" .Params.categories "content" .Plain "href" .RelPermalink "date" .Date) -}} +{{- end -}} +{{- $.Scratch.Get "index" | jsonify -}} diff --git a/themes/hugo-darktable-docs-theme/layouts/_default/list.html b/themes/hugo-darktable-docs-theme/layouts/_default/list.html new file mode 100644 index 0000000000..fd2906c318 --- /dev/null +++ b/themes/hugo-darktable-docs-theme/layouts/_default/list.html @@ -0,0 +1,30 @@ +{{ define "main" }} + +{{ partial "breadcrumbs.html" . }} + +{{ partial "prev-next.html" . }} + +
    + +

    {{ .Title }}

    + +
    + +{{ partial "prev-next.html" . }} + +{{ end }} diff --git a/themes/hugo-darktable-docs-theme/layouts/_default/single.html b/themes/hugo-darktable-docs-theme/layouts/_default/single.html new file mode 100644 index 0000000000..45255322d7 --- /dev/null +++ b/themes/hugo-darktable-docs-theme/layouts/_default/single.html @@ -0,0 +1,38 @@ +{{ define "title" }}{{ .Title | markdownify }} | {{ .Site.Title }}{{ end }} +{{ define "main" }} +{{ $dateFormat := default "Mon Jan 2, 2006" (index .Site.Params "date_format") }} + + +{{ partial "breadcrumbs.html" . }} + +{{ partial "prev-next.html" . }} + + + +{{ partial "prev-next.html" . }} + +{{ end }} diff --git a/themes/hugo-darktable-docs-theme/layouts/index.html b/themes/hugo-darktable-docs-theme/layouts/index.html new file mode 100644 index 0000000000..417590d37d --- /dev/null +++ b/themes/hugo-darktable-docs-theme/layouts/index.html @@ -0,0 +1,22 @@ +{{ define "title" }}{{ .Title | markdownify }} | {{ .Site.Title }}{{ end }} +{{ define "main" }} +{{ $dateFormat := default "Mon Jan 2, 2006" (index .Site.Params "date_format") }} + + + + +{{ end }} diff --git a/themes/hugo-darktable-docs-theme/layouts/partials/breadcrumbs.html b/themes/hugo-darktable-docs-theme/layouts/partials/breadcrumbs.html new file mode 100644 index 0000000000..56612664ca --- /dev/null +++ b/themes/hugo-darktable-docs-theme/layouts/partials/breadcrumbs.html @@ -0,0 +1,15 @@ +
    + + {{ template "breadcrumb" dict "page" . "value" .Title }} + +
    + +{{- define "breadcrumb" -}} +{{- $parent := .page.Parent -}} +{{- if $parent -}} +{{ $value := (printf "%s / %s" $parent.RelPermalink $parent.Title .value) }} +{{ template "breadcrumb" dict "page" $parent "value" $value }} +{{- else -}} +{{.value|safeHTML}} +{{- end -}} +{{- end -}} diff --git a/themes/hugo-darktable-docs-theme/layouts/partials/css.html b/themes/hugo-darktable-docs-theme/layouts/partials/css.html new file mode 100644 index 0000000000..071bbfc91f --- /dev/null +++ b/themes/hugo-darktable-docs-theme/layouts/partials/css.html @@ -0,0 +1,10 @@ + +{{- if .Site.IsServer -}} +{{- $options := (dict "targetPath" "css/style.css" "outputStyle" "expanded" "enableSourceMap" true "includePaths" (slice "themes/hugo-darktable-docs-theme/assets/node_modules/bootstrap/scss" "themes/hugo-darktable-docs-theme/assets/node_modules/fork-awesome/scss")) -}} +{{- $style := resources.Get "sass/main.scss" | resources.ToCSS $options | fingerprint -}} + +{{- else -}} +{{- $options := (dict "targetPath" "css/style.css" "outputStyle" "compressed" "enableSourceMap" true "includePaths" (slice "themes/hugo-darktable-docs-theme/assets/node_modules/bootstrap/scss" "themes/hugo-darktable-docs-theme/assets/node_modules/fork-awesome/scss")) -}} +{{- $style := resources.Get "sass/main.scss" | resources.ToCSS $options | minify | fingerprint -}} + +{{- end -}} diff --git a/themes/hugo-darktable-docs-theme/layouts/partials/head-meta.html b/themes/hugo-darktable-docs-theme/layouts/partials/head-meta.html new file mode 100644 index 0000000000..29f976ac5a --- /dev/null +++ b/themes/hugo-darktable-docs-theme/layouts/partials/head-meta.html @@ -0,0 +1,15 @@ + + +{{ block "title" . }}{{ .Site.Title }}{{ if .Title }} - {{ .Title }}{{ end }}{{ end }} + + + + + + + + + +{{ with .OutputFormats.Get "rss" -}} + +{{ end -}} diff --git a/themes/hugo-darktable-docs-theme/layouts/partials/javascript.html b/themes/hugo-darktable-docs-theme/layouts/partials/javascript.html new file mode 100644 index 0000000000..6a3c70857a --- /dev/null +++ b/themes/hugo-darktable-docs-theme/layouts/partials/javascript.html @@ -0,0 +1,31 @@ + + + + +{{- /**/ -}} +{{- $jquery := resources.Get "/node_modules/jquery/dist/jquery.min.js" -}} + +{{ $javascript := slice $jquery | resources.Concat "/js/jquery.js" }} + + +{{- $popper := resources.Get "/node_modules/popper.js/dist/popper.js" -}} + +{{ $javascript := slice $popper | resources.Concat "/js/popper.js" }} + + +{{- $bootstrap := resources.Get "/node_modules/bootstrap/dist/js/bootstrap.js" -}} + +{{ $javascript := slice $bootstrap | resources.Concat "/js/bootstrap.js" }} + + +{{- $lunr := resources.Get "/node_modules/lunr/lunr.js" -}} + +{{ $javascript := slice $lunr | resources.Concat "/js/lunr.js" }} + + +{{- /**/ -}} +{{- $app := resources.Get "/js/app.js" | resources.ExecuteAsTemplate "/js/app.js" . -}} + +{{ $javascript := slice $app | resources.Concat "/js/app.js" }} + + diff --git a/themes/hugo-darktable-docs-theme/layouts/partials/nav.html b/themes/hugo-darktable-docs-theme/layouts/partials/nav.html new file mode 100644 index 0000000000..3b0e7c0fc0 --- /dev/null +++ b/themes/hugo-darktable-docs-theme/layouts/partials/nav.html @@ -0,0 +1,29 @@ +{{- with .Site.GetPage "/" -}} +{{- template "nav-children" (dict "Section" . "CurrentPage" $) -}} +{{- end -}} + +{{- define "nav-children" -}}{{- /* (dict "Section" .Section "CurrentPage" .CurrentPage) */ -}} +
      + {{- range .Section.Pages -}} + {{ if .IsSection }} +
    • + + {{ template "nav-link" (dict "Page" . "CurrentPage" $.CurrentPage) }} + {{ template "nav-children" (dict "Section" . "CurrentPage" $.CurrentPage) }} +
    • + {{ else if and .IsPage .Content }} +
    • + + {{ template "nav-link" (dict "Page" . "CurrentPage" $.CurrentPage) }} +
    • + {{ end }} + {{- end -}} +
    +{{- end -}} + +{{ define "nav-link" }}{{/* (dict "Page" .Page "CurrentPage" .CurrentPage) */}} +{{ $current := eq .CurrentPage .Page }} + + {{ .Page.Title }} + +{{ end }} diff --git a/themes/hugo-darktable-docs-theme/layouts/partials/navjs.html b/themes/hugo-darktable-docs-theme/layouts/partials/navjs.html new file mode 100644 index 0000000000..28674e31e3 --- /dev/null +++ b/themes/hugo-darktable-docs-theme/layouts/partials/navjs.html @@ -0,0 +1,53 @@ + diff --git a/themes/hugo-darktable-docs-theme/layouts/partials/page-footer.html b/themes/hugo-darktable-docs-theme/layouts/partials/page-footer.html new file mode 100644 index 0000000000..46e02c1d66 --- /dev/null +++ b/themes/hugo-darktable-docs-theme/layouts/partials/page-footer.html @@ -0,0 +1,5 @@ +
    +

    + © {{ i18n "copyright" }} {{ now.Format "2006" }} {{ i18n "copyrightEntity" }} +

    +
    diff --git a/themes/hugo-darktable-docs-theme/layouts/partials/page-header-navbar-large.html b/themes/hugo-darktable-docs-theme/layouts/partials/page-header-navbar-large.html new file mode 100644 index 0000000000..c1f9cedf72 --- /dev/null +++ b/themes/hugo-darktable-docs-theme/layouts/partials/page-header-navbar-large.html @@ -0,0 +1,38 @@ + + +
    +
    diff --git a/themes/hugo-darktable-docs-theme/layouts/partials/prev-next.html b/themes/hugo-darktable-docs-theme/layouts/partials/prev-next.html new file mode 100644 index 0000000000..bb2212586e --- /dev/null +++ b/themes/hugo-darktable-docs-theme/layouts/partials/prev-next.html @@ -0,0 +1,42 @@ +{{- .Scratch.Set "pcurrpagefound" 0 -}} +{{- with .Site.GetPage "/" -}} +{{- template "pn-children" (dict "Section" . "CurrentPage" $) -}} +{{- end -}} + +{{- define "pn-children" -}}{{- /* (dict "Section" .Section "CurrentPage" .CurrentPage) */ -}} + {{- range .Section.Pages -}} + {{- if .IsSection -}} + {{- template "pn-link" (dict "Page" . "CurrentPage" $.CurrentPage) -}} + {{- template "pn-children" (dict "Section" . "CurrentPage" $.CurrentPage) -}} + {{- else if and .IsPage .Content -}} + {{- template "pn-link" (dict "Page" . "CurrentPage" $.CurrentPage) -}} + {{- end -}} + {{- end -}} +{{- end -}} + +{{- define "pn-link" -}}{{- /* (dict "Page" .Page "CurrentPage" .CurrentPage) */ -}} + {{- if (eq ( .CurrentPage.Scratch.Get "pcurrpagefound" ) 1) -}} + {{- .CurrentPage.Scratch.Set "pnextlink" .Page.RelPermalink -}} + {{- .CurrentPage.Scratch.Set "pnexttitle" .Page.Title -}} + {{- .CurrentPage.Scratch.Set "pcurrpagefound" 2 -}} + {{- else if eq .CurrentPage .Page -}} + {{- .CurrentPage.Scratch.Set "pcurrpagefound" 1 -}} + {{ else if (eq ( .CurrentPage.Scratch.Get "pcurrpagefound" ) 0) }} + {{- .CurrentPage.Scratch.Set "pprevlink" .Page.RelPermalink -}} + {{- .CurrentPage.Scratch.Set "pprevtitle" .Page.Title -}} + {{- end -}} +{{- end -}} + + +
    +
    + {{ if .Scratch.Get "pprevlink" }} + + {{ end }} +
    +
    + {{ if .Scratch.Get "pnextlink" }} + + {{ end }} +
    +
    diff --git a/themes/hugo-darktable-docs-theme/layouts/partials/table-of-contents.html b/themes/hugo-darktable-docs-theme/layouts/partials/table-of-contents.html new file mode 100644 index 0000000000..191e36252a --- /dev/null +++ b/themes/hugo-darktable-docs-theme/layouts/partials/table-of-contents.html @@ -0,0 +1,8 @@ + +
    +
    + {{ .TableOfContents }} +
    +
    diff --git a/themes/hugo-darktable-docs-theme/layouts/partials/tags.html b/themes/hugo-darktable-docs-theme/layouts/partials/tags.html new file mode 100644 index 0000000000..f4b02bb0cf --- /dev/null +++ b/themes/hugo-darktable-docs-theme/layouts/partials/tags.html @@ -0,0 +1,9 @@ +{{ if .Params.tags }} +{{ range $index, $tag := .Params.tags }} +{{ if gt $index 0 }}, +{{ end }} + + {{ . }} + +{{ end }} +{{ end }} diff --git a/themes/hugo-darktable-docs-theme/static/css/.gitkeep b/themes/hugo-darktable-docs-theme/static/css/.gitkeep new file mode 100644 index 0000000000..8d1c8b69c3 --- /dev/null +++ b/themes/hugo-darktable-docs-theme/static/css/.gitkeep @@ -0,0 +1 @@ + diff --git a/themes/hugo-darktable-docs-theme/static/favicon.ico b/themes/hugo-darktable-docs-theme/static/favicon.ico new file mode 100644 index 0000000000..c58fbbe881 Binary files /dev/null and b/themes/hugo-darktable-docs-theme/static/favicon.ico differ diff --git a/themes/hugo-darktable-docs-theme/static/js/.gitkeep b/themes/hugo-darktable-docs-theme/static/js/.gitkeep new file mode 100644 index 0000000000..8d1c8b69c3 --- /dev/null +++ b/themes/hugo-darktable-docs-theme/static/js/.gitkeep @@ -0,0 +1 @@ + diff --git a/themes/hugo-darktable-docs-theme/static/language-icons/icon20x24px-exported-transparent.png b/themes/hugo-darktable-docs-theme/static/language-icons/icon20x24px-exported-transparent.png new file mode 100755 index 0000000000..c802f4e054 Binary files /dev/null and b/themes/hugo-darktable-docs-theme/static/language-icons/icon20x24px-exported-transparent.png differ diff --git a/themes/hugo-darktable-docs-theme/theme.toml b/themes/hugo-darktable-docs-theme/theme.toml new file mode 100644 index 0000000000..aa03b7f16f --- /dev/null +++ b/themes/hugo-darktable-docs-theme/theme.toml @@ -0,0 +1,15 @@ +# theme.toml template for a Hugo theme +# See https://github.com/gohugoio/hugoThemes#themetoml for an example + +name = "hugo darktable docs theme" +license = "MIT" +licenselink = "https://gitlab.com/pixlsus/hugo-darktable-docs-theme/blob/master/LICENSE" +description = "" +homepage = "https://gitlab.com/pixlsus/hugo-darktable-docs-theme" +tags = [] +features = [] +min_version = "0.41.0" + +[author] + name = "Mica Semrick" + homepage = "https://silentumbrella.com"