initial commit
This commit is contained in:
commit
b710cfda80
98 changed files with 9669 additions and 0 deletions
28
layouts/partials/head.html
Normal file
28
layouts/partials/head.html
Normal file
|
@ -0,0 +1,28 @@
|
|||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="{{ partial "title" . }}">
|
||||
|
||||
<title>{{ partial "title" . }} | {{ .Site.Title -}}</title>
|
||||
<link rel="icon" href="{{ "favicon/favicon-32x32.png" | relURL }}" type="image/x-icon">
|
||||
|
||||
<link rel="stylesheet" href="{{ "main.min.css" | relURL }}">
|
||||
<!-- Theme stylesheet, you can customize css by creating static/custom.css` in your website -->
|
||||
<link rel="stylesheet" href="{{ .Site.BaseURL }}/custom.css">
|
||||
|
||||
{{ if default true .Site.Params.GeekdocSearch }}
|
||||
{{ .Scratch.Set "geekdocSearchConfig" .Site.Params.GeekdocSearchConfig }}
|
||||
<!-- Remove after https://github.com/gohugoio/hugo/issues/6331 -->
|
||||
{{ $searchJSFile := printf "js/%s.search.js" .Language.Lang }}
|
||||
{{ $searchJS := resources.Get "js/search.js" | resources.ExecuteAsTemplate $searchJSFile . | resources.Minify }}
|
||||
<script defer src="{{ $searchJS.RelPermalink }}"></script>
|
||||
{{ end }}
|
||||
|
||||
<!-- RSS -->
|
||||
{{ with .OutputFormats.Get "rss" -}}
|
||||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
|
||||
{{ end -}}
|
||||
|
||||
{{ "<!--" | safeHTML }}
|
||||
Made with Geekdoc theme
|
||||
https://github.com/xoxys/hugo-geekdoc
|
||||
{{ "-->" | safeHTML }}
|
42
layouts/partials/menu-bundle.html
Normal file
42
layouts/partials/menu-bundle.html
Normal file
|
@ -0,0 +1,42 @@
|
|||
{{ $current := .current }}
|
||||
{{ template "menu-file" dict "sect" .source "current" $current "site" $current.Site }}
|
||||
|
||||
{{ define "menu-file" }}
|
||||
{{ $current := .current }}
|
||||
{{ $site := .site }}
|
||||
|
||||
<ul class="gdoc-nav__list">
|
||||
{{ range sort (default (seq 0) .sect) "weight" "desc" }}
|
||||
{{ $current.Scratch.Set "current" $current }}
|
||||
{{ $current.Scratch.Set "site" $site }}
|
||||
|
||||
<li>
|
||||
{{ $ref := default false .ref }}
|
||||
{{ if $ref}}
|
||||
{{ $site := $current.Scratch.Get "site" }}
|
||||
{{ $this := $site.GetPage .ref }}
|
||||
{{ $current := $current.Scratch.Get "current" }}
|
||||
{{ $icon := default false .icon }}
|
||||
|
||||
<span class="flex">
|
||||
{{ if $icon }}<svg class="icon {{ .icon }}"><use xlink:href="#{{ .icon }}"></use></svg>{{ end }}
|
||||
<a href="{{ if .external }}{{ .ref }}{{ else }}{{ relref $current .ref }}{{ end }}"
|
||||
class="gdoc-nav__entry {{ if not .external }}{{ if eq $current $this }}is-active{{ end }}{{ end }}">
|
||||
{{ .name }}
|
||||
</a>
|
||||
</span>
|
||||
{{ else }}
|
||||
<span class="flex">
|
||||
{{ .name }}
|
||||
</span>
|
||||
{{ end }}
|
||||
|
||||
{{ $sub := default false .sub }}
|
||||
{{ if $sub }}
|
||||
{{ template "menu-file" dict "sect" $sub "current" ($current.Scratch.Get "current") "site" ($current.Scratch.Get "site") }}
|
||||
{{ end }}
|
||||
</li>
|
||||
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
32
layouts/partials/menu-filetree.html
Normal file
32
layouts/partials/menu-filetree.html
Normal file
|
@ -0,0 +1,32 @@
|
|||
{{ $current := . }}
|
||||
{{ template "tree-nav" dict "sect" .Site.Home.Sections "current" $current }}
|
||||
|
||||
<!-- templates -->
|
||||
{{ define "tree-nav" }}
|
||||
{{ $current := .current }}
|
||||
|
||||
<ul class="gdoc-nav__list">
|
||||
{{ range .sect.GroupBy "Weight" "desc" }}
|
||||
{{ range .ByTitle }}
|
||||
|
||||
<li>
|
||||
{{ if or .Content .Params.ListOnly }}
|
||||
<span class="flex">
|
||||
<a href="{{ .RelPermalink }}" class="gdoc-nav__entry {{ if eq $current . }}is-active{{ end }}">
|
||||
{{ partial "title" . }}
|
||||
</a>
|
||||
</span>
|
||||
{{ else }}
|
||||
<span class="flex">{{ partial "title" . }}</span>
|
||||
{{ end }}
|
||||
|
||||
{{ $numberOfPages := (add (len .Pages) (len .Sections)) }}
|
||||
{{ if and (ne $numberOfPages 0) (not .Params.ListOnly) }}
|
||||
{{ template "tree-nav" dict "sect" .Pages "current" $current}}
|
||||
{{ end }}
|
||||
</li>
|
||||
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
19
layouts/partials/menu.html
Normal file
19
layouts/partials/menu.html
Normal file
|
@ -0,0 +1,19 @@
|
|||
<nav>
|
||||
{{ partial "search" . }}
|
||||
|
||||
<section class="gdoc-nav--main">
|
||||
<h2>Navigation</h2>
|
||||
{{ if .Site.Params.GeekdocMenuBundle }}
|
||||
{{ partial "menu-bundle" (dict "current" . "source" .Site.Data.menu.main.main) }}
|
||||
{{ else }}
|
||||
{{ partial "menu-filetree" . }}
|
||||
{{ end }}
|
||||
</section>
|
||||
|
||||
<section class="gdoc-nav--more">
|
||||
{{ if .Site.Data.menu.more.more }}
|
||||
<h2>More</h2>
|
||||
{{ partial "menu-bundle" (dict "current" . "source" .Site.Data.menu.more.more) }}
|
||||
{{ end }}
|
||||
</section>
|
||||
</nav>
|
60
layouts/partials/page-footer.html
Normal file
60
layouts/partials/page-footer.html
Normal file
|
@ -0,0 +1,60 @@
|
|||
{{ $current := . }}
|
||||
{{ $site := .Site }}
|
||||
{{ $current.Scratch.Set "prev" false }}
|
||||
{{ $current.Scratch.Set "getNext" false }}
|
||||
|
||||
{{ $current.Scratch.Set "nextPage" false }}
|
||||
{{ $current.Scratch.Set "prevPage" false }}
|
||||
|
||||
{{ template "menu_nextprev" dict "sect" $.Site.Data.menu.main.main "current" $current "site" $site }}
|
||||
|
||||
{{ define "menu_nextprev" }}
|
||||
{{ $current := .current }}
|
||||
{{ $site := .site }}
|
||||
|
||||
{{ range sort (default (seq 0) .sect) "weight" "desc" }}
|
||||
{{ $current.Scratch.Set "current" $current }}
|
||||
{{ $current.Scratch.Set "site" $site }}
|
||||
|
||||
{{ $ref := default false .ref }}
|
||||
{{ if $ref}}
|
||||
{{ $site := $current.Scratch.Get "site" }}
|
||||
{{ $this := $site.GetPage .ref }}
|
||||
{{ $current := $current.Scratch.Get "current" }}
|
||||
|
||||
{{ if $current.Scratch.Get "getNext" }}
|
||||
{{ $current.Scratch.Set "nextPage" $this }}
|
||||
{{ $current.Scratch.Set "getNext" false }}
|
||||
{{ end }}
|
||||
|
||||
{{ if eq $current $this }}
|
||||
{{ $current.Scratch.Set "prevPage" ($current.Scratch.Get "prev") }}
|
||||
{{ $current.Scratch.Set "getNext" true }}
|
||||
{{ end }}
|
||||
|
||||
{{ $current.Scratch.Set "prev" $this }}
|
||||
{{ end }}
|
||||
|
||||
{{ $sub := default false .sub }}
|
||||
{{ if $sub }}
|
||||
{{ template "menu_nextprev" dict "sect" $sub "current" ($current.Scratch.Get "current") "site" ($current.Scratch.Get "site") }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
<div class="gdoc-page__footer flex justify-between">
|
||||
{{ $showPrevNext := (and (not .Params.disableNextPrev) (not .Site.Params.disableNextPrev) .Site.Params.GeekdocMenuBundle) }}
|
||||
{{ if $showPrevNext }}
|
||||
<span>
|
||||
{{ with ($current.Scratch.Get "prevPage") }}
|
||||
<a class="gdoc-page__nav--prev" href="{{.RelPermalink}}" title="{{.Title}}"> {{ .Name }}</a>
|
||||
{{ end }}
|
||||
</span>
|
||||
<span>
|
||||
{{ with ($current.Scratch.Get "nextPage") }}
|
||||
<a class="gdoc-page__nav-next" href="{{.RelPermalink}}" title="{{.Title}}">{{ .Name }} </a>
|
||||
{{ end }}
|
||||
</span>
|
||||
{{ end }}
|
||||
</div>
|
38
layouts/partials/page-header.html
Normal file
38
layouts/partials/page-header.html
Normal file
|
@ -0,0 +1,38 @@
|
|||
{{ $geekdocRepo := default (default false .Site.Params.GeekdocRepo) .Page.Params.GeekdocRepo }}
|
||||
{{ $geekdocEditPath := default (default false .Site.Params.GeekdocEditPath) .Page.Params.GeekdocEditPath }}
|
||||
{{ if .File }}
|
||||
{{ $.Scratch.Set "geekdocFilePath" (default .File.Path .Page.Params.geekdocFilePath) }}
|
||||
{{ else }}
|
||||
{{ $.Scratch.Set "geekdocFilePath" false }}
|
||||
{{ end }}
|
||||
|
||||
{{define "breadcrumb"}}
|
||||
{{$parent := .page.Parent }}
|
||||
{{ if $parent }}
|
||||
{{ $value := (printf "<a href='%s'>%s</a> / %s" $parent.RelPermalink $parent.Title .value) }}
|
||||
{{ template "breadcrumb" dict "page" $parent "value" $value }}
|
||||
{{else}}
|
||||
{{.value|safeHTML}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
<div class="gdoc-page__header flex justify-between" itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
|
||||
{{$showBreadcrumb := (and (not .Params.disableBreadcrumb) (not .Site.Params.disableBreadcrumb))}}
|
||||
<span>
|
||||
{{if $showBreadcrumb}}
|
||||
<span class="breadcrumb">
|
||||
<svg class="icon path"><use xlink:href="#path"></use></svg>
|
||||
{{ $name := (partial "title" .) }}
|
||||
{{ template "breadcrumb" dict "page" . "value" $name }}
|
||||
</span>
|
||||
{{ end }}
|
||||
</span>
|
||||
<span>
|
||||
{{ if and ($.Scratch.Get "geekdocFilePath") $geekdocRepo $geekdocEditPath }}
|
||||
<svg class="icon code"><use xlink:href="#code"></use></svg>
|
||||
<a href="{{ $geekdocRepo }}/{{ $geekdocEditPath }}/{{ $.Scratch.Get "geekdocFilePath" }}">
|
||||
Edit this page
|
||||
</a>
|
||||
{{ end }}
|
||||
</span>
|
||||
</div>
|
9
layouts/partials/search.html
Normal file
9
layouts/partials/search.html
Normal file
|
@ -0,0 +1,9 @@
|
|||
{{ if default true .Site.Params.GeekdocSearch }}
|
||||
<div class="gdoc-search">
|
||||
<svg class="icon search"><use xlink:href="#search"></use></svg>
|
||||
<input type="text" id="gdoc-search-input" class="gdoc-search__input" placeholder="Search..."
|
||||
aria-label="Search" maxlength="64" />
|
||||
<div class="gdoc-search__spinner spinner hidden"></div>
|
||||
<ul id="gdoc-search-results" class="gdoc-search__list"></ul>
|
||||
</div>
|
||||
{{ end }}
|
8
layouts/partials/site-footer.html
Normal file
8
layouts/partials/site-footer.html
Normal file
|
@ -0,0 +1,8 @@
|
|||
<footer class="gdoc-footer">
|
||||
<div class="container">
|
||||
<div>
|
||||
Build with <a href="https://gohugo.io/" class="gdoc-footer__link">Hugo</a> and
|
||||
<svg class="icon heart"><use xlink:href="#heart"></use></svg>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
14
layouts/partials/site-header.html
Normal file
14
layouts/partials/site-header.html
Normal file
|
@ -0,0 +1,14 @@
|
|||
<header class="gdoc-header">
|
||||
<div class="container flex align-center justify-between">
|
||||
<label for="menu-control" class="gdoc-nav__control">
|
||||
<svg class="icon menu"><use xlink:href="#menu"></use></svg>
|
||||
<svg class="icon arrow-back"><use xlink:href="#arrow_back"></use></svg>
|
||||
</label>
|
||||
<a class="gdoc-header__link" href="{{ .Site.BaseURL }}">
|
||||
<span class="gdoc-brand flex align-center">
|
||||
<img class="gdoc-brand__img" src="{{ "brand.svg" | relURL }}" alt="Branding" width=48 height=48>
|
||||
{{ .Site.Title }}
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</header>
|
1
layouts/partials/svg-icon-symbols.html
Normal file
1
layouts/partials/svg-icon-symbols.html
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 7.5 KiB |
12
layouts/partials/title.html
Normal file
12
layouts/partials/title.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
{{ $title := "" }}
|
||||
|
||||
{{ if .Title }}
|
||||
{{ $title = .Title }}
|
||||
{{ else if and .IsSection .File }}
|
||||
{{ $sections := split (trim .File.Dir "/") "/" }}
|
||||
{{ $title = index ($sections | last 1) 0 | humanize }}
|
||||
{{ else if and .IsPage .File }}
|
||||
{{ $title = .File.BaseFileName | humanize | title }}
|
||||
{{ end }}
|
||||
|
||||
{{ return $title }}
|
Loading…
Add table
Add a link
Reference in a new issue