From 3d3f8b5c32a990e668937e6edfb897c7c03842c4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Joann=20M=C3=B5ndresku?= <joann@cernodile.com> Date: Wed, 21 Sep 2022 20:58:23 +0300 Subject: [PATCH] Based quest initial theme. --- LICENSE | 20 +++++++++++++++++++ archetypes/default.md | 5 +++++ layouts/_default/baseof.html | 4 ++++ layouts/_default/list.html | 8 ++++++++ layouts/_default/single.html | 8 ++++++++ layouts/index.html | 37 ++++++++++++++++++++++++++++++++++++ layouts/partials/footer.html | 2 ++ layouts/partials/header.html | 12 ++++++++++++ layouts/partials/links.html | 2 ++ layouts/partials/tags.html | 13 +++++++++++++ layouts/shortcodes/tags.html | 3 +++ static/bquest.css | 1 + theme.toml | 13 +++++++++++++ 13 files changed, 128 insertions(+) create mode 100644 LICENSE create mode 100644 archetypes/default.md create mode 100644 layouts/_default/baseof.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/footer.html create mode 100644 layouts/partials/header.html create mode 100644 layouts/partials/links.html create mode 100644 layouts/partials/tags.html create mode 100644 layouts/shortcodes/tags.html create mode 100644 static/bquest.css create mode 100644 theme.toml diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..147d594 --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2022 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..26f317f --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,5 @@ +--- +title: "{{ replace .Name "-" " " | title }}" +date: {{ .Date }} +draft: true +--- diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..a9c83cd --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,4 @@ +{{ - partial "header.html" . - }} +<h1>hi</h1> +</body> +</html> diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..d45fa5f --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,8 @@ +{{ partial "header.html" . -}} +<h2>{{.Site.Title}} – Articles for {{.Title}}</h2> +<ul> +{{- range.Pages }} + <li><a href="{{ .RelPermalink }}">{{ .Date.Format "02/01/2006" }} {{.Title}}</a></li> +{{ end -}} +</ul> +{{ partial "footer.html" .}} diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..9072580 --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,8 @@ +{{ partial "header.html" . -}} +<p><a href="{{.Site.BaseURL}}"><-- Back</a></p> +<div id="post"> + <h1>{{.Site.Title }} – {{ .Title }}</h1> + <p class="cern-blue">Posted on {{ .Date.Format "02/01/2006 15:04:05" }}</p> + {{ .Content }} +</div> +{{ partial "footer.html" . }} diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..0495271 --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,37 @@ +{{ partial "header.html" . -}} +<p>> curl {{ .Site.Title }} -v<br> +* Trying 127.0.0.1:80...<br> +* Connected to {{ .Site.Title }} (127.0.0.1) port 80 (#0)<br> +> GET / HTTP 1.1<br> +> Host: based.quest<br> +> User-Agent: curl/b.45.3d<br> +> Accept */*<br> +><br><br></p> +<p>< HTTP/1.1 200 OK<br> +< Server: nginx<br> +< Date: Right now o'clock<br> +< Content-Type: base/based<br> +< Last-Modified: Doesn't need to be modified, is perfect as-is.<br> +< Connection: keep-alive<br><br></p> +<p>based<br><br></p> + +{{ partial "links.html" }} + +<p>Tags: {{ range $name, $taxonomy := .Site.Taxonomies.tags }}<a href="{{ "/tags/" | relLangURL }}{{ $name | urlize }}/">{{ $name }}</a> {{ end }}</p> +{{ range .Pages.GroupBy "Section" "desc"}} +{{ with $.Site.GetPage "section" .Key }} +<h2>{{ .Title }}</h2> +<ul> + {{ range first 5 .Pages }} + <li><a href="{{ .RelPermalink }}">{{ .Date.Format "02/01/2006" }} {{ .Title }}</a></li> + {{ end }} + {{ if gt (len .Pages) 5 }} + <br> + <p><a href="{{ .RelPermalink }}">Read all the posts</a></p> + {{ end }} +</ul> +{{ end }} +{{ end }} + +{{ partial "tags.html" . }} +{{ partial "footer.html" . }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..26e9c59 --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,2 @@ +<p class="cern-blue"><br><br>Join us at Matrix: {{ .Site.Params.Matrix }}</p> +<p class="cern-blue">© 2021 - 2022 {{ .Site.Title }} | Powered by <a href="https://gohugo.io">Hugo</a> | <a href="{{ .Site.Params.Donate }}">Donate</a> | <a href="index.xml">Atom RSS</a></p> diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..558ff53 --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,12 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" +"http://www.w3.org/TR/html4/strict.dtd"> +<html lang="{{ .Site.Language }}"> +<head> + <title>{{ .Site.Title }}</title> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <link rel="stylesheet" type="text/css" href="/bquest.css"> + <meta property="og:title" content="{{.Site.Title}}"> + <meta property="og:description" content="{{ if not .IsHome }}{{ .Description }}{{ else }}{{ .Site.Params.Description }}{{ end }}"> + {{ if .Params.img }}<meta property="og:image" content="{{ .Site.BaseURL }}img/{{ .Params.img }}">{{ end }} +</head> +<body> diff --git a/layouts/partials/links.html b/layouts/partials/links.html new file mode 100644 index 0000000..8e879f5 --- /dev/null +++ b/layouts/partials/links.html @@ -0,0 +1,2 @@ +<p class="cern-blue">Create layouts/partials/links.html to create your own links section here.</p> +<br><br> diff --git a/layouts/partials/tags.html b/layouts/partials/tags.html new file mode 100644 index 0000000..757db6f --- /dev/null +++ b/layouts/partials/tags.html @@ -0,0 +1,13 @@ + {{- if isset .Params "tags" -}} + {{- $tagsLen := len .Params.tags -}} + {{- if gt $tagsLen 0 -}} + <div style="clear:both" class=taglist> + {{- with .Site.Params.relatedtext }}{{ . }}<br>{{ end -}} + {{- range $k, $v := .Params.tags -}} + {{- $url := printf "tags/%s" (. | urlize | lower) -}} + <a id="tag_{{ . | lower }}" href="{{ $url | absURL }}">{{ . | title }}</a> + {{- if lt $k (sub $tagsLen 1) }} · {{ end -}} + {{- end -}} + </div> + {{- end -}} + {{- end }} diff --git a/layouts/shortcodes/tags.html b/layouts/shortcodes/tags.html new file mode 100644 index 0000000..c6c5e02 --- /dev/null +++ b/layouts/shortcodes/tags.html @@ -0,0 +1,3 @@ +{{ if isset .Site.Taxonomies "tags" }}{{ if not (eq (len .Site.Taxonomies.tags) 0) }} <p> + {{ range $name, $items := .Site.Taxonomies.tags }}{{ $url := printf "%s/%s" "tags" ($name | urlize | lower)}}<li><a href="{{ $url | absURL }}" id="tag_{{ $name }}">{{ $name | title }}</a></li> + {{ end }}</p>{{ end }}{{ end }} diff --git a/static/bquest.css b/static/bquest.css new file mode 100644 index 0000000..f640d12 --- /dev/null +++ b/static/bquest.css @@ -0,0 +1 @@ +body,html{background:#000;color:#fff;max-width:1024px;margin:1em auto;padding:0 0.5em;font-family:monospace;font-size:large;}.cern-blue{color:#397ef6;}a,a:visited{color:#fff;}p{margin:0;padding:0}#post p{margin:12px 0;margin:revert;text-align:justify;}#post a,#post a:visited{color:#00b7ff;}pre code {display:block;padding:1em 1em 1em 1em;overflow-x:auto;}code{border:1px solid #ffb300;border-radius:5px;color:#19ca24;background:#202020;display:inline-block;} diff --git a/theme.toml b/theme.toml new file mode 100644 index 0000000..926f0f2 --- /dev/null +++ b/theme.toml @@ -0,0 +1,13 @@ +# theme.toml template for a Hugo theme +# See https://github.com/gohugoio/hugoThemes#themetoml for an example + +name = "bquest" +description = "The theme for based.quest website" +homepage = "https://based.quest/" +tags = ["blog"] +features = [] +min_version = "0.41.0" + +[author] + name = "Joann Mondresku" + homepage = "https://cernodile.com" -- 2.43.0