summaryrefslogtreecommitdiffstats
path: root/docs/layouts
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-10-20 09:43:56 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-10-20 09:43:56 +0200
commite2dd4cd05fa96a08d49b3b198edf0ccf9a94970e (patch)
tree712334f7e7a657155706f556040575bea9b7757f /docs/layouts
parentfd381718101a35a5f5f92d5a05b3a0c36ef50db0 (diff)
parente509cac533600cf4fa8382c9cdab78ddd82db688 (diff)
Diffstat (limited to 'docs/layouts')
-rw-r--r--docs/layouts/_default/page.html34
-rw-r--r--docs/layouts/partials/docs/functions-aliases.html12
-rw-r--r--docs/layouts/partials/docs/functions-signatures.html12
-rw-r--r--docs/layouts/partials/related.html17
4 files changed, 75 insertions, 0 deletions
diff --git a/docs/layouts/_default/page.html b/docs/layouts/_default/page.html
new file mode 100644
index 000000000..2435e3ed7
--- /dev/null
+++ b/docs/layouts/_default/page.html
@@ -0,0 +1,34 @@
+<header class="flex-none w-100">
+ {{ if .Params.categories }}
+ {{ range .Params.categories }}
+ <a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}" class="f6 fw8 mb0 link mid-gray dim mr3">
+ {{ humanize . | upper }}
+ </a>
+ {{ end }}
+ {{end}}
+ <h1 class="lh-title mb3 mv0 pt3 primary-color-dark">
+ {{ .Title }}
+ </h1>
+</header>
+
+<aside class="bt bw1 pt3 mt2 mid-gray b--mid-gray fn w-100">
+ {{ with .Params.description }}
+ <div class="f4 fw4 lh-copy">
+ {{ . | markdownify }}
+ </div>
+ {{ end }}
+
+ <!--
+ NOTE: Removed to test builds without it.
+ partial "components/author-github-data" (dict "context" . "size" "110") -->
+</aside>
+
+{{ with .Params.featured_image_path }}
+ <img src="{{ . }}" alt="Featured Image for {{ $.Title }}" class="mw-100">
+{{ end }}
+
+<div class="prose prose-{{ .Type }}" id="prose">
+ {{- partial "docs/functions-signatures.html" . -}}
+ {{- partial "docs/functions-aliases.html" . -}}
+ {{ .Content }}
+</div>
diff --git a/docs/layouts/partials/docs/functions-aliases.html b/docs/layouts/partials/docs/functions-aliases.html
new file mode 100644
index 000000000..b0ba9be02
--- /dev/null
+++ b/docs/layouts/partials/docs/functions-aliases.html
@@ -0,0 +1,12 @@
+{{- with .Params.function.aliases }}
+ {{- $label := "Alias" }}
+ {{- if gt (len .) 1 }}
+ {{- $label = "Aliases" }}
+ {{- end }}
+ <h2 class="minor mb1 primary-color-dark">{{ $label }}</h2>
+ {{- range . }}
+ <pre class="f5 mb4 ph3 pv2 bg-light-gray" style="border-left:4px solid #0594CB;">
+ {{- . -}}
+ </pre>
+ {{- end }}
+{{- end -}}
diff --git a/docs/layouts/partials/docs/functions-signatures.html b/docs/layouts/partials/docs/functions-signatures.html
new file mode 100644
index 000000000..07c9cb768
--- /dev/null
+++ b/docs/layouts/partials/docs/functions-signatures.html
@@ -0,0 +1,12 @@
+{{- with .Params.function.signatures }}
+ <h2 class="minor mb1 pt4 primary-color-dark">Syntax</h2>
+ {{- range . }}
+ {{- $signature := . }}
+ {{- if $.Params.function.returnType }}
+ {{- $signature = printf "%s ⟼ %s" . $.Params.function.returnType }}
+ {{- end }}
+ <pre class="f5 mb4 ph3 pv2 bg-light-gray" style="border-left:4px solid #0594CB;">
+ {{- $signature -}}
+ </pre>
+ {{- end }}
+{{- end -}}
diff --git a/docs/layouts/partials/related.html b/docs/layouts/partials/related.html
new file mode 100644
index 000000000..05a2e9160
--- /dev/null
+++ b/docs/layouts/partials/related.html
@@ -0,0 +1,17 @@
+{{- $heading := "See also" }}
+{{- $related := site.RegularPages.Related . | first 5 }}
+
+{{- if eq .Type "functions" }}
+ {{- $heading = "Related functions" }}
+ {{- $opts := dict "document" . "indices" (slice "relatedFunctions") }}
+ {{- $related = site.RegularPages.Related $opts | first 7 }}
+{{- end }}
+
+{{- with $related }}
+ <h2>{{ $heading }}</h2>
+ <ul>
+ {{- range . }}
+ <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
+ {{- end }}
+ </ul>
+{{- end }}