commit 94f6117c85c88216627fe3de7b6087ec191a1e2c Author: sheychen Date: Mon Jun 10 21:35:13 2019 +0200 Initial commit diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..4e76f50 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,9 @@ +# Released under MIT License + +Copyright (c) 2019 Maelys Bois. + +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. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..8183076 --- /dev/null +++ b/README.md @@ -0,0 +1,142 @@ +# Hydden + +Hydden is a brazen two-column [hugo](https://gohugo.io) theme based on the [Jekyll](http://jekyllrb.com) theme Hyde. +It pairs a prominent sidebar with uncomplicated content. + +## Contents + +- [Hydden](#hydden) + - [Contents](#contents) + - [Installation](#installation) + - [Quick Start](#quick-start) + - [Standard Installation](#standard-installation) + - [Options](#options) + - [Sidebar menu](#sidebar-menu) + - [Sticky sidebar content](#sticky-sidebar-content) + - [Themes](#themes) + - [Reverse layout](#reverse-layout) + - [Comtodon](#comtodon) + - [Authors](#authors) + - [Original By](#original-by) + - [Ported By](#ported-by) + - [Edited By](#edited-by) + - [License](#license) + + +## Installation + +### Quick Start + +To give you a running start this installation puts a fully configured [starter repo](https://github.com/forestryio/hyde-hugo-starter) into your Git account and sets it up in a content manager / CMS. + +_[Forestry](https://forestry.io) Starter-Kit:_ + +[![Import this project into Forestry](https://assets.forestry.io/import-to-forestry.svg)](https://app.forestry.io/quick-start?repo=forestryio/hyde-hugo-starter&provider=github&engine=hugo&version=0.49) + +### Standard Installation + +To install Hyde as your default theme, first install this repository in the `themes/` directory: + + $ cd themes/ + $ git clone https://github.com/spf13/hyde.git + +Second, specify `hydden` as your default theme in the `config.toml` file. Just add the line + + theme = "hydden" + +at the top of the file. + + +## Options + +Hyde includes some customizable options, typically applied via classes on the `` element. + + +### Sidebar menu + +Create a list of nav links in the sidebar by assigning "menu=main" in the front matter. + + +### Sticky sidebar content + +By default Hyde ships with a sidebar that affixes it's content to the bottom of the sidebar. You can optionally disabled this by removing the `.sidebar-sticky` class from the sidebar's `.container`. Sidebar content will then normally flow from top to bottom. + +```html + + + + + +``` + + +### Themes + +Hyde ships with eight optional themes based on the [base16 color scheme](https://github.com/chriskempson/base16). Apply a theme to change the color scheme (mostly applies to sidebar and links). + +There are eight themes available at this time. + +To use a theme, add the `themeColor` variable under `params`, like so: + +**YAML** +```yaml +theme: "hydden" + +params: + themeColor: "theme-base-09" +``` + +To create your own theme, look to the Themes section of [included CSS file](https://github.com/poole/hyde/blob/master/public/css/hyde.css). Copy any existing theme (they're only a few lines of CSS), rename it, and change the provided colors. + +### Reverse layout + +To reverse page orientation, add the `layoutReverse` variable under `params`, like so: + +```yaml +theme: "hydden" + +params: + layoutReverse: true +``` + +## Comtodon + +A minimal commenting system for static blogs using external [Mastodon](https://joinmastodon.org) or API [compatible](https://pleroma.social) server. Open-source and available on [My Git](https://git.wadza.fr/me/comtodon). +It can be enabled by adding your mastodon server domain in the config file: + +```yaml +params: + comtodon: + domain: mastodon.social + # moderator: 358957 +``` + +## Authors +### Original By +**Mark Otto** +- +- + +### Ported By +**Steve Francia** +- +- + +### Edited By +**Maelys Bois** +- +- + +## License + +Open sourced under the [MIT license](LICENSE.md). + +<3 diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 0000000..2e5c062 --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,9 @@ +--- +title: "{{ replace .Name "-" " " | title }}" +date: {{ .Date }} +tags: +categories: +draft: true +#comtodon: +--- + diff --git a/assets/print.sass b/assets/print.sass new file mode 100644 index 0000000..d7e2477 --- /dev/null +++ b/assets/print.sass @@ -0,0 +1,16 @@ +.sidebar + display: none !important + +.content + margin: 0 auto + width: 100% + float: none + display: initial + +.container + width: 100% + float: none + display: initial + padding-left: 1rem + padding-right: 1rem + margin: 0 auto \ No newline at end of file diff --git a/assets/style.sass b/assets/style.sass new file mode 100644 index 0000000..2948a45 --- /dev/null +++ b/assets/style.sass @@ -0,0 +1,411 @@ +$color-head: #313131 +$color-text: #515151 +$color-link: #268bd2 +$color-grey: #9a9a9a +$border-color: #e5e5e5 + +$smaller: .95em + +/* Global */ +@font-face + font-family: "Bitstream Vera Sans" + src: url(vera.ttf) + +@font-face + font-family: "Bitstream Vera Sans Mono" + src: url(vera-mono.ttf) + +* + box-sizing: border-box + +html, body + margin: 0 + padding: 0 + +html + font-family: "Bitstream Vera Sans", "Verdana", "Geneva", sans-serif + font-size: 16px + line-height: 1.5 + +body + color: $color-text + +a + color: $color-link + text-decoration: none + &:hover, &:focus + text-decoration: underline + +em + font-size: $smaller + +/* Headings */ +h1, h2, h3, h4, h5, h6 + margin-bottom: .5rem + font-weight: bold + line-height: 1.25 + color: $color-head + text-rendering: optimizeLegibility + +h1 + font-size: 2rem + +h2 + margin-top: 1rem + font-size: 1.5rem + +h3 + margin-top: 1.5rem + font-size: 1.25rem + +h4, h5, h6 + margin-top: 1rem + font-size: 1rem + +/* Body text */ +p + margin-top: 0 + margin-bottom: 1rem + +strong + color: $color-head + + +/* Lists */ +ul, ol, dl + margin-top: 0 + margin-bottom: 1rem + +dt + font-weight: bold + +dd + margin-bottom: .5rem + + +/* Misc */ +hr + position: relative + margin: 1.5rem 0 + border: 0 + border-top: 1px solid #eee + border-bottom: 1px solid #fff + +abbr + font-size: 85% + font-weight: bold + color: #555 + text-transform: uppercase + &[title] + cursor: help + border-bottom: 1px dotted $border-color + +/* Code */ +code, pre + font-family: "Bitstream Vera Sans Mono", Menlo, Monaco, "Courier New", monospace + +code + padding: .25em .5em + font-size: 85% + color: #bf616a + background-color: #f9f9f9 + border-radius: 3px + +pre + display: block + margin-top: 0 + margin-bottom: 1rem + padding: 1rem + font-size: .8rem + line-height: 1.4 + white-space: pre + white-space: pre-wrap + word-break: break-all + word-wrap: break-word + background-color: #f9f9f9 + +pre code + padding: 0 + font-size: 100% + color: inherit + background-color: transparent + +.highlight + margin-bottom: 1rem + border-radius: 4px + pre + margin-bottom: 0 + + +blockquote + padding: .5rem 1rem + margin: .8rem 0 + color: #7a7a7a + border-left: .25rem solid $border-color + p:last-child + margin-bottom: 0 + @media (min-width: 30em) + padding-right: 5rem + padding-left: 1.25rem + +img + display: block + margin: 0 0 1rem + border-radius: 5px + max-width: 100% + +/* Tables */ +table + margin-bottom: 1rem + width: 100% + border: 1px solid $border-color + border-collapse: collapse + +td, th + padding: .25rem .5rem + border: 1px solid $border-color + +tbody tr:nth-child(odd) td, tbody tr:nth-child(odd) th + background-color: #f9f9f9 + + +/* Custom type */ +.lead + font-size: 1.25rem + font-weight: 300 + +/* Messages */ +.message + margin-bottom: 1rem + padding: 1rem + color: #717171 + background-color: #f9f9f9 + + +/* Container */ +.container + max-width: 45rem + padding-left: 1rem + padding-right: 1rem + margin-left: auto + margin-right: auto + +/* Posts and pages */ +.page, .post + margin-bottom: 4em + +/* Blog post or page title */ +.page-title, .post-title, .post-title a + color: #303030 + +.page-title, .post-title + margin-top: 0 + +.post-content + margin-top: .7rem + +/* Meta data line below post title */ +.post-infos + display: block + margin-bottom: -.4rem + +.post-infos, .post-tags + color: $color-grey + +.post-infos a, .post-tags a, .breadcrumbnav a + color: $color-text + +.meta, .post-tags, .breadcrumbnav, .breadcrumbnav li + display: inline + padding: 0 + +.meta + font-size: 0.8em + +.post-tags a::before + content: "#" + +.breadcrumbnav li:not(:last-child):after + content: '➤' + color: $color-grey + margin: .2em + +/* Table of contents */ +// TODO: float +.toc + font-size: $smaller + a + color: $color-grey + ul + padding-left: 1rem + margin-bottom: 0 + list-style: none + nav>ul + padding: 0 + +/* Comtodon */ +.comtodon + font-size: $smaller + .status + position: relative + .status-content, .reply-main + margin-bottom: .5em + .status-content + border-left: .25rem solid $border-color + padding-left: .5em + &.sensitive + content: 'Sensitive' + .replies + margin-left: 1em + p + margin: .1em + a + text-decoration: none + color: #777 + .emoji + height: 1em + display: inline + margin: 0 + border-radius: 5px + max-width: 100% + .author + display: grid + grid-template-columns: 3.3em auto + grid-template-rows: repeat(3, 1em) + grid-gap: .1em + .avatar + border-radius: 20% + grid-area: 1 / 1 / 4 / 1 + height: 100% + .name + color: black + font-weight: bold + .acct:before + content: '@' + .date + float: right + .reply-main + display: inline-block + color: white + background-color: #777 + border-radius: .5em + padding: .1em .3em + &:after + content: '✉' + margin-left: .5em + .reply + visibility: hidden + position: absolute + right: .1em + top: 2em + &:after + content: '✉' + visibility: visible + display: block + position: absolute + right: 0 + bottom: 0 + color: white + background-color: #777 + border-radius: .5em + font-size: .8em + padding: .1em .3em + +/* Pagination */ +.pagination + a + color: $color-grey + .active a + color: $color-text + .page-item + margin: .2em + display: inline + +/* Sidebar */ +.sidebar + text-align: center + padding: 2rem 1rem + color: rgba(255,255,255,.3) + background-color: #202020 + a + color: white + .sidebar-about + h1 + color: white + margin-top: 0 + font-size: 3rem + img + margin: auto + width: 25vw + + .sidebar-nav + ul + padding-left: 0 + list-style: none + li + display: block + a:hover, a:focus + text-decoration: underline + .active + font-weight: bold + +/* Container */ +.content + padding-top: 3rem + padding-bottom: 3rem + +/* Note */ +.note + display: none + +/* Mobile first */ +@media (min-width: 48em) + html + font-size: 16px + .sidebar + position: fixed // TODO: better height / scroll + top: 0 + left: 0 + bottom: 0 + width: 18rem + text-align: left + .sidebar-about + img + width: auto + .sidebar-sticky + position: absolute + right: 1rem + bottom: 1rem + left: 1rem + .content + max-width: 45rem + margin-left: 20rem + margin-right: 2rem + .layout-reverse + .sidebar + left: auto + right: 0 + .content + margin-left: 2rem + margin-right: 20rem + +@media (min-width: 58em) + html + font-size: 20px + +@media (min-width: 64em) + .content + margin-left: 22rem + margin-right: 4rem + .layout-reverse .content + margin-left: 4rem + margin-right: 22rem + +@media (min-width: 86em) + .note + display: inline-block + float: right + padding-top: 4rem + padding-right: 4rem + .layout-reverse .note + padding-right: 24rem \ No newline at end of file diff --git a/assets/syntax.css b/assets/syntax.css new file mode 100644 index 0000000..ee5b7f2 --- /dev/null +++ b/assets/syntax.css @@ -0,0 +1,66 @@ +.hll { background-color: #ffffcc } + /*{ background: #f0f3f3; }*/ +.c { color: #999; } /* Comment */ +.err { color: #AA0000; background-color: #FFAAAA } /* Error */ +.k { color: #006699; } /* Keyword */ +.o { color: #555555 } /* Operator */ +.cm { color: #0099FF; font-style: italic } /* Comment.Multiline */ +.cp { color: #009999 } /* Comment.Preproc */ +.c1 { color: rgb(51, 150, 64); } /* Comment.Single */ +.cs { color: #999; } /* Comment.Special */ +.gd { background-color: #FFCCCC; border: 1px solid #CC0000 } /* Generic.Deleted */ +.ge { font-style: italic } /* Generic.Emph */ +.gr { color: #FF0000 } /* Generic.Error */ +.gh { color: #003300; } /* Generic.Heading */ +.gi { background-color: #CCFFCC; border: 1px solid #00CC00 } /* Generic.Inserted */ +.go { color: #AAAAAA } /* Generic.Output */ +.gp { color: #000099; } /* Generic.Prompt */ +.gs { } /* Generic.Strong */ +.gu { color: #003300; } /* Generic.Subheading */ +.gt { color: #99CC66 } /* Generic.Traceback */ +.kc { color: #006699; } /* Keyword.Constant */ +.kd { color: #006699; } /* Keyword.Declaration */ +.kn { color: #006699; } /* Keyword.Namespace */ +.kp { color: #006699 } /* Keyword.Pseudo */ +.kr { color: #006699; } /* Keyword.Reserved */ +.kt { color: #007788; } /* Keyword.Type */ +.m { color: #FF6600 } /* Literal.Number */ +.s { color: #d44950 } /* Literal.String */ +.na { color: #4f9fcf } /* Name.Attribute */ +.nb { color: #336666 } /* Name.Builtin */ +.nc { color: #00AA88; } /* Name.Class */ +.no { color: #336600 } /* Name.Constant */ +.nd { color: #9999FF } /* Name.Decorator */ +.ni { color: #999999; } /* Name.Entity */ +.ne { color: #CC0000; } /* Name.Exception */ +.nf { color: #CC00FF } /* Name.Function */ +.nl { color: #9999FF } /* Name.Label */ +.nn { color: #00CCFF; } /* Name.Namespace */ +.nt { color: #2f6f9f; } /* Name.Tag */ +.nv { color: #003333 } /* Name.Variable */ +.ow { color: #000000; } /* Operator.Word */ +.w { color: #bbbbbb } /* Text.Whitespace */ +.mf { color: #FF6600 } /* Literal.Number.Float */ +.mh { color: #FF6600 } /* Literal.Number.Hex */ +.mi { color: #FF6600 } /* Literal.Number.Integer */ +.mo { color: #FF6600 } /* Literal.Number.Oct */ +.sb { color: #CC3300 } /* Literal.String.Backtick */ +.sc { color: #CC3300 } /* Literal.String.Char */ +.sd { color: #CC3300; font-style: italic } /* Literal.String.Doc */ +.s2 { color: #CC3300 } /* Literal.String.Double */ +.se { color: #CC3300; } /* Literal.String.Escape */ +.sh { color: #CC3300 } /* Literal.String.Heredoc */ +.si { color: #AA0000 } /* Literal.String.Interpol */ +.sx { color: #CC3300 } /* Literal.String.Other */ +.sr { color: #33AAAA } /* Literal.String.Regex */ +.s1 { color: #CC3300 } /* Literal.String.Single */ +.ss { color: #FFCC33 } /* Literal.String.Symbol */ +.bp { color: #336666 } /* Name.Builtin.Pseudo */ +.vc { color: #003333 } /* Name.Variable.Class */ +.vg { color: #003333 } /* Name.Variable.Global */ +.vi { color: #003333 } /* Name.Variable.Instance */ +.il { color: #FF6600 } /* Literal.Number.Integer.Long */ + +.css .o, +.css .o + .nt, +.css .nt + .nt { color: #999; } diff --git a/assets/themes.css b/assets/themes.css new file mode 100644 index 0000000..55da8b1 --- /dev/null +++ b/assets/themes.css @@ -0,0 +1,71 @@ +/* Red */ +.theme-base-08 .sidebar { + background-color: #ac4142; +} +.theme-base-08 .content a, +.theme-base-08 .related-posts li a:hover { + color: #ac4142; +} + +/* Orange */ +.theme-base-09 .sidebar { + background-color: #d28445; +} +.theme-base-09 .content a, +.theme-base-09 .related-posts li a:hover { + color: #d28445; +} + +/* Yellow */ +.theme-base-0a .sidebar { + background-color: #f4bf75; +} +.theme-base-0a .content a, +.theme-base-0a .related-posts li a:hover { + color: #f4bf75; +} + +/* Green */ +.theme-base-0b .sidebar { + background-color: #90a959; +} +.theme-base-0b .content a, +.theme-base-0b .related-posts li a:hover { + color: #90a959; +} + +/* Cyan */ +.theme-base-0c .sidebar { + background-color: #75b5aa; +} +.theme-base-0c .content a, +.theme-base-0c .related-posts li a:hover { + color: #75b5aa; +} + +/* Blue */ +.theme-base-0d .sidebar { + background-color: #6a9fb5; +} +.theme-base-0d .content a, +.theme-base-0d .related-posts li a:hover { + color: #6a9fb5; +} + +/* Magenta */ +.theme-base-0e .sidebar { + background-color: #aa759f; +} +.theme-base-0e .content a, +.theme-base-0e .related-posts li a:hover { + color: #aa759f; +} + +/* Brown */ +.theme-base-0f .sidebar { + background-color: #8f5536; +} +.theme-base-0f .content a, +.theme-base-0f .related-posts li a:hover { + color: #8f5536; +} \ No newline at end of file diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..a919514 --- /dev/null +++ b/layouts/404.html @@ -0,0 +1,4 @@ +{{ define "main" -}} +

404: Page not found

+

Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. Head back home to try finding it again.

+{{- end }} \ No newline at end of file diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..171d122 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,11 @@ +{{ partial "head.html" . }} + + {{ partial "sidebar.html" . }} + +
+ {{ block "main" . -}}{{- end }} +
+ + diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..5fdc6ad --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,13 @@ +{{ define "main" -}} +

{{ .Title }}

+{{ .Content }} +
    +{{ range where .Data.Pages ".Params.unlisted" "!=" "true" -}} +
  • + {{ .Title }} + + +
  • +{{- end }} +
+{{- end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..0a7f2b0 --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,44 @@ +{{ define "main" -}} +
+

{{ .Title }}

+ + + + {{ partial "meta.html" . }} + +
+ {{ .Content }} +
+
+ +{{ if .Params.comtodon }} +
+

{{ i18n "comments" }}

+
+
+ +{{- end }} +{{- end }} + +{{ define "note" -}} +{{ if .Params.toc }} + +{{ end }} +{{- end }} \ No newline at end of file diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..59f4c6b --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,40 @@ +{{ define "main" -}} +
+{{ $paginator := .Paginate (where .Data.Pages ".Params.unlisted" "!=" "true") }} +{{ range $paginator.Pages -}} +
+

+ {{ .Title }} +

+ + + {{ partial "meta.html" . }} + +
+ {{ .Summary }} +
+ {{ if .Truncated }} + + {{ end }} +
+{{- end }} +{{ partial "pagination.html" . }} +
+{{- end }} diff --git a/layouts/index.xml b/layouts/index.xml new file mode 100644 index 0000000..dc2fccc --- /dev/null +++ b/layouts/index.xml @@ -0,0 +1,25 @@ + + + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} + {{ .Permalink }} + {{ i18n "recent content" }} {{ if ne .Title .Site.Title }}{{ with .Title }}{{ i18n "in" }} {{.}} {{ end }}{{ end }}{{ i18n "on" }} {{ .Site.Title }} + {{ with .Site.LanguageCode }}{{.}}{{end}} + {{ with .Site.Params.Author }}{{.}}{{end}} + {{ with .Site.Params.Author }}{{.}}{{end}} + {{ with .Site.Params.Copyright }}{{.}}{{end}} + {{ if not .Date.IsZero }}{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} + {{ with .OutputFormats.Get "RSS" }} + {{ printf "" .Permalink .MediaType | safeHTML }} + {{ end }} + {{ range where .Pages ".Params.unlisted" "!=" "true" }} + + {{ .Title }} + {{ .Permalink }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{ with .Site.Params.Author }}{{.}}{{end}} + {{ .Permalink }} + {{ .Summary | html }} + + {{ end }} + + \ No newline at end of file diff --git a/layouts/partials/breadcrumb.html b/layouts/partials/breadcrumb.html new file mode 100644 index 0000000..371e892 --- /dev/null +++ b/layouts/partials/breadcrumb.html @@ -0,0 +1,11 @@ + +{{ define "breadcrumbnav" }} +{{ if .p1.Parent }} +{{ template "breadcrumbnav" (dict "p1" .p1.Parent "p2" .p2 ) }} +{{ end }} +
  • + {{ if .p1.IsHome }}☰{{ else }}{{ .p1.Title }}{{ end }} +
  • +{{ end }} \ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..b7a198c --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,34 @@ + + + + + + + + + + {{ if .IsHome -}} + {{ .Site.Title }} + {{- else -}} + {{ .Title }} · {{ .Site.Title }} + {{- end }} + + + + + + + + + + + + {{ range .AlternativeOutputFormats -}} + {{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} + {{ end -}} + {{ if .IsTranslated }} + {{ range .AllTranslations }} + + {{ end }} + {{ end }} + diff --git a/layouts/partials/meta.html b/layouts/partials/meta.html new file mode 100644 index 0000000..34657ba --- /dev/null +++ b/layouts/partials/meta.html @@ -0,0 +1,16 @@ +
    + {{ partial "breadcrumb.html" .Parent }} + {{ with .Params.tags }} + {{ $total := len . }} + {{ if gt $total 0 }} +  –  + + {{ end }} + {{ end }} +
    \ No newline at end of file diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html new file mode 100644 index 0000000..96412c4 --- /dev/null +++ b/layouts/partials/pagination.html @@ -0,0 +1,51 @@ +{{ $pag := $.Paginator }} +{{ if gt $pag.TotalPages 1 }} +
      + {{ if gt $pag.PageNumber 2 }} + {{ with $pag.First }} +
    • + +
    • + {{ end }} + {{ end }} + {{ if $pag.HasPrev }} +
    • + +
    • + {{ end }} + + {{ $ellipsed := false }} + {{ $shouldEllipse := false }} + {{ range $pag.Pagers }} + {{ $right := sub .TotalPages .PageNumber }} + {{ $showNumber := or (le .PageNumber 3) (eq $right 0) }} + {{ $showNumber := or $showNumber (and (gt .PageNumber (sub $pag.PageNumber 2)) (lt .PageNumber (add $pag.PageNumber 2))) }} + {{ if $showNumber }} + {{ $ellipsed = false }} + {{ $shouldEllipse = false }} + {{ else }} + {{ $shouldEllipse = not $ellipsed }} + {{ $ellipsed = true }} + {{ end }} + {{ if $showNumber }} +
    • {{ .PageNumber }} +
    • + {{ else if $shouldEllipse }} +
    • + {{ end }} + {{ end }} + + {{ if $pag.HasNext }} +
    • + +
    • + {{ end }} + {{ if lt $pag.PageNumber (sub $pag.TotalPages 2) }} + {{ with $pag.Last }} +
    • + +
    • + {{ end }} + {{ end }} +
    +{{ end }} \ No newline at end of file diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html new file mode 100644 index 0000000..4273857 --- /dev/null +++ b/layouts/partials/sidebar.html @@ -0,0 +1,37 @@ + diff --git a/static/apple-touch-icon-144-precomposed.png b/static/apple-touch-icon-144-precomposed.png new file mode 100644 index 0000000..19323de Binary files /dev/null and b/static/apple-touch-icon-144-precomposed.png differ diff --git a/static/comtodon.min.js b/static/comtodon.min.js new file mode 100644 index 0000000..ffccc89 --- /dev/null +++ b/static/comtodon.min.js @@ -0,0 +1 @@ +(function(){function a(a,b){a.innerHTML="Loading fail =(",console.error(b,a)}function b(b,c){const d=b.dataset[c];return d?d:void a(b,`Missing data-${c} attribut`)}function c(a,b,c="div"){return`<${c} class="${a}">${b}`}function d(a){const b=Date.now(),c=+new Date(a),d=c>b?"in ":"",e=Math.floor(Math.abs(c-b));let f=0,g=1,h="millisecond";for(const b of i){g*=b[1];const a=Math.floor(e/g);if(0>=a)return`${d}${f} ${h}${1`);return a}function f(a,b,c){const[d,e]=a.reduce(([a,c],d)=>d.in_reply_to_id==b.id?[[...a,d],c]:[a,[...c,d]],[[],[]]);return b.replies=c?d.map(a=>f(e,a,c-1)):[],b}function g(a,b){return a.map(({account:a,created_at:f,content:h,id:i,emojis:j,sensitive:k,spoiler_text:l,replies:m})=>c("status",c("date",d(f),"p")+c("author\" target=\"_blank\" href=\""+a.url,``+c("name",e(a.display_name,a.emojis),"span")+c("acct",a.acct,"span"),"a")+(l||k?c("spoiler",l||c("spoiler-empty","Sensitive","span")):"")+c("status-content"+(l||k?" sensitive":""),e(h,j))+(m?c("replies",g(m,b)):"")+c(`reply" target="_blank" href="https://${b}/interact/${i}?type=reply`,"Reply","a"))).join("")}function h(a,b){if(!b)return a;const c=a.filter(a=>a.account.id==b).map(a=>a.in_reply_to_id);return a.filter(a=>c.includes(a.id))}const i=new Map([["second",1e3],["minute",60],["hour",60],["day",24],["month",30.5],["year",12],["century",100]]);for(const d of document.getElementsByClassName("comtodon")){d.innerHTML="
    Loading...
    ";const e=b(d,"domain"),i=b(d,"status");if(!e||!i)return;fetch(`https://${e}/api/v1/statuses/${i}/context`).then(a=>a.json()).then(a=>{d.innerHTML=c(`reply-main" target="_blank" href="https://${e}/interact/${i}?type=reply`,"Comment","a");const b=h(a.descendants,d.dataset.moderator);d.innerHTML+=b?g("deep"in d.dataset?f(b,{id:i},d.dataset.deep||-1).replies:b,e):c("empty","Any comment")}).catch(()=>a(d,"Request fail"))}})(); \ No newline at end of file diff --git a/static/favicon.png b/static/favicon.png new file mode 100644 index 0000000..84cce4d Binary files /dev/null and b/static/favicon.png differ diff --git a/static/vera-mono.ttf b/static/vera-mono.ttf new file mode 100644 index 0000000..139f0b4 Binary files /dev/null and b/static/vera-mono.ttf differ diff --git a/static/vera.ttf b/static/vera.ttf new file mode 100755 index 0000000..58cd6b5 Binary files /dev/null and b/static/vera.ttf differ diff --git a/theme.toml b/theme.toml new file mode 100644 index 0000000..ef19024 --- /dev/null +++ b/theme.toml @@ -0,0 +1,14 @@ +name = "Hydden" +license = "MIT" +description = "An elegant open source and mobile first theme" +tags = ["blog", "personal"] +features = ["blog", "themes", "comtodon"] +min_version = 0.43 + +[author] + name = "shu" + homepage = "https://wut.wadza.fr" + +[original] + name = "spf13" + homepage = "http://spf13.com"