diff options
author | Yauhen Shulitski <jsnjack@gmail.com> | 2018-01-27 18:05:19 +0300 |
---|---|---|
committer | Yauhen Shulitski <jsnjack@gmail.com> | 2018-01-27 18:05:19 +0300 |
commit | 811c277eca5686278a2dbdfe16a26165c7e9ed7e (patch) | |
tree | 04717d0d152a05b33030d6f6c87720e62e15ac74 |
Initial
-rw-r--r-- | LICENSE.md | 20 | ||||
-rw-r--r-- | archetypes/default.md | 7 | ||||
-rw-r--r-- | layouts/404.html | 0 | ||||
-rw-r--r-- | layouts/_default/list.html | 0 | ||||
-rw-r--r-- | layouts/_default/single.html | 0 | ||||
-rw-r--r-- | layouts/index.html | 15 | ||||
-rw-r--r-- | layouts/partials/head.html | 16 | ||||
-rw-r--r-- | layouts/partials/logo.html | 3 | ||||
-rw-r--r-- | layouts/partials/section.html | 8 | ||||
-rw-r--r-- | layouts/partials/sidebar.html | 36 | ||||
-rw-r--r-- | layouts/partials/tail.html | 2 | ||||
-rw-r--r-- | layouts/shortcodes/anchor.html | 4 | ||||
-rw-r--r-- | layouts/shortcodes/block.html | 3 | ||||
-rw-r--r-- | static/css/styles.css | 169 | ||||
-rw-r--r-- | theme.toml | 15 |
15 files changed, 298 insertions, 0 deletions
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 --- /dev/null +++ b/layouts/404.html diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/layouts/_default/list.html diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/layouts/_default/single.html 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" . }} +<div class="content"> + {{ with .Sections }} + {{ range .ByWeight }} + {{ partial "section.html" . }} + {{ if .Pages }} + {{ range .Pages.ByWeight }} + {{ partial "section.html" . }} + {{ end }} + {{ end }} + {{ end }} + {{ end }} +</div> +{{ 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 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml"{{with .Site.LanguageCode}} xml:lang="{{.}}" lang="{{.}}"{{end}}> +<head> + {{ .Hugo.Generator }} + + <meta http-equiv="content-type" content="text/html; charset=utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1"> + + <title>{{ .Site.Title }}</title> + + <link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"> + <link rel="stylesheet" href="{{ .Site.BaseURL }}css/styles.css"> + <link href="{{ .RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" /> + +</head> +<body> 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 @@ +<div> + One doc +</div> 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 @@ +<section class="page" id="{{ .Params.anchor }}"> + <h1> + <a href="#{{ .Params.anchor }}">{{ .Title }}</a> + </h1> + <div class="content"> + {{ .Content }} + </div> +</section> 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 @@ +<div class="sidebar"> + {{ partial "logo.html" }} + <h1 class="site-title"><a href="/">{{ .Site.Title }}</a></h1> + <nav class="internal"> + <ul> + {{ with .Sections }} + {{ range .ByWeight }} + <li> + <li><a href="#{{ .Params.anchor }}">{{ .Title }}</a></li> + </li> + {{ if .Pages }} + <ul> + {{ range .Pages.ByWeight }} + <li><a href="#{{ .Params.anchor }}">{{ .Title }}</a></li> + {{ end }} + </ul> + {{ end }} + {{ end }} + {{ end }} + </ul> + </nav> + <nav class="external"> + {{ with .Site.Menus.shortcuts }} + <ul id="shortcuts"> + {{ range sort . "Weight" }} + <li> + <a href="{{.URL}}" target="_blank" rel="noopener">{{safeHTML .Name}}</a> + </li> + {{ end }} + </ul> + {{ end }} + </nav> + <div class="footer"> + {{ now.Format "2006" }} + </div> +</div> 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 @@ +</body> +</html> 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 @@ +<div class="block {{ .Get 0 }}"> + {{ .Inner }} +</div> 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" |