From 811c277eca5686278a2dbdfe16a26165c7e9ed7e Mon Sep 17 00:00:00 2001 From: Yauhen Shulitski Date: Sat, 27 Jan 2018 16:05:19 +0100 Subject: Initial --- LICENSE.md | 20 +++++ archetypes/default.md | 7 ++ layouts/404.html | 0 layouts/_default/list.html | 0 layouts/_default/single.html | 0 layouts/index.html | 15 ++++ layouts/partials/head.html | 16 ++++ layouts/partials/logo.html | 3 + layouts/partials/section.html | 8 ++ layouts/partials/sidebar.html | 36 +++++++++ layouts/partials/tail.html | 2 + layouts/shortcodes/anchor.html | 4 + layouts/shortcodes/block.html | 3 + static/css/styles.css | 169 +++++++++++++++++++++++++++++++++++++++++ theme.toml | 15 ++++ 15 files changed, 298 insertions(+) create mode 100644 LICENSE.md create mode 100644 archetypes/default.md create mode 100644 layouts/404.html create mode 100644 layouts/_default/list.html create mode 100644 layouts/_default/single.html create mode 100644 layouts/index.html create mode 100644 layouts/partials/head.html create mode 100644 layouts/partials/logo.html create mode 100644 layouts/partials/section.html create mode 100644 layouts/partials/sidebar.html create mode 100644 layouts/partials/tail.html create mode 100644 layouts/shortcodes/anchor.html create mode 100644 layouts/shortcodes/block.html create mode 100644 static/css/styles.css create mode 100644 theme.toml diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..624b3f3 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2018 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/archetypes/default.md b/archetypes/default.md new file mode 100644 index 0000000..9093d16 --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,7 @@ +--- +title: "{{ replace .TranslationBaseName "-" " " | title }}" +date: {{ .Date }} +anchor: "{{ replace .TranslationBaseName "-" " " | title | urlize }}" +weight: +draft: true +--- diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..e69de29 diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..e69de29 diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..e69de29 diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..efa8394 --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,15 @@ +{{ partial "head.html" . }} +{{ partial "sidebar.html" . }} +
+ {{ with .Sections }} + {{ range .ByWeight }} + {{ partial "section.html" . }} + {{ if .Pages }} + {{ range .Pages.ByWeight }} + {{ partial "section.html" . }} + {{ end }} + {{ end }} + {{ end }} + {{ end }} +
+{{ partial "tail.html" . }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..6d69727 --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,16 @@ + + + + {{ .Hugo.Generator }} + + + + + {{ .Site.Title }} + + + + + + + diff --git a/layouts/partials/logo.html b/layouts/partials/logo.html new file mode 100644 index 0000000..b744525 --- /dev/null +++ b/layouts/partials/logo.html @@ -0,0 +1,3 @@ +
+ One doc +
diff --git a/layouts/partials/section.html b/layouts/partials/section.html new file mode 100644 index 0000000..f07c210 --- /dev/null +++ b/layouts/partials/section.html @@ -0,0 +1,8 @@ +
+

+ {{ .Title }} +

+
+ {{ .Content }} +
+
diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html new file mode 100644 index 0000000..7746744 --- /dev/null +++ b/layouts/partials/sidebar.html @@ -0,0 +1,36 @@ + diff --git a/layouts/partials/tail.html b/layouts/partials/tail.html new file mode 100644 index 0000000..308b1d0 --- /dev/null +++ b/layouts/partials/tail.html @@ -0,0 +1,2 @@ + + diff --git a/layouts/shortcodes/anchor.html b/layouts/shortcodes/anchor.html new file mode 100644 index 0000000..7cb4dcd --- /dev/null +++ b/layouts/shortcodes/anchor.html @@ -0,0 +1,4 @@ +{{ $page_path := .Get 0 -}} +{{ with .Site.GetPage "page" $page_path }} + #{{ .Params.anchor }} +{{ end -}} diff --git a/layouts/shortcodes/block.html b/layouts/shortcodes/block.html new file mode 100644 index 0000000..313292a --- /dev/null +++ b/layouts/shortcodes/block.html @@ -0,0 +1,3 @@ +
+ {{ .Inner }} +
diff --git a/static/css/styles.css b/static/css/styles.css new file mode 100644 index 0000000..caa8919 --- /dev/null +++ b/static/css/styles.css @@ -0,0 +1,169 @@ +html { + font-family: "Open Sans", sans-serif; + color: rgba(0, 0, 0, 0.84); +} +@media (min-width: 48em) { + html { + font-size: 16px; + } +} +@media (min-width: 58em) { + html { + font-size: 20px; + } +} + +.sidebar { + text-align: center; + padding: 1rem 1rem; + color: white; + background-color: #363636; +} +@media (min-width: 48em) { + .sidebar { + position: fixed; + top: 0; + left: 0; + bottom: 0; + width: 18rem; + text-align: left; + } +} + +.content { + padding-top: 1rem; + padding-bottom: 1rem; +} + +@media (min-width: 48em) { + .content { + margin-left: 20rem; + margin-right: 2rem; + } +} + +@media (min-width: 64em) { + .content { + margin-left: 22rem; + margin-right: 4rem; + } +} + +/* Sidebar */ +.site-title { + margin-top: 0px; +} + +.sidebar a, +.sidebar a:hover, +.sidebar a:visited { + text-decoration: none; + color: white; +} + +.sidebar ul { + margin: 0px; + padding: 0px; +} + +.sidebar ul li { + list-style: none; + padding-left: 1em; +} + +.sidebar ul ul li { + list-style: none; + padding-left: 2em; +} + +nav { + margin: 2em 0 2em 0; +} + +/* Blocks */ +.block { + margin: 1em 0em 1em 0em; + padding: 0 5px 5px 5px; + border-top: 34px solid; + position: relative; + overflow-wrap: break-word; +} + +.block:before { + position: absolute; + top: -32px; + left: 10px; + color: white; +} + +.block.tip { + background: #e8f7e6; + border-top-color: #84c578; +} + +.block.block.tip:before { + content: "Tip"; +} + +.block.note { + background: #e6f3fb; + border-top-color: #6bb1e0; +} + +.block.block.note:before { + content: "Note"; +} + +.block.info { + background: #fefaf5; + border-top-color: #f1b37e; +} + +.block.block.info:before { + content: "Info"; +} + +.block.warn { + background: #fbeded; + border-top-color: #d58181; +} + +.block.block.warn:before { + content: "Warning"; +} + +/* Section of the page */ +section.page { + margin-bottom: 3em; +} + +section.page h1 { + border-left: 2px solid; + padding-left: 0.5em; + margin-bottom: 0; +} + +section.page .content { + margin-left: 0.5em; +} + +section.page h1 a, +section.page h1 a:hover, +section.page h1 a:visited { + text-decoration: none; + color: #363636; +} + +section.page a, +section.page a:hover, +section.page a:visited { + color: #363636; +} + +div.footer { + position: absolute; + right: 0px; + margin-right: 2em; + margin-bottom: 1em; + bottom: 0px; +} diff --git a/theme.toml b/theme.toml new file mode 100644 index 0000000..35b97c0 --- /dev/null +++ b/theme.toml @@ -0,0 +1,15 @@ +# theme.toml template for a Hugo theme +# See https://github.com/gohugoio/hugoThemes#themetoml for an example + +name = "One page doc" +license = "MIT" +licenselink = "https://github.com/jsnjack/hugo_one_page_doc/blob/master/LICENSE.md" +description = "One page doc theme" +homepage = "http://example.com/" +tags = ["one_page", "docs", "documentation"] +features = [] +min_version = "0.33" + +[author] + name = "Yauhen Shulitski" + homepage = "https://github.com/jsnjack" -- cgit v1.2.3