diff options
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/404.html | 11 | ||||
-rw-r--r-- | layouts/_default/baseof.html | 34 | ||||
-rw-r--r-- | layouts/_default/list.html | 18 | ||||
-rw-r--r-- | layouts/_default/single.html | 18 | ||||
-rw-r--r-- | layouts/index.html | 19 | ||||
-rw-r--r-- | layouts/index.json | 12 | ||||
-rw-r--r-- | layouts/partials/footer.html | 24 | ||||
-rw-r--r-- | layouts/partials/head.html | 22 | ||||
-rw-r--r-- | layouts/partials/header.html | 20 | ||||
-rw-r--r-- | layouts/partials/menu.html | 80 | ||||
-rw-r--r-- | layouts/partials/next-prev-page.html | 48 | ||||
-rw-r--r-- | layouts/partials/tableofcontents.html | 3 | ||||
-rw-r--r-- | layouts/shortcodes/alert.html | 4 | ||||
-rw-r--r-- | layouts/shortcodes/button.html | 6 | ||||
-rw-r--r-- | layouts/shortcodes/childpages.html | 34 | ||||
-rw-r--r-- | layouts/shortcodes/code.html | 28 | ||||
-rw-r--r-- | layouts/shortcodes/collapse.html | 11 | ||||
-rw-r--r-- | layouts/shortcodes/doublecode.html | 33 | ||||
-rw-r--r-- | layouts/shortcodes/lead.html | 3 | ||||
-rw-r--r-- | layouts/shortcodes/panel.html | 14 |
20 files changed, 442 insertions, 0 deletions
diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..86d4eb6 --- /dev/null +++ b/layouts/404.html @@ -0,0 +1,11 @@ +<div style="height:100vh;"> + + <div class="d-flex flex-column align-items-center justify-content-center h-100"> + <h1 class="display-1 text-muted">Oops!</h1> + <p class="lead">Error 404. The page you requested could not be found.</p> + <a href="{{ .Site.BaseURL | relLangURL }}" class="btn btn-outline-primary mt-5"> + <i class="fas fa-arrow-left"></i> + Return to the homepage + </a> + </div> +</div> diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..5c627ac --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,34 @@ +<!DOCTYPE html> +<html> + {{- partial "head.html" . -}} + <body> + + {{- partial "header.html" . -}} + + <div class="container-fluid"> + <div class="row"> + + <div class="docs-sidenav order-0 col-12 col-md-3 col-lg-2 col-xl-2 position-sticky border-right"> + {{- partial "menu.html" . -}} + </div> + + <div class="docs-toc large order-lg-2 order-md-0 order-xs-1 col-12 col-lg-2 col-xl-2 position-sticky border-left"> + {{- partial "tableofcontents.html" . -}} + </div> + + <div class="main col-12 order-1 col-md-9 col-lg-10 col-xl-8 py-3"> + {{- block "main" . }}{{- end }} + + <div class="position-relative w-75 m-auto"> + {{ partial "next-prev-page.html" . }} + </div> + + </div> + + </div> + </div> + + {{- partial "footer.html" . -}} + + </body> +</html> diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..d9364ba --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,18 @@ +{{ define "main" }} + +<h1>{{ .Title }}</h1> + +{{ .Content }} + + {{ if .IsTranslated }} + <h4>{{ i18n "translations" }}</h4> + <ul> + {{ range .Translations }} + <li> + <a href="{{ .RelPermalink }}">{{ .Lang }}: {{ .Title }}</a> + </li> + {{ end }} + </ul> + {{ end }} + +{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..d9364ba --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,18 @@ +{{ define "main" }} + +<h1>{{ .Title }}</h1> + +{{ .Content }} + + {{ if .IsTranslated }} + <h4>{{ i18n "translations" }}</h4> + <ul> + {{ range .Translations }} + <li> + <a href="{{ .RelPermalink }}">{{ .Lang }}: {{ .Title }}</a> + </li> + {{ end }} + </ul> + {{ end }} + +{{ end }} diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..85c67c2 --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,19 @@ +{{ define "main" }} + {{if .Site.Home.Content }} + + <h1>{{ .Title }}</h1> + + {{.Site.Home.Content}} + {{else}} + <h1>Customize your own home page</h1> + <p> + The site is working. Don't forget to customize this homepage with your own. You typically have 2 choices : + </p> + <ul> + <li><b>1. </b> Create an _index.md document in the content folder</li> + <li><b>2. </b> Configure your server to automatically redirect this home page to one of your documentation pages</li> + </ul> + <p><i class="fa fa-heart fa-4x"></i></p> + {{ end }} + +{{ end }} diff --git a/layouts/index.json b/layouts/index.json new file mode 100644 index 0000000..84219aa --- /dev/null +++ b/layouts/index.json @@ -0,0 +1,12 @@ +[{{ range $index, $page := .Site.Pages }} +{{- if and (ne $page.Type "json") (ne $page.Type "html") -}} +{{- if and $index (gt $index 0) -}},{{- end }} +{ + "uri": "{{ $page.Permalink }}", + "title": "{{ htmlEscape $page.Title}}", + "tags": [{{ range $tindex, $tag := $page.Params.tags }}{{ if $tindex }}, {{ end }}"{{ $tag| htmlEscape }}"{{ end }}], + "description": "{{ htmlEscape .Description}}", + "content": {{$page.Plain | jsonify}} +} +{{- end -}} +{{- end -}}] diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..e00b0fb --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,24 @@ +<!-- Load required Javascript --> +<script src="{{ .Site.BaseURL }}lib/jquery.min.js"></script> <!-- jQuery.js --> +<script src="{{ .Site.BaseURL }}lib/popper.min.js"></script> <!-- Popper.js - dependency of Bootstrap --> + +<script src="{{ .Site.BaseURL }}js/bootstrap.min.js"></script> <!-- Other javascript --> + +<!-- Plugin: search --> +<script type="text/javascript" src="{{"plugins/lunr.min.js" | relURL}}"></script> +<script type="text/javascript" src="{{"plugins/auto-complete.js" | relURL}}"></script> +<link href="{{"plugins/auto-complete.css" | relURL}}" rel="stylesheet"> +<script type="text/javascript"> + {{ if .Site.IsMultiLingual }} + var baseurl = "{{.Site.BaseURL}}{{.Site.LanguagePrefix}}"; + {{ else }} + var baseurl = "{{.Site.BaseURL}}"; + {{ end }} +</script> +<script type="text/javascript" src="{{"plugins/search.js" | relURL}}"></script> + +<!-- Plugin: clipboard --> +<script type="text/javascript" src="{{"plugins/clipboard.js" | relURL}}"></script> +<script> + new ClipboardJS('.btn'); +</script> diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..4524afd --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,22 @@ +<head> + + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> + + <link rel="canonical" href="{{ .Permalink }}"> + + <title> + {{ block "title" . }} + {{ .Title}}{{ if ne .Title .Site.Title }} | {{ .Site.Title }}{{ end }} + {{ end }} + </title> + + <!-- Load stylesheet --> + <link href="{{ .Site.BaseURL }}css/fontawesome.min.css" rel="stylesheet"> + + {{ $style := resources.Get "css/ace.scss" | toCSS (dict "targetPath" "css/ace.css" "enableSourceMap" false) }} + <link rel="stylesheet" href="{{ ($style | minify | fingerprint).RelPermalink }}"> + + {{ template "_internal/google_analytics_async.html" . }} + +</head> diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..5d0170e --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,20 @@ +<nav class="navbar navbar-expand navbar-dark bg-primary shadow sticky-top"> + <div class="container"> + <div> + <a class="navbar-brand" href="{{ .Site.BaseURL | relLangURL }}"> + {{ .Site.Title }} + </a> + </div> + <ul class="navbar-nav ml-auto"> + {{- with .Site.Menus.shortcuts}} + {{- range sort . "Weight"}} + <li class="nav-item"> + <a class="nav-link" href="{{.URL}}" {{if eq $.Site.Params.menushortcutsnewtab true}}target="_blank"{{end}}> + {{safeHTML .Name}} + </a> + </li> + {{- end}} + {{- end}} + </ul> + </div> +</nav> diff --git a/layouts/partials/menu.html b/layouts/partials/menu.html new file mode 100644 index 0000000..fc1310b --- /dev/null +++ b/layouts/partials/menu.html @@ -0,0 +1,80 @@ +<nav class="navbar navbar-expand-md navbar-light pl-0"> + <button class="navbar-toggler navbar-toggler-right collapsed" type="button" data-toggle="collapse" data-target="#sidenav-left-collapse" aria-controls="sidenav-left-collapse" aria-expanded="false" aria-label="Toggle navigation"> + <span class="navbar-toggler-icon"></span> + </button> + + <div class="collapse navbar-collapse align-items-start flex-column" id="sidenav-left-collapse"> + {{- if not .Site.Params.disableSearch}} + <form class="form-inline my-2 my-lg-0 searchbox"> + <input class="form-control mr-sm-2 w-100" data-search-input id="search-by" type="text" placeholder="Search"> + </form> + {{- end}} + <ul class="navbar-nav flex-column pt-3"> + {{- $currentNode := . }} + {{- $showvisitedlinks := .Site.Params.showVisitedLinks -}} + {{- if eq .Site.Params.ordersectionsby "title"}} + {{- range .Site.Home.Sections.ByTitle}} + {{- template "section-tree-nav" dict "sect" . "currentnode" $currentNode}} + {{- end}} + {{- else}} + {{- range .Site.Home.Sections.ByWeight}} + {{- template "section-tree-nav" dict "sect" . "currentnode" $currentNode}} + {{- end}} + {{- end}} + </ul> + </div> +</nav> + +<!-- Template --> +{{- define "section-tree-nav" }} +{{- $currentNode := .currentnode }} +{{- with .sect}} +{{- if and .IsSection (or (not .Params.hidden) $.showhidden)}} + {{- $numberOfPages := (add (len .Pages) (len .Sections)) }} + {{- safeHTML .Params.head}} + <li data-nav-id="{{.RelPermalink}}" class="nav-item my-1 + {{- if .IsAncestor $currentNode}} parent{{end}} + {{- if eq .RelPermalink $currentNode.RelPermalink}} active{{end}} + {{- if .Params.alwaysopen}} alwaysopen{{end -}} + {{- if ne $numberOfPages 0 }} haschildren{{end}} + "> + <!-- I'm the params head --> + <a class="nav-link p-0" href="{{.RelPermalink}}"><h6>{{safeHTML .Params.Pre}}{{.Title}}{{safeHTML .Params.Post}}</h6></a> + {{- if ne $numberOfPages 0 }} + <ul class="list-unstyled ml-2"> + {{- .Scratch.Set "pages" .Pages }} + {{- if .Sections}} + {{- .Scratch.Set "pages" (.Pages | union .Sections) }} + {{- end}} + {{- $pages := (.Scratch.Get "pages") }} + + {{- if eq .Site.Params.ordersectionsby "title"}} + {{- range $pages.ByTitle }} + {{- if and .Params.hidden (not $.showhidden) }} + {{- else}} + {{- template "section-tree-nav" dict "sect" . "currentnode" $currentNode }} + {{- end}} + {{- end}} + {{- else}} + {{- range $pages.ByWeight }} + {{- if and .Params.hidden (not $.showhidden) }} + {{- else}} + {{- template "section-tree-nav" dict "sect" . "currentnode" $currentNode }} + {{- end}} + {{- end}} + {{- end}} + </ul> + {{- end}} + </li> +{{- else}} + {{- if not .Params.Hidden }} + <li data-nav-id="{{.RelPermalink}}" class="nav-item my-1 {{- if eq .RelPermalink $currentNode.RelPermalink}} active{{end -}}"> + <!-- I'm the params hidden --> + <a href="{{.RelPermalink}}" class="nav-link p-0"> + {{safeHTML .Params.Pre}}{{.LinkTitle}}{{safeHTML .Params.Post}} + </a> + </li> + {{- end}} +{{- end}} +{{- end}} +{{- end}} diff --git a/layouts/partials/next-prev-page.html b/layouts/partials/next-prev-page.html new file mode 100644 index 0000000..20c7b93 --- /dev/null +++ b/layouts/partials/next-prev-page.html @@ -0,0 +1,48 @@ +<div class="bg-primary overflow-hidden p-3 mt-5 shadow"> + + <h4 class="text-white text-center">Read more</h4> + + <!-- Next prev page --> + {{- $currentNode := . -}} + + {{- template "menu-nextprev" dict "menu" .Site.Home "currentnode" $currentNode -}} + + {{- define "menu-nextprev" -}} + {{- $currentNode := .currentnode -}} + {{- if ne .menu.Params.hidden true -}} + {{- if hasPrefix $currentNode.RelPermalink .menu.RelPermalink -}} + {{- $currentNode.Scratch.Set "NextPageOK" "OK" -}} + {{- $currentNode.Scratch.Set "prevPage" ($currentNode.Scratch.Get "prevPageTmp") -}} + {{- else -}} + {{- if eq ($currentNode.Scratch.Get "NextPageOK") "OK" -}} + {{- $currentNode.Scratch.Set "NextPageOK" nil -}} + {{- $currentNode.Scratch.Set "nextPage" .menu -}} + {{- end -}} + {{- end -}} + {{- $currentNode.Scratch.Set "prevPageTmp" .menu -}} + + {{- $currentNode.Scratch.Set "pages" .menu.Pages -}} + {{- if .menu.IsHome -}} + {{- $currentNode.Scratch.Set "pages" .menu.Sections -}} + {{- else if .menu.Sections -}} + {{- $currentNode.Scratch.Set "pages" (.menu.Pages | union .menu.Sections) -}} + {{- end -}} + {{- $pages := ($currentNode.Scratch.Get "pages") -}} + + {{- range $pages.ByWeight -}} + {{- template "menu-nextprev" dict "menu" . "currentnode" $currentNode -}} + {{- end -}} + {{- end -}} + {{- end -}} + + <div class="d-flex justify-content-center"> + {{- if not $.Site.Params.disableNavChevron -}} + {{- with ($.Scratch.Get "prevPage") -}} + <a class="p-1 mr-3 d-inline-block text-white" href="{{.RelPermalink}}" title="{{.Title}}"> <i class="fas fa-chevron-left"></i> {{.Title}}</a> + {{ end -}} + {{- with ($.Scratch.Get "nextPage") -}} + <a class="p-1 ml-3 d-inline-block text-white text-right" href="{{.RelPermalink}}" title="{{.Title}}">{{.Title}} <i class="fas fa-chevron-right"></i></a> + {{- end }} + {{- end -}} + </div> +</div> diff --git a/layouts/partials/tableofcontents.html b/layouts/partials/tableofcontents.html new file mode 100644 index 0000000..5b16b27 --- /dev/null +++ b/layouts/partials/tableofcontents.html @@ -0,0 +1,3 @@ +<div class="docs-toc"> + {{ .TableOfContents }} +</div> diff --git a/layouts/shortcodes/alert.html b/layouts/shortcodes/alert.html new file mode 100644 index 0000000..13e24f0 --- /dev/null +++ b/layouts/shortcodes/alert.html @@ -0,0 +1,4 @@ +{{ $style := .Get "style" }} +<div class="alert alert-{{ $style }}" role="alert"> + {{ print .Inner | markdownify }} +</div> diff --git a/layouts/shortcodes/button.html b/layouts/shortcodes/button.html new file mode 100644 index 0000000..27fcf26 --- /dev/null +++ b/layouts/shortcodes/button.html @@ -0,0 +1,6 @@ +{{ $style := .Get "style" }} +{{ $link := .Get "link" }} + +<a href="{{ $link }}" class="btn btn-{{ $style }}"> + {{ print .Inner | markdownify }} +</a> diff --git a/layouts/shortcodes/childpages.html b/layouts/shortcodes/childpages.html new file mode 100644 index 0000000..94ff26f --- /dev/null +++ b/layouts/shortcodes/childpages.html @@ -0,0 +1,34 @@ +{{- $sortTerm := .Get "sort" | default "Weight" }} + +{{- .Scratch.Set "current" .Page }} + +{{- if (.Get "page")}} + {{- with .Site.GetPage "section" (.Get "page") }} + {{- $.Scratch.Set "current" . }} + {{- end }} +{{- end }} + +{{- $cpage := (.Scratch.Get "current") }} + + +<ul class="docs-children list-unstyled"> + {{- .Scratch.Set "pages" $cpage.Pages }} + {{- if $cpage.Sections}} + {{- .Scratch.Set "pages" ($cpage.Pages | union $cpage.Sections) }} + {{- end}} + {{- $pages := (.Scratch.Get "pages") }} + + {{- if eq $sortTerm "Weight"}} + {{- template "childs" dict "menu" $pages.ByWeight "pages" .Site.Pages "sortTerm" $sortTerm}} + {{end}} +</ul> + + + +{{ define "childs" }} + {{- range .menu }} + <li class="h2 py-1"> + <a href="{{.RelPermalink}}"> {{ .Title }} </a> + </li> + {{ end }} +{{ end }}
\ No newline at end of file diff --git a/layouts/shortcodes/code.html b/layouts/shortcodes/code.html new file mode 100644 index 0000000..5d8a778 --- /dev/null +++ b/layouts/shortcodes/code.html @@ -0,0 +1,28 @@ +{{ .Scratch.Set "content" "" }} +{{ .Scratch.Set "identifier" "" }} + +{{ $identifier := "" }} +{{ $filepath := .Get "file"}} +{{ if ($filepath) }} + {{ .Scratch.Set "content" ($filepath | readFile) }} + {{ .Scratch.Set "identifier" (first 10 (md5 (.Scratch.Get "content"))) }} +{{ else }} + {{ .Scratch.Set "content" .Inner }} + {{ .Scratch.Set "identifier" (first 10 (md5 .Inner)) }} +{{ end}} + +{{ $lang := .Get "lang" }} + +<div class="position-relative"> + <div class="position-absolute" style="right:0;"> + <button class="btn btn-light" data-clipboard-target="#{{printf "clipboard_%s" (.Scratch.Get "identifier") }}"> + Copy + </button> + </div> + <div id="{{printf "clipboard_%s" (.Scratch.Get "identifier") }}"> + {{ (print "```" $lang "\n" (.Scratch.Get "content") "\n```") | markdownify }} + </div> +</div> + + + diff --git a/layouts/shortcodes/collapse.html b/layouts/shortcodes/collapse.html new file mode 100644 index 0000000..3770e17 --- /dev/null +++ b/layouts/shortcodes/collapse.html @@ -0,0 +1,11 @@ +{{ .Scratch.Set "identifier" (first 10 (md5 .Inner)) }} + +<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#{{printf "collapse_%s" (.Scratch.Get "identifier") }}" aria-expanded="false"> + {{ print (.Get "title") }} +</button> + +<div class="collapse" id="{{printf "collapse_%s" (.Scratch.Get "identifier") }}"> + <div class="card card-body"> + {{ .Inner }} + </div> +</div>
\ No newline at end of file diff --git a/layouts/shortcodes/doublecode.html b/layouts/shortcodes/doublecode.html new file mode 100644 index 0000000..e57b355 --- /dev/null +++ b/layouts/shortcodes/doublecode.html @@ -0,0 +1,33 @@ +{{ .Scratch.Set "content" "" }} +{{ .Scratch.Set "identifier" "" }} + +{{ $identifier := "" }} +{{ $filepath := .Get "file"}} +{{ if ($filepath) }} +{{ .Scratch.Set "content" ($filepath | readFile) }} +{{ .Scratch.Set "identifier" (first 10 (md5 (.Scratch.Get "content"))) }} +{{ else }} +{{ .Scratch.Set "content" .Inner }} +{{ .Scratch.Set "identifier" (first 10 (md5 .Inner)) }} +{{ end}} + +{{ $lang := .Get "lang" }} + +<div class="border border-light" style="border-width:3px!important;"> + + <div class="px-3 py-2"> + {{ (.Scratch.Get "content") | safeHTML }} + </div> + +</div> + +<div class="position-relative"> + <div class="position-absolute" style="right:0;"> + <button class="btn btn-light" data-clipboard-target="#{{printf "clipboard_%s" (.Scratch.Get "identifier") }}"> + Copy + </button> + </div> + <div id="{{printf "clipboard_%s" (.Scratch.Get "identifier") }}"> + {{ (print "```" $lang "\n" (.Scratch.Get "content") "\n```") | markdownify }} + </div> +</div> diff --git a/layouts/shortcodes/lead.html b/layouts/shortcodes/lead.html new file mode 100644 index 0000000..b63cb9e --- /dev/null +++ b/layouts/shortcodes/lead.html @@ -0,0 +1,3 @@ +<p class="lead"> + {{ print .Inner | markdownify }} +</p> diff --git a/layouts/shortcodes/panel.html b/layouts/shortcodes/panel.html new file mode 100644 index 0000000..a5ad93c --- /dev/null +++ b/layouts/shortcodes/panel.html @@ -0,0 +1,14 @@ +{{ $style := .Get "style"}} + +<div class="card my-3 border-top-0 border-right-0 border-bottom-0 border-left border-{{ $style }} rounded" style="border-width:4px !important;"> + <div class="wrap border border-left-0 rounded"> + {{ with .Get "title" }} + <div class="card-header border-0 bg-white pl-3 text-{{ $style }}"> + <h3>{{.}}</h3> + </div> + {{ end }} + <div class="card-body pt-1"> + {{ print .Inner | markdownify }} + </div> + </div> +</div> |