Initial Hugo site

This commit is contained in:
Andrew Godwin 2022-11-19 09:46:56 -07:00
parent 17d1b55804
commit 69ef024975
34 changed files with 1318 additions and 0 deletions

31
.github/workflows/gh-pages.yml vendored Normal file
View File

@ -0,0 +1,31 @@
name: GitHub Pages
on:
push:
branches:
- main
pull_request:
jobs:
deploy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "latest"
# extended: true
- name: Build
run: hugo --minify
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public

13
.gitignore vendored Normal file
View File

@ -0,0 +1,13 @@
# Generated files by hugo
/public/
/resources/_gen/
/assets/jsconfig.json
hugo_stats.json
# Executable may be added to repository
hugo.exe
hugo.darwin
hugo.linux
# Temporary lock file while building
/.hugo_build.lock

6
archetypes/default.md Normal file
View File

@ -0,0 +1,6 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
---

61
config.toml Normal file
View File

@ -0,0 +1,61 @@
baseURL = "http://jointakahe.org/"
languageCode = "en-us"
title = "Takahē"
theme = "cayman"
# Syntax highlighting
pygmentsCodefences = true
pygmentsStyle = "pygments"
[params]
# Header text, can be markdown
project_name = "Takahē"
project_tagline = "An efficient ActivityPub Server, for small installs with multiple domains"
# Date format for post list and single pages
# For more date formats see https://gohugo.io/functions/format/
dateFormat = "2006-01-02"
# Footer text, can be markdown
footer = "Theme based on [Cayman](https://github.com/zwbetz-gh/cayman-hugo-theme)"
# If true, the CSS/JS for Katex math typesetting are enabled
katex = true
# Breakpoints
large_breakpoint = "64em"
medium_breakpoint = "42em"
# Header colors
header_heading_color = "#fff"
header_background_color = "#26323c"
header_background_color_secondary = "#27343e"
# Text colors
section_headings_color = "#159957"
body_text_color = "#606c71"
body_link_color = "#1e6bb8"
blockquote_text_color = "#819198"
# Code colors
code_background_color = "#f3f6fa"
code_text_color = "#567482"
# Border colors
border_color = "#dce6f0"
table_border_color = "#e9ebec"
hr_border_color = "#eff0f1"
[menu]
[[menu.nav]]
name = "GitHub"
url = "https://github.com/andrewgodwin/takahe"
weight = 1
[[menu.nav]]
name = "About"
url = "/about/"
weight = 3
[[menu.nav]]
name = "takahe.social"
url = "https://takahe.social"
weight = 4

15
content/_index.md Normal file
View File

@ -0,0 +1,15 @@
---
title: Welcome
---
Takahē is a new ActivityPub server, designed for efficient use on *small- to*
*medium-size* installations, and which allows you to host *multiple domains* on
the same infrastructure.
It's currently in an alpha state, meaning things work (and it will talk
ActivityPub to Mastodon and other servers), but there's still a lot of features
left to add.
The flagship instance can be found at [takahe.social](http://takahe.social),
and if you're interested, you can also [read more about the project](/about/),
or read some of [Andrew's blogs on building it](https://aeracode.org/category/takahe).

35
content/about/index.md Normal file
View File

@ -0,0 +1,35 @@
---
title: About Takahē
---
Takahē is an ActivityPub server focused on microblogging, much like Mastodon,
Pleroma, and others. Our goals are:
* Allowing multiple domains on the same server ("virtual hosting")
* Efficient, stable background tasks via asynchronous state machines
* A default fast, low-JavaScript web interface
* Mastodon Client API compatibility (eventually!)
## Why start another server?
The main motivation was to prove two things - that virtual hosting of multiple
domains on a single ActivityPub server was possible (so you don't need
to run a whole new server for every person or organisation that brings their
own domain), and to explore the use of Python's asynchronous libraries to
speed up the large amount of background work ActivityPub involves.
Fortunately, both of those have proved themselves to work well in the initial
build-out phase, and so now development is focused towards a small, reliable,
stable release.
While we do not expect to grow as large and featureful as Mastodon, the goal
is to provide a smaller, lighter-weight server that is useful for small- to
medium-size instances. The architecture we've chosen is deliberately easy to
run and maintain but will not scale to a large install, and that's fine.
## More Insight
Takahē is, so far, mostly authored by [Andrew Godwin](https://aeracode.org/),
and you can read more about its development, choices made, and progress via
[my blog posts](https://aeracode.org/category/takahe).

6
content/posts/welcome.md Normal file
View File

@ -0,0 +1,6 @@
---
title: "Welcome"
date: 2022-11-19T08:51:26-07:00
---
Hello!

View File

@ -0,0 +1 @@
{"subject": "acct:takahe@jointakahe.org", "aliases": ["https://jointakahe.takahe.social/@takahe/"], "links": [{"rel": "http://webfinger.net/rel/profile-page", "type": "text/html", "href": "https://jointakahe.takahe.social/@takahe/"}, {"rel": "self", "type": "application/activity+json", "href": "https://jointakahe.takahe.social/@takahe@jointakahe.org/"}]}

BIN
static/logo-1024.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 728 KiB

145
static/logo.svg Normal file
View File

@ -0,0 +1,145 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="4000"
height="1024"
viewBox="0 0 1058.3333 270.93333"
version="1.1"
id="svg5"
xml:space="preserve"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
sodipodi:docname="logo.svg"
inkscape:export-filename="logo-1024.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
id="namedview7"
pagecolor="#4a4a4a"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="0.2102413"
inkscape:cx="1885.9282"
inkscape:cy="64.211932"
inkscape:current-layer="layer1"><inkscape:grid
type="xygrid"
id="grid111"
originx="0"
originy="0" /></sodipodi:namedview><defs
id="defs2"><linearGradient
inkscape:collect="always"
id="linearGradient19130"><stop
style="stop-color:#dfd69b;stop-opacity:1;"
offset="0"
id="stop19126" /><stop
style="stop-color:#d2c572;stop-opacity:1;"
offset="1"
id="stop19128" /></linearGradient><linearGradient
inkscape:collect="always"
id="linearGradient19122"><stop
style="stop-color:#f05328;stop-opacity:1;"
offset="0"
id="stop19118" /><stop
style="stop-color:#cf370f;stop-opacity:1;"
offset="1"
id="stop19120" /></linearGradient><linearGradient
inkscape:collect="always"
id="linearGradient19114"><stop
style="stop-color:#006aaa;stop-opacity:1;"
offset="0"
id="stop19110" /><stop
style="stop-color:#005487;stop-opacity:1;"
offset="1"
id="stop19112" /></linearGradient><linearGradient
inkscape:collect="always"
id="linearGradient181"><stop
style="stop-color:#133e4b;stop-opacity:1;"
offset="0"
id="stop177" /><stop
style="stop-color:#0c2b3d;stop-opacity:1;"
offset="1"
id="stop179" /></linearGradient><linearGradient
inkscape:collect="always"
xlink:href="#linearGradient181"
id="linearGradient183"
x1="250.75105"
y1="19.506355"
x2="20.450212"
y2="248.54874"
gradientUnits="userSpaceOnUse" /><linearGradient
inkscape:collect="always"
xlink:href="#linearGradient19114"
id="linearGradient19116"
x1="72.969826"
y1="73.859703"
x2="25.361464"
y2="257.17413"
gradientUnits="userSpaceOnUse" /><linearGradient
inkscape:collect="always"
xlink:href="#linearGradient19122"
id="linearGradient19124"
x1="149.05421"
y1="68.965385"
x2="138.3757"
y2="127.25226"
gradientUnits="userSpaceOnUse" /><linearGradient
inkscape:collect="always"
xlink:href="#linearGradient19130"
id="linearGradient19132"
x1="170.85617"
y1="146.82953"
x2="201.5569"
y2="188.65369"
gradientUnits="userSpaceOnUse" /></defs><g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"><rect
style="fill:url(#linearGradient183);fill-opacity:1;stroke-width:0.264583"
id="rect115"
width="270.93332"
height="270.93332"
x="0"
y="0"
rx="33.866665" /><path
style="opacity:1;fill:url(#linearGradient19116);fill-opacity:1;stroke-width:0.264583"
d="m 0,69.41032 c 0,0 15.97341,-15.642206 48.0533,-21.973129 34.750862,-6.858036 65.71908,-10e-7 65.71908,-10e-7 l 29.94258,29.982012 -1.77975,90.322408 c 0,0 20.77918,34.00148 8.1347,35.37354 -26.69628,2.89682 -33.27837,33.1808 -28.04801,50.49948 5.23035,17.31867 4.34048,17.3187 4.34048,17.3187 L 0,270.9333 Z"
id="path18329"
sodipodi:nodetypes="cscccssccc" /><path
style="fill:url(#linearGradient19124);fill-opacity:1;stroke-width:0.264583"
d="m 113.77238,47.437191 c 0,0 14.85651,51.896699 13.28342,78.010049 -1.5731,26.11334 -5.0339,27.68645 -5.0339,27.68645 l 73.1442,-51.48951 C 179.27554,82.720765 145.61903,53.85498 113.77238,47.437191 Z"
id="path12139"
sodipodi:nodetypes="csccc" /><path
style="opacity:1;fill:url(#linearGradient19132);fill-opacity:1;stroke-width:0.264583"
d="m 122.0219,153.13369 73.1442,-51.48951 c 0,0 17.14886,15.4811 33.97498,41.63762 16.02811,24.91601 28.61719,57.75025 28.61719,57.75025 0,0 -36.26795,-3.41078 -67.93143,-3.01587 -46.29774,0.57743 -66.45321,7.99579 -66.45321,7.99579 -9.60125,-22.07547 -9.60125,-30.80281 -1.35173,-52.87828 z"
id="path13694"
sodipodi:nodetypes="ccscscc" /><circle
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke-width:0.264583"
id="path18331"
cx="94.10437"
cy="131.92412"
r="17.130112" /><text
xml:space="preserve"
style="font-size:235.683px;font-family:NeoSans;-inkscape-font-specification:NeoSans;opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:50.5034;stroke-dasharray:none;stroke-opacity:1"
x="321.39691"
y="221.27396"
id="text20770"><tspan
sodipodi:role="line"
id="tspan20768"
style="font-style:normal;font-variant:normal;font-weight:200;font-stretch:normal;font-family:Raleway;-inkscape-font-specification:'Raleway Ultra-Light';fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:50.5034"
x="321.39691"
y="221.27396">takahē</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:200;font-stretch:normal;font-family:Raleway;-inkscape-font-specification:'Raleway Ultra-Light';fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:50.5034"
x="321.39691"
y="515.87769"
id="tspan20874" /></text></g></svg>

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

@ -0,0 +1,6 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
tags: []
---

View File

@ -0,0 +1,376 @@
// Breakpoints
$large-breakpoint: {{ $.Site.Params.large_breakpoint | default "64em" }} !default;
$medium-breakpoint: {{ $.Site.Params.medium_breakpoint | default "42em" }} !default;
// Headers
$header-heading-color: {{ $.Site.Params.header_heading_color | default "#fff" }} !default;
$header-bg-color: {{ $.Site.Params.header_background_color | default "#159957" }} !default;
$header-bg-color-secondary: {{ $.Site.Params.header_background_color_secondary | default "#155799" }} !default;
// Text
$section-headings-color: {{ $.Site.Params.section_headings_color | default "#159957" }} !default;
$body-text-color: {{ $.Site.Params.body_text_color | default "#606c71" }} !default;
$body-link-color: {{ $.Site.Params.body_link_color | default "#1e6bb8" }} !default;
$blockquote-text-color: {{ $.Site.Params.blockquote_text_color | default "#819198" }} !default;
// Code
$code-bg-color: {{ $.Site.Params.code_background_color | default "#f3f6fa" }} !default;
$code-text-color: {{ $.Site.Params.code_text_color | default "#567482" }} !default;
// Borders
$border-color: {{ $.Site.Params.border_color | default "#dce6f0" }} !default;
$table-border-color: {{ $.Site.Params.table_border_color | default "#e9ebec" }} !default;
$hr-border-color: {{ $.Site.Params.hr_border_color | default "#eff0f1" }} !default;
@mixin large {
@media screen and (min-width: #{$large-breakpoint}) {
@content;
}
}
@mixin medium {
@media screen and (min-width: #{$medium-breakpoint}) and (max-width: #{$large-breakpoint}) {
@content;
}
}
@mixin small {
@media screen and (max-width: #{$medium-breakpoint}) {
@content;
}
}
* {
box-sizing: border-box;
}
body {
padding: 0;
margin: 0;
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 16px;
line-height: 1.5;
color: $body-text-color;
}
a {
color: $body-link-color;
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
.btn {
display: inline-block;
margin-bottom: 1rem;
color: rgba(255, 255, 255, 0.7);
background-color: rgba(255, 255, 255, 0.08);
border-color: rgba(255, 255, 255, 0.2);
border-style: solid;
border-width: 1px;
border-radius: 0.3rem;
transition: color 0.2s, background-color 0.2s, border-color 0.2s;
&:hover {
color: rgba(255, 255, 255, 0.8);
text-decoration: none;
background-color: rgba(255, 255, 255, 0.2);
border-color: rgba(255, 255, 255, 0.3);
}
+ .btn {
margin-left: 1rem;
}
@include large {
padding: 0.75rem 1rem;
}
@include medium {
padding: 0.6rem 0.9rem;
font-size: 0.9rem;
}
@include small {
padding: 0.75rem;
font-size: 0.9rem;
}
}
.page-header {
color: $header-heading-color;
text-align: center;
background-color: $header-bg-color;
background-image: linear-gradient(120deg, $header-bg-color-secondary, $header-bg-color);
@include large {
padding: 5rem 6rem;
}
@include medium {
padding: 3rem 4rem;
}
@include small {
padding: 2rem 1rem;
}
}
.project-name {
margin-top: 0;
margin-bottom: 0.1rem;
@include large {
font-size: 3.25rem;
}
@include medium {
font-size: 2.25rem;
}
@include small {
font-size: 1.75rem;
}
}
.project-name img {
@include large {
max-width: 600px;
}
@include medium {
max-width: 400px;
}
@include small {
max-width: 400px;
}
}
.project-tagline {
margin-bottom: 2rem;
font-weight: normal;
opacity: 0.7;
@include large {
font-size: 1.25rem;
}
@include medium {
font-size: 1.15rem;
}
@include small {
font-size: 1rem;
}
}
.main-content {
word-wrap: break-word;
:first-child {
margin-top: 0;
}
@include large {
max-width: 64rem;
padding: 2rem 6rem;
margin: 0 auto;
font-size: 1.1rem;
}
@include medium {
padding: 2rem 4rem;
font-size: 1.1rem;
}
@include small {
padding: 2rem 1rem;
font-size: 1rem;
}
img {
max-width: 100%;
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin-top: 2rem;
margin-bottom: 1rem;
font-weight: normal;
color: $section-headings-color;
}
p {
margin-bottom: 1em;
}
code {
padding: 2px 4px;
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
font-size: 0.9em;
color: $code-text-color;
background-color: $code-bg-color;
border-radius: 0.3rem;
}
pre {
padding: 0.8rem;
margin-top: 0;
margin-bottom: 1rem;
font: 1rem Consolas, "Liberation Mono", Menlo, Courier, monospace;
color: $code-text-color;
word-wrap: normal;
background-color: $code-bg-color;
border: solid 1px $border-color;
border-radius: 0.3rem;
> code {
padding: 0;
margin: 0;
font-size: 0.9rem;
color: $code-text-color;
word-break: normal;
white-space: pre;
background: transparent;
border: 0;
}
}
.highlight {
margin-bottom: 1rem;
pre {
margin-bottom: 0;
word-break: normal;
}
}
.highlight pre,
pre {
padding: 0.8rem;
overflow: auto;
font-size: 0.9rem;
line-height: 1.45;
border-radius: 0.3rem;
-webkit-overflow-scrolling: touch;
}
pre code,
pre tt {
display: inline;
max-width: initial;
padding: 0;
margin: 0;
overflow: initial;
line-height: inherit;
word-wrap: normal;
background-color: transparent;
border: 0;
&:before,
&:after {
content: normal;
}
}
ul,
ol {
margin-top: 0;
}
blockquote {
padding: 0 1rem;
margin-left: 0;
color: $blockquote-text-color;
border-left: 0.3rem solid $border-color;
> :first-child {
margin-top: 0;
}
> :last-child {
margin-bottom: 0;
}
}
table {
display: block;
width: 100%;
overflow: auto;
word-break: normal;
word-break: keep-all; // For Firefox to horizontally scroll wider tables.
-webkit-overflow-scrolling: touch;
th {
font-weight: bold;
}
th,
td {
padding: 0.5rem 1rem;
border: 1px solid $table-border-color;
}
}
dl {
padding: 0;
dt {
padding: 0;
margin-top: 1rem;
font-size: 1rem;
font-weight: bold;
}
dd {
padding: 0;
margin-bottom: 1rem;
}
}
hr {
height: 2px;
padding: 0;
margin: 1rem 0;
background-color: $hr-border-color;
border: 0;
}
}
.site-footer {
padding-top: 2rem;
margin-top: 2rem;
border-top: solid 1px $hr-border-color;
@include large {
font-size: 1rem;
}
@include medium {
font-size: 1rem;
}
@include small {
font-size: 0.9rem;
}
}
.site-footer {
text-align: center;
}
.site-footer-credits {
color: #ddd;
}
.site-footer-credits a {
color: #bbd;
}

View File

View File

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="{{ .Site.Language.Lang }}">
{{ partial "head.html" . }}
<body>
{{ partial "header-nav.html" . }}
<section class="main-content">
{{ block "main" . }}{{ end }}
{{ partial "footer.html" . }}
</section>
{{ partial "google-analytics-async.html" . }}
</body>
</html>

View File

@ -0,0 +1,15 @@
{{ define "main" }}
<h1>{{ .Title }}</h1>
<ul>
{{ $pages := .Pages }}
{{ range $pages.ByPublishDate.Reverse }}
<li>
{{ $dateFormat := $.Site.Params.dateFormat | default "Jan 2, 2006" }}
{{ .PublishDate.Format $dateFormat }}
<a href="{{ .Permalink }}">
{{ .Title }}
</a>
</li>
{{ end }}
</ul>
{{ end }}

View File

@ -0,0 +1,4 @@
{{ define "main" }}
<h1>{{ .Title }}</h1>
{{ .Content }}
{{ end }}

View File

@ -0,0 +1,13 @@
{{ define "main" }}
<h1>{{ .Title }}</h1>
<ul>
{{ range .Data.Terms.Alphabetical }}
<li>
{{ printf "(%d)" .Count }}
<a href="{{ .Page.RelPermalink }}">
{{ .Page.Title }}
</a>
</li>
{{ end }}
</ul>
{{ end }}

View File

@ -0,0 +1,3 @@
{{ define "main" }}
{{ .Content }}
{{ end }}

View File

@ -0,0 +1,13 @@
<h1>{{ .Title }}</h1>
<ul>
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
{{ range $pages.ByPublishDate.Reverse }}
<li>
{{ $dateFormat := $.Site.Params.dateFormat | default "Jan 2, 2006" }}
{{ .PublishDate.Format $dateFormat }}
<a href="{{ .Permalink }}">
{{ .Title }}
</a>
</li>
{{ end }}
</ul>

View File

@ -0,0 +1,6 @@
{{ $ctx := . }}
{{ with $.Site.DisqusShortname }}
{{ if ne . "yourdiscussshortname" }}
{{ template "_internal/disqus.html" $ctx }}
{{ end }}
{{ end }}

View File

@ -0,0 +1,5 @@
<footer class="site-footer">
<span class="site-footer-credits">
{{ $.Site.Params.footer | markdownify }}
</span>
</footer>

View File

@ -0,0 +1,10 @@
{{ if not $.Site.IsServer }}
{{ with $.Site.GoogleAnalytics }}
<script>
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', '{{ . }}', 'auto');
ga('send', 'pageview');
</script>
<script async src='https://www.google-analytics.com/analytics.js'></script>
{{ end }}
{{ end }}

View File

@ -0,0 +1,22 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
{{ hugo.Generator }}
{{ $summary := trim (.Summary | plainify | htmlUnescape) "\n\r"
| default .Title }}
<meta name="description" content="{{ $summary }}">
<link rel="stylesheet" href="{{ "css/normalize.css" | absURL }}">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
{{ $caymanScss := "scss/cayman.scss" }}
{{ $options := (dict "targetPath" "css/cayman.css") }}
{{ $caymanCss := resources.Get $caymanScss | resources.ExecuteAsTemplate $caymanScss . | toCSS $options | fingerprint }}
<link rel="stylesheet" href="{{ $caymanCss.Permalink }}">
<!-- Icon made by Freepik, from Flaticon, licensed by CC 3.0. -->
<!-- https://www.flaticon.com/free-icon/island_1530732 -->
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
{{ partial "katex.html" . }}
<title>{{ .Title }} | {{ $.Site.Title }}</title>
</head>

View File

@ -0,0 +1,18 @@
<section class="page-header">
<h1 class="project-name">
<img src="/logo-1024.png" alt="Takahe logo" class="logo">
</h1>
<h2 class="project-tagline">
{{ $.Site.Params.project_tagline | default "project_tagline goes here" | markdownify }}
</h2>
<nav>
{{ $current := . }}
{{ range .Site.Menus.nav }}
{{ $active := or ($current.IsMenuCurrent "nav" .) ($current.HasMenuCurrent "nav" .) }}
{{ $active = or $active (eq .Name $current.Title) }}
{{ $active = or $active (and (eq .Name "Blog") (eq $current.Section "post")) }}
{{ $active = or $active (and (eq .Name "Tags") (eq $current.Section "tags")) }}
<a href="{{ .URL }}" class="btn">{{ .Name }}</a>
{{ end }}
</nav>
</section>

View File

@ -0,0 +1,5 @@
{{ if eq $.Site.Params.katex true }}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.css" integrity="sha384-yFRtMMDnQtDRO8rLpMIKrtPCD5jdktao2TV19YiZYWMDkUR5GQZR/NOVTdquEx1j" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.js" integrity="sha384-9Nhn55MVVN0/4OFx7EE5kpFBPsEMZxKTCnA+4fqDmg12eCTqGi6+BB2LjY8brQxJ" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script>
{{ end }}

View File

@ -0,0 +1,21 @@
{{ define "main" }}
<h1>{{ .Title }}</h1>
<div>
{{ $dateFormat := $.Site.Params.dateFormat | default "Jan 2, 2006" }}
<strong>Publish date: </strong>{{ .PublishDate.Format $dateFormat }}
</div>
{{ $tags := slice }}
{{ with .Params.tags }}
<div>
<strong>Tags: </strong>
{{ range . }}
{{ $href := print ("tags/" | absLangURL) (. | urlize) "/" }}
{{ $element := printf "<a href=\"%s\">%s</a>" $href . }}
{{ $tags = $tags | append $element }}
{{ end }}
{{ delimit $tags ", " }}
</div>
{{ end }}
{{ .Content }}
{{ partial "disqus.html" . }}
{{ end }}

View File

@ -0,0 +1,30 @@
{{ $img := .Get "img" }}
{{ $caption := .Get "caption" }}
{{ $command := .Get "command" }}
{{ $options := .Get "options" }}
{{ $original := .Page.Resources.GetMatch (printf "*%s*" $img) }}
{{ $new := "" }}
{{ if eq $command "Fit" }}
{{ $new = $original.Fit $options }}
{{ else if eq $command "Fill" }}
{{ $new = $original.Fill $options }}
{{ else if eq $command "Resize" }}
{{ $new = $original.Resize $options }}
{{ else if eq $command "Original" }}
{{ $new = $original }}
{{ else }}
{{ errorf "Invalid image processing command: Must be one of Fit, Fill, Resize, Original." }}
{{ end }}
{{ $captionId := printf "caption-%s" ($caption | md5) }}
<figure role="group" aria-describedby="{{ $captionId }}">
<a href="{{ $original.Permalink }}" class="">
<img src="{{ $new.Permalink }}">
</a>
<figcaption id="{{ $captionId }}">
{{ $caption | markdownify }}
</figcaption>
</figure>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

424
themes/cayman/static/css/normalize.css vendored Normal file
View File

@ -0,0 +1,424 @@
/*! normalize.css v3.0.2 | MIT License | git.io/normalize */
/**
* 1. Set default font family to sans-serif.
* 2. Prevent iOS text size adjust after orientation change, without disabling
* user zoom.
*/
html {
font-family: sans-serif; /* 1 */
-ms-text-size-adjust: 100%; /* 2 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/**
* Remove default margin.
*/
body {
margin: 0;
}
/* HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined for any HTML5 element in IE 8/9.
* Correct `block` display not defined for `details` or `summary` in IE 10/11
* and Firefox.
* Correct `block` display not defined for `main` in IE 11.
*/
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section,
summary {
display: block;
}
/**
* 1. Correct `inline-block` display not defined in IE 8/9.
* 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
*/
audio,
canvas,
progress,
video {
display: inline-block; /* 1 */
vertical-align: baseline; /* 2 */
}
/**
* Prevent modern browsers from displaying `audio` without controls.
* Remove excess height in iOS 5 devices.
*/
audio:not([controls]) {
display: none;
height: 0;
}
/**
* Address `[hidden]` styling not present in IE 8/9/10.
* Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22.
*/
[hidden],
template {
display: none;
}
/* Links
========================================================================== */
/**
* Remove the gray background color from active links in IE 10.
*/
a {
background-color: transparent;
}
/**
* Improve readability when focused and also mouse hovered in all browsers.
*/
a:active,
a:hover {
outline: 0;
}
/* Text-level semantics
========================================================================== */
/**
* Address styling not present in IE 8/9/10/11, Safari, and Chrome.
*/
abbr[title] {
border-bottom: 1px dotted;
}
/**
* Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
*/
b,
strong {
font-weight: bold;
}
/**
* Address styling not present in Safari and Chrome.
*/
dfn {
font-style: italic;
}
/**
* Address variable `h1` font-size and margin within `section` and `article`
* contexts in Firefox 4+, Safari, and Chrome.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/**
* Address styling not present in IE 8/9.
*/
mark {
background: #ff0;
color: #000;
}
/**
* Address inconsistent and variable font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` affecting `line-height` in all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
/* Embedded content
========================================================================== */
/**
* Remove border when inside `a` element in IE 8/9/10.
*/
img {
border: 0;
}
/**
* Correct overflow not hidden in IE 9/10/11.
*/
svg:not(:root) {
overflow: hidden;
}
/* Grouping content
========================================================================== */
/**
* Address margin not present in IE 8/9 and Safari.
*/
figure {
margin: 1em 40px;
}
/**
* Address differences between Firefox and other browsers.
*/
hr {
box-sizing: content-box;
height: 0;
}
/**
* Contain overflow in all browsers.
*/
pre {
overflow: auto;
}
/**
* Address odd `em`-unit font size rendering in all browsers.
*/
code,
kbd,
pre,
samp {
font-family: monospace, monospace;
font-size: 1em;
}
/* Forms
========================================================================== */
/**
* Known limitation: by default, Chrome and Safari on OS X allow very limited
* styling of `select`, unless a `border` property is set.
*/
/**
* 1. Correct color not being inherited.
* Known issue: affects color of disabled elements.
* 2. Correct font properties not being inherited.
* 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
*/
button,
input,
optgroup,
select,
textarea {
color: inherit; /* 1 */
font: inherit; /* 2 */
margin: 0; /* 3 */
}
/**
* Address `overflow` set to `hidden` in IE 8/9/10/11.
*/
button {
overflow: visible;
}
/**
* Address inconsistent `text-transform` inheritance for `button` and `select`.
* All other form control elements do not inherit `text-transform` values.
* Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
* Correct `select` style inheritance in Firefox.
*/
button,
select {
text-transform: none;
}
/**
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
* and `video` controls.
* 2. Correct inability to style clickable `input` types in iOS.
* 3. Improve usability and consistency of cursor style between image-type
* `input` and others.
*/
button,
html input[type="button"], /* 1 */
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button; /* 2 */
cursor: pointer; /* 3 */
}
/**
* Re-set default cursor for disabled elements.
*/
button[disabled],
html input[disabled] {
cursor: default;
}
/**
* Remove inner padding and border in Firefox 4+.
*/
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
/**
* Address Firefox 4+ setting `line-height` on `input` using `!important` in
* the UA stylesheet.
*/
input {
line-height: normal;
}
/**
* It's recommended that you don't attempt to style these elements.
* Firefox's implementation doesn't respect box-sizing, padding, or width.
*
* 1. Address box sizing set to `content-box` in IE 8/9/10.
* 2. Remove excess padding in IE 8/9/10.
*/
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* Fix the cursor style for Chrome's increment/decrement buttons. For certain
* `font-size` values of the `input`, it causes the cursor style of the
* decrement button to change from `default` to `text`.
*/
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Address `appearance` set to `searchfield` in Safari and Chrome.
* 2. Address `box-sizing` set to `border-box` in Safari and Chrome
* (include `-moz` to future-proof).
*/
input[type="search"] {
-webkit-appearance: textfield; /* 1 */ /* 2 */
box-sizing: content-box;
}
/**
* Remove inner padding and search cancel button in Safari and Chrome on OS X.
* Safari (but not Chrome) clips the cancel button when the search input has
* padding (and `textfield` appearance).
*/
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* Define consistent border, margin, and padding.
*/
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
/**
* 1. Correct `color` not being inherited in IE 8/9/10/11.
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
*/
legend {
border: 0; /* 1 */
padding: 0; /* 2 */
}
/**
* Remove default vertical scrollbar in IE 8/9/10/11.
*/
textarea {
overflow: auto;
}
/**
* Don't inherit the `font-weight` (applied by a rule above).
* NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
*/
optgroup {
font-weight: bold;
}
/* Tables
========================================================================== */
/**
* Remove most spacing between table cells.
*/
table {
border-collapse: collapse;
border-spacing: 0;
}
td,
th {
padding: 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 710 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
cd exampleSite
hugo serve --themesDir ../..
cd ..

17
themes/cayman/theme.toml Normal file
View File

@ -0,0 +1,17 @@
name = "Cayman"
license = "CC BY 4.0"
licenselink = "https://creativecommons.org/licenses/by/4.0/"
description = "Cayman is a clean, responsive theme for Hugo, ported from the original Jekyll Cayman Theme."
homepage = "https://github.com/zwbetz-gh/cayman-hugo-theme"
tags = ["blog", "clean", "color configuration"]
features = ["blog", "clean", "color configuration"]
min_version = "0.81.0"
[author]
name = "Zachary Betz"
homepage = "https://zwbetz.com/"
[original]
name = "Cayman"
homepage = "https://github.com/jasonlong/cayman-theme"
repo = "https://github.com/jasonlong/cayman-theme"