From 96fd12a8c49328077693c52568023d33a919fb2c Mon Sep 17 00:00:00 2001 From: Manuel Sousa Date: Mon, 9 Nov 2020 17:56:52 +0000 Subject: [PATCH 1/8] Squashed 'themes/hugo-book/' content from commit 615400b git-subtree-dir: themes/hugo-book git-subtree-split: 615400b3b74772d2b81fef17ab8773b6e9627692 --- .github/workflows/main.yml | 33 + .gitignore | 3 + LICENSE | 20 + README.md | 303 +++++ archetypes/docs.md | 9 + archetypes/posts.md | 4 + assets/_custom.scss | 3 + assets/_defaults.scss | 50 + assets/_fonts.scss | 49 + assets/_main.scss | 381 ++++++ assets/_markdown.scss | 190 +++ assets/_print.scss | 17 + assets/_shortcodes.scss | 104 ++ assets/_utils.scss | 92 ++ assets/_variables.scss | 3 + assets/book.scss | 14 + assets/manifest.json | 15 + assets/menu-reset.js | 7 + assets/normalize.css | 349 +++++ assets/plugins/_dark.scss | 10 + assets/plugins/_numbered.scss | 36 + assets/plugins/_scrollbars.scss | 26 + assets/search-data.js | 30 + assets/search.js | 101 ++ assets/sw-register.js | 7 + assets/sw.js | 55 + exampleSite/assets/_custom.scss | 4 + exampleSite/assets/_variables.scss | 3 + exampleSite/config.toml | 103 ++ exampleSite/config.yaml | 99 ++ exampleSite/content.ru/_index.md | 79 ++ exampleSite/content.zh/_index.md | 79 ++ exampleSite/content/_index.md | 41 + exampleSite/content/docs/example/_index.md | 71 + .../example/collapsed/3rd-level/4th-level.md | 12 + .../example/collapsed/3rd-level/_index.md | 26 + .../content/docs/example/collapsed/_index.md | 23 + exampleSite/content/docs/example/hidden.md | 52 + .../docs/example/table-of-contents/_index.md | 85 ++ .../example/table-of-contents/with-toc.md | 64 + .../example/table-of-contents/without-toc.md | 59 + exampleSite/content/docs/shortcodes/_index.md | 3 + .../content/docs/shortcodes/buttons.md | 13 + .../content/docs/shortcodes/columns.md | 45 + .../content/docs/shortcodes/details.md | 22 + exampleSite/content/docs/shortcodes/expand.md | 35 + exampleSite/content/docs/shortcodes/hints.md | 32 + exampleSite/content/docs/shortcodes/katex.md | 28 + .../content/docs/shortcodes/mermaid.md | 38 + .../content/docs/shortcodes/section/_index.md | 15 + .../content/docs/shortcodes/section/page1.md | 1 + .../content/docs/shortcodes/section/page2.md | 1 + exampleSite/content/docs/shortcodes/tabs.md | 50 + exampleSite/content/menu/index.md | 22 + exampleSite/content/posts/_index.md | 7 + .../content/posts/creating-a-new-theme.md | 1150 +++++++++++++++++ exampleSite/content/posts/goisforlovers.md | 344 +++++ exampleSite/content/posts/hugoisforlovers.md | 89 ++ .../content/posts/migrate-from-jekyll.md | 156 +++ ...s_50fc8c04e12a2f59027287995557ceff.content | 1 + ...scss_50fc8c04e12a2f59027287995557ceff.json | 1 + ...s_50fc8c04e12a2f59027287995557ceff.content | 1 + ...scss_50fc8c04e12a2f59027287995557ceff.json | 1 + i18n/cn.yaml | 21 + i18n/de.yaml | 14 + i18n/en.yaml | 14 + i18n/es.yaml | 14 + i18n/fr.yaml | 14 + i18n/jp.yaml | 20 + i18n/ko.yaml | 20 + i18n/nb.yaml | 14 + i18n/pt.yaml | 14 + i18n/ru.yaml | 14 + i18n/sv.yaml | 14 + i18n/uk.yaml | 14 + i18n/zh.yaml | 20 + images/screenshot.png | Bin 0 -> 189080 bytes images/tn.png | Bin 0 -> 195683 bytes layouts/404.html | 35 + layouts/_default/_markup/render-heading.html | 4 + layouts/_default/_markup/render-image.html | 19 + layouts/_default/_markup/render-link.html | 28 + layouts/_default/baseof.html | 82 ++ layouts/_default/list.html | 1 + layouts/_default/single.html | 1 + layouts/partials/docs/brand.html | 8 + layouts/partials/docs/comments.html | 2 + layouts/partials/docs/date.html | 6 + layouts/partials/docs/footer.html | 24 + layouts/partials/docs/header.html | 13 + layouts/partials/docs/html-head.html | 43 + layouts/partials/docs/inject/body.html | 0 .../partials/docs/inject/content-after.html | 0 .../partials/docs/inject/content-before.html | 0 layouts/partials/docs/inject/footer.html | 0 layouts/partials/docs/inject/head.html | 0 layouts/partials/docs/inject/menu-after.html | 0 layouts/partials/docs/inject/menu-before.html | 0 layouts/partials/docs/languages.html | 28 + layouts/partials/docs/menu-bundle.html | 4 + layouts/partials/docs/menu-filetree.html | 43 + layouts/partials/docs/menu-hugo.html | 28 + layouts/partials/docs/menu.html | 22 + layouts/partials/docs/post-meta.html | 13 + layouts/partials/docs/search.html | 7 + layouts/partials/docs/taxonomy.html | 19 + layouts/partials/docs/title.html | 15 + layouts/partials/docs/toc.html | 1 + layouts/posts/list.html | 22 + layouts/posts/single.html | 15 + layouts/shortcodes/button.html | 12 + layouts/shortcodes/columns.html | 7 + layouts/shortcodes/details.html | 6 + layouts/shortcodes/expand.html | 13 + layouts/shortcodes/hint.html | 3 + layouts/shortcodes/katex.html | 13 + layouts/shortcodes/mermaid.html | 14 + layouts/shortcodes/section.html | 10 + layouts/shortcodes/tab.html | 12 + layouts/shortcodes/tabs.html | 15 + layouts/taxonomy/list.html | 13 + layouts/taxonomy/taxonomy.html | 22 + static/favicon.png | Bin 0 -> 109 bytes static/favicon.svg | 1 + static/flexsearch.min.js | 42 + .../fonts/roboto-mono-v6-latin-regular.woff | Bin 0 -> 19972 bytes .../fonts/roboto-mono-v6-latin-regular.woff2 | Bin 0 -> 16328 bytes static/fonts/roboto-v19-latin-300italic.woff | Bin 0 -> 22204 bytes static/fonts/roboto-v19-latin-300italic.woff2 | Bin 0 -> 17448 bytes static/fonts/roboto-v19-latin-700.woff | Bin 0 -> 20356 bytes static/fonts/roboto-v19-latin-700.woff2 | Bin 0 -> 15816 bytes static/fonts/roboto-v19-latin-regular.woff | Bin 0 -> 20268 bytes static/fonts/roboto-v19-latin-regular.woff2 | Bin 0 -> 15736 bytes static/katex/auto-render.min.js | 1 + static/katex/fonts/KaTeX_AMS-Regular.ttf | Bin 0 -> 70972 bytes static/katex/fonts/KaTeX_AMS-Regular.woff | Bin 0 -> 38868 bytes static/katex/fonts/KaTeX_AMS-Regular.woff2 | Bin 0 -> 32944 bytes static/katex/fonts/KaTeX_Caligraphic-Bold.ttf | Bin 0 -> 19316 bytes .../katex/fonts/KaTeX_Caligraphic-Bold.woff | Bin 0 -> 11696 bytes .../katex/fonts/KaTeX_Caligraphic-Bold.woff2 | Bin 0 -> 10448 bytes .../katex/fonts/KaTeX_Caligraphic-Regular.ttf | Bin 0 -> 18684 bytes .../fonts/KaTeX_Caligraphic-Regular.woff | Bin 0 -> 11460 bytes .../fonts/KaTeX_Caligraphic-Regular.woff2 | Bin 0 -> 10240 bytes static/katex/fonts/KaTeX_Fraktur-Bold.ttf | Bin 0 -> 35660 bytes static/katex/fonts/KaTeX_Fraktur-Bold.woff | Bin 0 -> 22632 bytes static/katex/fonts/KaTeX_Fraktur-Bold.woff2 | Bin 0 -> 20360 bytes static/katex/fonts/KaTeX_Fraktur-Regular.ttf | Bin 0 -> 34352 bytes static/katex/fonts/KaTeX_Fraktur-Regular.woff | Bin 0 -> 22088 bytes .../katex/fonts/KaTeX_Fraktur-Regular.woff2 | Bin 0 -> 19784 bytes static/katex/fonts/KaTeX_Main-Bold.ttf | Bin 0 -> 60784 bytes static/katex/fonts/KaTeX_Main-Bold.woff | Bin 0 -> 35464 bytes static/katex/fonts/KaTeX_Main-Bold.woff2 | Bin 0 -> 30244 bytes static/katex/fonts/KaTeX_Main-BoldItalic.ttf | Bin 0 -> 44496 bytes static/katex/fonts/KaTeX_Main-BoldItalic.woff | Bin 0 -> 25352 bytes .../katex/fonts/KaTeX_Main-BoldItalic.woff2 | Bin 0 -> 21944 bytes static/katex/fonts/KaTeX_Main-Italic.ttf | Bin 0 -> 47640 bytes static/katex/fonts/KaTeX_Main-Italic.woff | Bin 0 -> 26228 bytes static/katex/fonts/KaTeX_Main-Italic.woff2 | Bin 0 -> 22748 bytes static/katex/fonts/KaTeX_Main-Regular.ttf | Bin 0 -> 69520 bytes static/katex/fonts/KaTeX_Main-Regular.woff | Bin 0 -> 38112 bytes static/katex/fonts/KaTeX_Main-Regular.woff2 | Bin 0 -> 32464 bytes static/katex/fonts/KaTeX_Math-BoldItalic.ttf | Bin 0 -> 39308 bytes static/katex/fonts/KaTeX_Math-BoldItalic.woff | Bin 0 -> 22324 bytes .../katex/fonts/KaTeX_Math-BoldItalic.woff2 | Bin 0 -> 19720 bytes static/katex/fonts/KaTeX_Math-Italic.ttf | Bin 0 -> 40992 bytes static/katex/fonts/KaTeX_Math-Italic.woff | Bin 0 -> 22844 bytes static/katex/fonts/KaTeX_Math-Italic.woff2 | Bin 0 -> 20096 bytes static/katex/fonts/KaTeX_SansSerif-Bold.ttf | Bin 0 -> 33688 bytes static/katex/fonts/KaTeX_SansSerif-Bold.woff | Bin 0 -> 18516 bytes static/katex/fonts/KaTeX_SansSerif-Bold.woff2 | Bin 0 -> 15732 bytes static/katex/fonts/KaTeX_SansSerif-Italic.ttf | Bin 0 -> 30960 bytes .../katex/fonts/KaTeX_SansSerif-Italic.woff | Bin 0 -> 17572 bytes .../katex/fonts/KaTeX_SansSerif-Italic.woff2 | Bin 0 -> 15024 bytes .../katex/fonts/KaTeX_SansSerif-Regular.ttf | Bin 0 -> 29812 bytes .../katex/fonts/KaTeX_SansSerif-Regular.woff | Bin 0 -> 16228 bytes .../katex/fonts/KaTeX_SansSerif-Regular.woff2 | Bin 0 -> 13708 bytes static/katex/fonts/KaTeX_Script-Regular.ttf | Bin 0 -> 24620 bytes static/katex/fonts/KaTeX_Script-Regular.woff | Bin 0 -> 13428 bytes static/katex/fonts/KaTeX_Script-Regular.woff2 | Bin 0 -> 12064 bytes static/katex/fonts/KaTeX_Size1-Regular.ttf | Bin 0 -> 12916 bytes static/katex/fonts/KaTeX_Size1-Regular.woff | Bin 0 -> 6696 bytes static/katex/fonts/KaTeX_Size1-Regular.woff2 | Bin 0 -> 5592 bytes static/katex/fonts/KaTeX_Size2-Regular.ttf | Bin 0 -> 12172 bytes static/katex/fonts/KaTeX_Size2-Regular.woff | Bin 0 -> 6436 bytes static/katex/fonts/KaTeX_Size2-Regular.woff2 | Bin 0 -> 5392 bytes static/katex/fonts/KaTeX_Size3-Regular.ttf | Bin 0 -> 8120 bytes static/katex/fonts/KaTeX_Size3-Regular.woff | Bin 0 -> 4568 bytes static/katex/fonts/KaTeX_Size3-Regular.woff2 | Bin 0 -> 3728 bytes static/katex/fonts/KaTeX_Size4-Regular.ttf | Bin 0 -> 11016 bytes static/katex/fonts/KaTeX_Size4-Regular.woff | Bin 0 -> 6184 bytes static/katex/fonts/KaTeX_Size4-Regular.woff2 | Bin 0 -> 5028 bytes .../katex/fonts/KaTeX_Typewriter-Regular.ttf | Bin 0 -> 35924 bytes .../katex/fonts/KaTeX_Typewriter-Regular.woff | Bin 0 -> 20260 bytes .../fonts/KaTeX_Typewriter-Regular.woff2 | Bin 0 -> 17272 bytes static/katex/katex.min.css | 1 + static/katex/katex.min.js | 1 + static/mermaid.min.js | 49 + static/svg/calendar.svg | 1 + static/svg/edit.svg | 1 + static/svg/menu.svg | 1 + static/svg/toc.svg | 1 + static/svg/translate.svg | 1 + theme.toml | 15 + 203 files changed, 5711 insertions(+) create mode 100644 .github/workflows/main.yml create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 archetypes/docs.md create mode 100644 archetypes/posts.md create mode 100644 assets/_custom.scss create mode 100644 assets/_defaults.scss create mode 100644 assets/_fonts.scss create mode 100644 assets/_main.scss create mode 100644 assets/_markdown.scss create mode 100644 assets/_print.scss create mode 100644 assets/_shortcodes.scss create mode 100644 assets/_utils.scss create mode 100644 assets/_variables.scss create mode 100644 assets/book.scss create mode 100644 assets/manifest.json create mode 100644 assets/menu-reset.js create mode 100644 assets/normalize.css create mode 100644 assets/plugins/_dark.scss create mode 100644 assets/plugins/_numbered.scss create mode 100644 assets/plugins/_scrollbars.scss create mode 100644 assets/search-data.js create mode 100644 assets/search.js create mode 100644 assets/sw-register.js create mode 100644 assets/sw.js create mode 100644 exampleSite/assets/_custom.scss create mode 100644 exampleSite/assets/_variables.scss create mode 100644 exampleSite/config.toml create mode 100644 exampleSite/config.yaml create mode 100644 exampleSite/content.ru/_index.md create mode 100644 exampleSite/content.zh/_index.md create mode 100644 exampleSite/content/_index.md create mode 100644 exampleSite/content/docs/example/_index.md create mode 100644 exampleSite/content/docs/example/collapsed/3rd-level/4th-level.md create mode 100644 exampleSite/content/docs/example/collapsed/3rd-level/_index.md create mode 100644 exampleSite/content/docs/example/collapsed/_index.md create mode 100644 exampleSite/content/docs/example/hidden.md create mode 100644 exampleSite/content/docs/example/table-of-contents/_index.md create mode 100644 exampleSite/content/docs/example/table-of-contents/with-toc.md create mode 100644 exampleSite/content/docs/example/table-of-contents/without-toc.md create mode 100644 exampleSite/content/docs/shortcodes/_index.md create mode 100644 exampleSite/content/docs/shortcodes/buttons.md create mode 100644 exampleSite/content/docs/shortcodes/columns.md create mode 100644 exampleSite/content/docs/shortcodes/details.md create mode 100644 exampleSite/content/docs/shortcodes/expand.md create mode 100644 exampleSite/content/docs/shortcodes/hints.md create mode 100644 exampleSite/content/docs/shortcodes/katex.md create mode 100644 exampleSite/content/docs/shortcodes/mermaid.md create mode 100644 exampleSite/content/docs/shortcodes/section/_index.md create mode 100644 exampleSite/content/docs/shortcodes/section/page1.md create mode 100644 exampleSite/content/docs/shortcodes/section/page2.md create mode 100644 exampleSite/content/docs/shortcodes/tabs.md create mode 100644 exampleSite/content/menu/index.md create mode 100644 exampleSite/content/posts/_index.md create mode 100644 exampleSite/content/posts/creating-a-new-theme.md create mode 100644 exampleSite/content/posts/goisforlovers.md create mode 100644 exampleSite/content/posts/hugoisforlovers.md create mode 100644 exampleSite/content/posts/migrate-from-jekyll.md create mode 100644 exampleSite/resources/_gen/assets/scss/book.scss_50fc8c04e12a2f59027287995557ceff.content create mode 100644 exampleSite/resources/_gen/assets/scss/book.scss_50fc8c04e12a2f59027287995557ceff.json create mode 100644 exampleSite/resources/_gen/assets/scss/example/book.scss_50fc8c04e12a2f59027287995557ceff.content create mode 100644 exampleSite/resources/_gen/assets/scss/example/book.scss_50fc8c04e12a2f59027287995557ceff.json create mode 100644 i18n/cn.yaml create mode 100644 i18n/de.yaml create mode 100644 i18n/en.yaml create mode 100644 i18n/es.yaml create mode 100644 i18n/fr.yaml create mode 100644 i18n/jp.yaml create mode 100644 i18n/ko.yaml create mode 100644 i18n/nb.yaml create mode 100644 i18n/pt.yaml create mode 100644 i18n/ru.yaml create mode 100644 i18n/sv.yaml create mode 100644 i18n/uk.yaml create mode 100644 i18n/zh.yaml create mode 100644 images/screenshot.png create mode 100644 images/tn.png create mode 100644 layouts/404.html create mode 100644 layouts/_default/_markup/render-heading.html create mode 100644 layouts/_default/_markup/render-image.html create mode 100644 layouts/_default/_markup/render-link.html create mode 100644 layouts/_default/baseof.html create mode 100644 layouts/_default/list.html create mode 100644 layouts/_default/single.html create mode 100644 layouts/partials/docs/brand.html create mode 100644 layouts/partials/docs/comments.html create mode 100644 layouts/partials/docs/date.html create mode 100644 layouts/partials/docs/footer.html create mode 100644 layouts/partials/docs/header.html create mode 100644 layouts/partials/docs/html-head.html create mode 100644 layouts/partials/docs/inject/body.html create mode 100644 layouts/partials/docs/inject/content-after.html create mode 100644 layouts/partials/docs/inject/content-before.html create mode 100644 layouts/partials/docs/inject/footer.html create mode 100644 layouts/partials/docs/inject/head.html create mode 100644 layouts/partials/docs/inject/menu-after.html create mode 100644 layouts/partials/docs/inject/menu-before.html create mode 100644 layouts/partials/docs/languages.html create mode 100644 layouts/partials/docs/menu-bundle.html create mode 100644 layouts/partials/docs/menu-filetree.html create mode 100644 layouts/partials/docs/menu-hugo.html create mode 100644 layouts/partials/docs/menu.html create mode 100644 layouts/partials/docs/post-meta.html create mode 100644 layouts/partials/docs/search.html create mode 100644 layouts/partials/docs/taxonomy.html create mode 100644 layouts/partials/docs/title.html create mode 100644 layouts/partials/docs/toc.html create mode 100644 layouts/posts/list.html create mode 100644 layouts/posts/single.html create mode 100644 layouts/shortcodes/button.html create mode 100644 layouts/shortcodes/columns.html create mode 100644 layouts/shortcodes/details.html create mode 100644 layouts/shortcodes/expand.html create mode 100644 layouts/shortcodes/hint.html create mode 100644 layouts/shortcodes/katex.html create mode 100644 layouts/shortcodes/mermaid.html create mode 100644 layouts/shortcodes/section.html create mode 100644 layouts/shortcodes/tab.html create mode 100644 layouts/shortcodes/tabs.html create mode 100644 layouts/taxonomy/list.html create mode 100644 layouts/taxonomy/taxonomy.html create mode 100644 static/favicon.png create mode 100644 static/favicon.svg create mode 100644 static/flexsearch.min.js create mode 100644 static/fonts/roboto-mono-v6-latin-regular.woff create mode 100644 static/fonts/roboto-mono-v6-latin-regular.woff2 create mode 100644 static/fonts/roboto-v19-latin-300italic.woff create mode 100644 static/fonts/roboto-v19-latin-300italic.woff2 create mode 100644 static/fonts/roboto-v19-latin-700.woff create mode 100644 static/fonts/roboto-v19-latin-700.woff2 create mode 100644 static/fonts/roboto-v19-latin-regular.woff create mode 100644 static/fonts/roboto-v19-latin-regular.woff2 create mode 100644 static/katex/auto-render.min.js create mode 100644 static/katex/fonts/KaTeX_AMS-Regular.ttf create mode 100644 static/katex/fonts/KaTeX_AMS-Regular.woff create mode 100644 static/katex/fonts/KaTeX_AMS-Regular.woff2 create mode 100644 static/katex/fonts/KaTeX_Caligraphic-Bold.ttf create mode 100644 static/katex/fonts/KaTeX_Caligraphic-Bold.woff create mode 100644 static/katex/fonts/KaTeX_Caligraphic-Bold.woff2 create mode 100644 static/katex/fonts/KaTeX_Caligraphic-Regular.ttf create mode 100644 static/katex/fonts/KaTeX_Caligraphic-Regular.woff create mode 100644 static/katex/fonts/KaTeX_Caligraphic-Regular.woff2 create mode 100644 static/katex/fonts/KaTeX_Fraktur-Bold.ttf create mode 100644 static/katex/fonts/KaTeX_Fraktur-Bold.woff create mode 100644 static/katex/fonts/KaTeX_Fraktur-Bold.woff2 create mode 100644 static/katex/fonts/KaTeX_Fraktur-Regular.ttf create mode 100644 static/katex/fonts/KaTeX_Fraktur-Regular.woff create mode 100644 static/katex/fonts/KaTeX_Fraktur-Regular.woff2 create mode 100644 static/katex/fonts/KaTeX_Main-Bold.ttf create mode 100644 static/katex/fonts/KaTeX_Main-Bold.woff create mode 100644 static/katex/fonts/KaTeX_Main-Bold.woff2 create mode 100644 static/katex/fonts/KaTeX_Main-BoldItalic.ttf create mode 100644 static/katex/fonts/KaTeX_Main-BoldItalic.woff create mode 100644 static/katex/fonts/KaTeX_Main-BoldItalic.woff2 create mode 100644 static/katex/fonts/KaTeX_Main-Italic.ttf create mode 100644 static/katex/fonts/KaTeX_Main-Italic.woff create mode 100644 static/katex/fonts/KaTeX_Main-Italic.woff2 create mode 100644 static/katex/fonts/KaTeX_Main-Regular.ttf create mode 100644 static/katex/fonts/KaTeX_Main-Regular.woff create mode 100644 static/katex/fonts/KaTeX_Main-Regular.woff2 create mode 100644 static/katex/fonts/KaTeX_Math-BoldItalic.ttf create mode 100644 static/katex/fonts/KaTeX_Math-BoldItalic.woff create mode 100644 static/katex/fonts/KaTeX_Math-BoldItalic.woff2 create mode 100644 static/katex/fonts/KaTeX_Math-Italic.ttf create mode 100644 static/katex/fonts/KaTeX_Math-Italic.woff create mode 100644 static/katex/fonts/KaTeX_Math-Italic.woff2 create mode 100644 static/katex/fonts/KaTeX_SansSerif-Bold.ttf create mode 100644 static/katex/fonts/KaTeX_SansSerif-Bold.woff create mode 100644 static/katex/fonts/KaTeX_SansSerif-Bold.woff2 create mode 100644 static/katex/fonts/KaTeX_SansSerif-Italic.ttf create mode 100644 static/katex/fonts/KaTeX_SansSerif-Italic.woff create mode 100644 static/katex/fonts/KaTeX_SansSerif-Italic.woff2 create mode 100644 static/katex/fonts/KaTeX_SansSerif-Regular.ttf create mode 100644 static/katex/fonts/KaTeX_SansSerif-Regular.woff create mode 100644 static/katex/fonts/KaTeX_SansSerif-Regular.woff2 create mode 100644 static/katex/fonts/KaTeX_Script-Regular.ttf create mode 100644 static/katex/fonts/KaTeX_Script-Regular.woff create mode 100644 static/katex/fonts/KaTeX_Script-Regular.woff2 create mode 100644 static/katex/fonts/KaTeX_Size1-Regular.ttf create mode 100644 static/katex/fonts/KaTeX_Size1-Regular.woff create mode 100644 static/katex/fonts/KaTeX_Size1-Regular.woff2 create mode 100644 static/katex/fonts/KaTeX_Size2-Regular.ttf create mode 100644 static/katex/fonts/KaTeX_Size2-Regular.woff create mode 100644 static/katex/fonts/KaTeX_Size2-Regular.woff2 create mode 100644 static/katex/fonts/KaTeX_Size3-Regular.ttf create mode 100644 static/katex/fonts/KaTeX_Size3-Regular.woff create mode 100644 static/katex/fonts/KaTeX_Size3-Regular.woff2 create mode 100644 static/katex/fonts/KaTeX_Size4-Regular.ttf create mode 100644 static/katex/fonts/KaTeX_Size4-Regular.woff create mode 100644 static/katex/fonts/KaTeX_Size4-Regular.woff2 create mode 100644 static/katex/fonts/KaTeX_Typewriter-Regular.ttf create mode 100644 static/katex/fonts/KaTeX_Typewriter-Regular.woff create mode 100644 static/katex/fonts/KaTeX_Typewriter-Regular.woff2 create mode 100644 static/katex/katex.min.css create mode 100644 static/katex/katex.min.js create mode 100644 static/mermaid.min.js create mode 100644 static/svg/calendar.svg create mode 100644 static/svg/edit.svg create mode 100644 static/svg/menu.svg create mode 100644 static/svg/toc.svg create mode 100644 static/svg/translate.svg create mode 100644 theme.toml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..19f30e9cf --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,33 @@ +name: Build with Hugo + +on: [push] + +jobs: + hugo-latest: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + + - name: Install Hugo + run: | + LATEST_VERSION=`curl --silent "https://api.github.com/repos/gohugoio/hugo/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'` + VERSION_NO_PREFIX=`echo $LATEST_VERSION | cut -c 2-` + wget "https://github.com/gohugoio/hugo/releases/download/$LATEST_VERSION/hugo_extended_${VERSION_NO_PREFIX}_Linux-64bit.deb" -O /tmp/hugo.deb + sudo dpkg -i /tmp/hugo.deb + + - name: Run Hugo + working-directory: exampleSite + run: hugo --themesDir ../.. + hugo-minimum: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + + - name: Install Hugo + run: | + wget "https://github.com/gohugoio/hugo/releases/download/v0.68.0/hugo_extended_0.68.0_Linux-64bit.deb" -O /tmp/hugo.deb + sudo dpkg -i /tmp/hugo.deb + + - name: Run Hugo + working-directory: exampleSite + run: hugo --themesDir ../.. diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..e52eb5292 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +public/ +exampleSite/public/ +.DS_Store diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..e7a669ab2 --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2018 Alex Shpak + +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/README.md b/README.md new file mode 100644 index 000000000..b41cd3157 --- /dev/null +++ b/README.md @@ -0,0 +1,303 @@ +# Hugo Book Theme + +[![Hugo](https://img.shields.io/badge/hugo-0.68-blue.svg)](https://gohugo.io) +[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) +![Build with Hugo](https://github.com/alex-shpak/hugo-book/workflows/Build%20with%20Hugo/badge.svg) + +### [Hugo](https://gohugo.io) documentation theme as simple as plain book + +![Screenshot](https://github.com/alex-shpak/hugo-book/blob/master/images/screenshot.png) + +- [Features](#features) +- [Requirements](#requirements) +- [Installation](#installation) +- [Menu](#menu) +- [Blog](#blog) +- [Configuration](#configuration) +- [Shortcodes](#shortcodes) +- [Versioning](#versioning) +- [Contributing](#contributing) + +## Features + +- Clean simple design +- Light and Mobile-Friendly +- Multi-language support +- Customisable +- Zero initial configuration +- Handy shortcodes +- Comments support +- Simple blog and taxonomy +- Primary features work without JavaScript +- Dark Mode + +## Requirements + +- Hugo 0.68 or higher +- Hugo extended version, read more [here](https://gohugo.io/news/0.48-relnotes/) + +## Installation + +Navigate to your hugo project root and run: + +``` +git submodule add https://github.com/alex-shpak/hugo-book themes/book +``` + +Then run hugo (or set `theme = "book"`/`theme: book` in configuration file) + +``` +hugo server --minify --theme book +``` + +### Creating site from scratch + +Below is example how to create new site from scratch + +```sh +hugo new site mydocs; cd mydocs +git init +git submodule add https://github.com/alex-shpak/hugo-book themes/book +cp -R themes/book/exampleSite/content . +``` + +```sh +hugo server --minify --theme book +``` + +## Menu + +### File tree menu (default) + +By default theme will render pages from `content/docs` section as menu in a tree structure. +You can set `title` and `weight` in front matter of pages to adjust order and titles in menu. + +### Leaf bundle menu + +You can also use leaf bundle and content of it's `index.md` as menu. +Given you have this file structure + +``` +├── content +│ ├── docs +│ │ ├── page-one.md +│ │ └── page-two.md +│ └── posts +│ ├── post-one.md +│ └── post-two.md +``` + +Create file `content/docs/menu/index.md` with content + +```md ++++ +headless = true ++++ + +- [Book Example]({{< relref "/docs/" >}}) + - [Page One]({{< relref "/docs/page-one" >}}) + - [Page Two]({{< relref "/docs/page-two" >}}) +- [Blog]({{< relref "/posts" >}}) +``` + +And Enable it by settings `BookMenuBundle: /menu` in Site configuration + +- [Example menu](https://github.com/alex-shpak/hugo-book/blob/master/exampleSite/content/menu/index.md) +- [Example config file](https://github.com/alex-shpak/hugo-book/blob/master/exampleSite/config.yaml) +- [Leaf bundles](https://gohugo.io/content-management/page-bundles/) + +## Blog + +Simple blog supported for section `posts`. +Blog is not primary use case so book theme so it has only minimal features + +## Configuration + +### Site Configuration + +There are few configuration options you can add to your `config.toml` file. +You can also see `yaml` example [here](https://github.com/alex-shpak/hugo-book/blob/master/exampleSite/config.yaml). + +```toml +# (Optional) Set Google Analytics if you use it to track your website. +# Always put it on the top of the configuration file, otherwise it won't work +googleAnalytics = "UA-XXXXXXXXX-X" + +# (Optional) If you provide a Disqus shortname, comments will be enabled on +# all pages. +disqusShortname = "my-site" + +# (Optional) Set this to true if you use capital letters in file names +disablePathToLower = true + +# (Optional) Set this to true to enable 'Last Modified by' date and git author +# information on 'doc' type pages. +enableGitInfo = true + +# (Optional) Theme is intended for documentation use, therefore it doesn't render taxonomy. +# You can remove related files with config below +disableKinds = ['taxonomy', 'taxonomyTerm'] + +[params] + # (Optional, default true) Controls table of contents visibility on right side of pages. + # Start and end levels can be controlled with markup.tableOfContents setting. + # You can also specify this parameter per page in front matter. + BookToC = true + + # (Optional, default none) Set the path to a logo for the book. If the logo is + # /static/logo.png then the path would be 'logo.png' + BookLogo = 'logo.png' + + # (Optional, default none) Set leaf bundle to render as side menu + # When not specified file structure and weights will be used + BookMenuBundle = '/menu' + + # (Optional, default docs) Specify section of content to render as menu + # You can also set value to "*" to render all sections to menu + BookSection = 'docs' + + # Set source repository location. + # Used for 'Last Modified' and 'Edit this page' links. + BookRepo = 'https://github.com/alex-shpak/hugo-book' + + # Enable 'Edit this page' links for 'doc' page type. + # Disabled by default. Uncomment to enable. Requires 'BookRepo' param. + # Path must point to the site directory. + BookEditPath = 'edit/master/exampleSite' + + # (Optional, default January 2, 2006) Configure the date format used on the pages + # - In git information + # - In blog posts + BookDateFormat = 'Jan 2, 2006' + + # (Optional, default true) Enables search function with flexsearch, + # Index is built on fly, therefore it might slowdown your website. + # Configuration for indexing can be adjusted in i18n folder per language. + BookSearch = true + + # (Optional, default true) Enables comments template on pages + # By default partals/docs/comments.html includes Disqus template + # See https://gohugo.io/content-management/comments/#configure-disqus + # Can be overwritten by same param in page frontmatter + BookComments = true + + # /!\ This is an experimental feature, might be removed or changed at any time + # (Optional, experimental, default false) Enables portable links and link checks in markdown pages. + # Portable links meant to work with text editors and let you write markdown without {{< relref >}} shortcode + # Theme will print warning if page referenced in markdown does not exists. + BookPortableLinks = true + + # /!\ This is an experimental feature, might be removed or changed at any time + # (Optional, experimental, default false) Enables service worker that caches visited pages and resources for offline use. + BookServiceWorker = true +``` + +### Multi-Language Support +Theme supports Hugo's [multilingual mode](https://gohugo.io/content-management/multilingual/), just follow configuration guide there. You can also tweak search indexing configuration per language in `i18n` folder. + +### Page Configuration + +You can specify additional params per page in front matter + +```toml +# Set type to 'docs' if you want to render page outside of configured section or if you render section other than 'docs' +type = 'docs' + +# Set page weight to re-arrange items in file-tree menu (if BookMenuBundle not set) +weight = 10 + +# (Optional) Set to mark page as flat section in file-tree menu (if BookMenuBundle not set) +bookFlatSection = true + +# (Optional, Experimental) Set to hide nested sections or pages at that level. Works only with file-tree menu mode +bookCollapseSection = true + +# (Optional) Set true to hide page or section from side menu (if BookMenuBundle not set) +bookHidden = true + +# (Optional) Set 'false' to hide ToC from page +bookToC = true + +# (Optional) If you have enabled BookComments for the site, you can disable it for specific pages. +bookComments = true +``` + +### Partials + +There are few empty partials you can override in `layouts/partials/` + +| Partial | Placement | +| -------------------------------------------------- | -------------------------------------- | +| `layouts/partials/docs/inject/head.html` | Before closing `` tag | +| `layouts/partials/docs/inject/body.html` | Before closing `` tag | +| `layouts/partials/docs/inject/footer.html` | After page footer content | +| `layouts/partials/docs/inject/menu-before.html` | At the beginning of `