From 2b4ca1a88e4df33269e0bd80b4b23ef40d276858 Mon Sep 17 00:00:00 2001 From: wires Date: Thu, 6 Mar 2025 23:30:44 -0500 Subject: [PATCH] first draft of theme --- archetypes/default.md | 5 + assets/style.css | 87 ++++++++++++++ assets/syntax.css | 110 ++++++++++++++++++ content/_index.md | 8 ++ hugo.toml | 15 ++- .../_default/_markup/render-codeblock.html | 1 + layouts/_default/baseof.html | 29 +++++ layouts/_default/list.html | 10 ++ layouts/_default/single.html | 16 +++ layouts/index.html | 14 +++ layouts/partials/footer.html | 5 + layouts/partials/head.html | 28 +++++ layouts/partials/header.html | 0 layouts/partials/tags.html | 5 + 14 files changed, 327 insertions(+), 6 deletions(-) create mode 100644 archetypes/default.md create mode 100644 assets/style.css create mode 100644 assets/syntax.css create mode 100644 content/_index.md create mode 100644 layouts/_default/_markup/render-codeblock.html 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/head.html create mode 100644 layouts/partials/header.html create mode 100644 layouts/partials/tags.html diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 0000000..baf3fce --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,5 @@ ++++ +title = {{ replace .File.ContentBaseName "-" " " | title }} +date = {{ .Date }} +draft = true ++++ diff --git a/assets/style.css b/assets/style.css new file mode 100644 index 0000000..b1b8d23 --- /dev/null +++ b/assets/style.css @@ -0,0 +1,87 @@ +.skip { + position: absolute; + left: -10000px; + top: auto; + width: 1px; + height: 1px; + overflow: hidden; +} + +.skip:focus { + position: static; + width: auto; + height: auto; +} + +body { + max-width: 45rem; + padding: 0 2rem; + margin: 2rem auto 0; + line-height: 1.6; + background: #11111b; + color: white; +} + +h1, h2, h3 { + margin-bottom: 0.25em; + line-height: 1.3; +} + +p { + margin-top: 0; +} + +p + p { + text-indent: 2em; +} + +ul { + margin-top: 0; +} + +#main-nav { + font-size: 125%; +} + +#main-nav ul { + padding: 0; + margin: 0 0 1em; +} + +#main-nav li { + display: inline-block; +} + +#main-nav li::before { + content: '/ '; +} + +#main-nav li:first-child::before { + content: ''; +} + +#site-title { + font-weight: bold; + color: inherit; + text-decoration: none; +} + +#site-title:hover { + text-decoration: underline; +} + +footer { + margin: 2em 0 0; +} + +header h1 { + margin: 0; +} + +header { + margin-bottom: 1em; +} + +a, a:visited { + color: #8ef; +} diff --git a/assets/syntax.css b/assets/syntax.css new file mode 100644 index 0000000..96128f9 --- /dev/null +++ b/assets/syntax.css @@ -0,0 +1,110 @@ +:root { + --chroma-bg: #111; + --comment: #9e9e9e; + --cyan: #8be9fd; + --green: #50fa7b; + --orange: #ffb86c; + --pink: #f5a; + --purple: #bd93f9; + --red: #f55; + --yellow: #f1fa8c; +} +/* @media (prefers-color-scheme: light) { + :root { + --chroma-bg: #eee; + --comment: #666; + --cyan: #04a5e5; + --green: #40a02b; + --orange: #fe640b; + --pink: #ea76cb; + --purple: #8839ef; + --red: #d20f39; + --yellow: #df8e1d; + } +} */ +/* Background */ .bg, +/* PreWrapper */ .chroma { background-color:var(--chroma-bg); } +/* Other */ .chroma .x { } +/* Error */ .chroma .err { } +/* CodeLine */ .chroma .cl { } +/* LineLink */ .chroma .lnlinks { outline:none;text-decoration:none;color:inherit } +/* LineTableTD */ .chroma .lntd { vertical-align:top;padding:0;margin:0;border:0; } +/* LineTable */ .chroma .lntable { border-spacing:0;padding:0;margin:0;border:0; } +/* LineHighlight */ .chroma .hl { background-color:#3d3f4a } +/* LineNumbersTable */ .chroma .lnt, +/* LineNumbers */ .chroma .ln { white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:var(--comment) } +/* Line */ .chroma .line { display:flex; } +/* Keyword */ .chroma .k, +/* KeywordConstant */ .chroma .kc, +/* KeywordNamespace */ .chroma .kn, +/* KeywordPseudo */ .chroma .kp, +/* KeywordReserved */ .chroma .kr { color:var(--pink) } +/* KeywordType */ .chroma .kt { color:var(--cyan) } +/* KeywordDeclaration */ .chroma .kd { color:var(--cyan);font-style:italic } +/* Name */ .chroma .n { } +/* NameBuiltinPseudo */ .chroma .bp { } +/* NameConstant */ .chroma .no { } +/* NameDecorator */ .chroma .nd { } +/* NameEntity */ .chroma .ni { } +/* NameException */ .chroma .ne { } +/* NameAttribute */ .chroma .na, +/* NameClass */ .chroma .nc, +/* NameFunctionMagic */ .chroma .fm, +/* NameFunction */ .chroma .nf { color:var(--green) } +/* NameNamespace */ .chroma .nn { } +/* NameOther */ .chroma .nx { } +/* NameProperty */ .chroma .py { } +/* NameTag */ .chroma .nt { color:var(--pink) } +/* NameBuiltin */ .chroma .nb, +/* NameLabel */ .chroma .nl, +/* NameVariable */ .chroma .nv, +/* NameVariableClass */ .chroma .vc, +/* NameVariableGlobal */ .chroma .vg, +/* NameVariableInstance */ .chroma .vi { color:var(--cyan);font-style:italic } +/* NameVariableMagic */ .chroma .vm { } +/* Literal */ .chroma .l { } +/* LiteralDate */ .chroma .ld { } +/* LiteralString */ .chroma .s, +/* LiteralStringAffix */ .chroma .sa, +/* LiteralStringBacktick */ .chroma .sb, +/* LiteralStringChar */ .chroma .sc, +/* LiteralStringDelimiter */ .chroma .dl, +/* LiteralStringDoc */ .chroma .sd, +/* LiteralStringDouble */ .chroma .s2, +/* LiteralStringEscape */ .chroma .se, +/* LiteralStringHeredoc */ .chroma .sh, +/* LiteralStringInterpol */ .chroma .si, +/* LiteralStringOther */ .chroma .sx, +/* LiteralStringRegex */ .chroma .sr, +/* LiteralStringSingle */ .chroma .s1, +/* LiteralStringSymbol */ .chroma .ss { color:var(--yellow) } +/* LiteralNumber */ .chroma .m, +/* LiteralNumberBin */ .chroma .mb, +/* LiteralNumberFloat */ .chroma .mf, +/* LiteralNumberHex */ .chroma .mh, +/* LiteralNumberInteger */ .chroma .mi, +/* LiteralNumberIntegerLong */ .chroma .il, +/* LiteralNumberOct */ .chroma .mo { color:var(--purple) } +/* Operator */ .chroma .o, +/* OperatorWord */ .chroma .ow { color:var(--pink) } +/* Punctuation */ .chroma .p { } +/* Comment */ .chroma .c, +/* CommentHashbang */ .chroma .ch, +/* CommentMultiline */ .chroma .cm, +/* CommentSingle */ .chroma .c1, +/* CommentSpecial */ .chroma .cs { color:var(--comment) } +/* CommentPreproc */ .chroma .cp, +/* CommentPreprocFile */ .chroma .cpf { color:var(--pink) } +/* Generic */ .chroma .g { } +/* GenericDeleted */ .chroma .gd { color:var(--red) } +/* GenericEmph */ .chroma .ge { text-decoration:underline } +/* GenericError */ .chroma .gr { } +/* GenericHeading */ .chroma .gh { font-weight:bold } +/* GenericInserted */ .chroma .gi { color:var(--green);font-weight:bold } +/* GenericOutput */ .chroma .go { color:var(--comment) } +/* GenericPrompt */ .chroma .gp { } +/* GenericStrong */ .chroma .gs { } +/* GenericSubheading */ .chroma .gu { font-weight:bold } +/* GenericTraceback */ .chroma .gt { } +/* GenericUnderline */ .chroma .gl { text-decoration:underline } +/* TextWhitespace */ .chroma .w { } diff --git a/content/_index.md b/content/_index.md new file mode 100644 index 0000000..1c8905b --- /dev/null +++ b/content/_index.md @@ -0,0 +1,8 @@ +I'm a computer science graduate with an affinity for systems programming and +functional languages. I think C, Rust and Zig all have their merits and am +comfortable working with all 3. When I don't need to work at such a low level, +I like to work with Elixir and Erlang. + +I'm passionate about building performant, fault-tolerant and scalable systems and +making the web a more free and decentralized place. All my projects can be found +on [my forgejo instance](https://git.wires.systems) diff --git a/hugo.toml b/hugo.toml index 3c4aff7..2199c34 100644 --- a/hugo.toml +++ b/hugo.toml @@ -1,9 +1,13 @@ baseURL = 'https://wires.systems' languageCode = 'en-us' -title = "wires" +title = "~wires" uglyurls = true enableGitInfo = true -disableKinds = ['taxonomy', 'term', 'section'] +disableKinds = ['section', 'taxonomy'] +summaryLength = 10 + +[taxonomies] + tag = 'tags' [markup] highlight.noClasses = false @@ -13,11 +17,10 @@ disableKinds = ['taxonomy', 'term', 'section'] [outputFormats.rss] baseName = 'feed' -[params] - description = "wires within wires, systems within systems" +[[menu.main]] + name = "rss" + url = "/feed.xml" [[menu.main]] name = "git" url = "https://git.wires.systems/wires" - [menu.main.params] - rel = "me" diff --git a/layouts/_default/_markup/render-codeblock.html b/layouts/_default/_markup/render-codeblock.html new file mode 100644 index 0000000..9bfc3b1 --- /dev/null +++ b/layouts/_default/_markup/render-codeblock.html @@ -0,0 +1 @@ +
{{ (transform.HighlightCodeBlock .).Inner }}
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..ecac3b1 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,29 @@ + + + + {{ partial "head.html" . }} + + +{{ range .AlternativeOutputFormats -}} +{{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} +{{ end -}} + + + + + +
+{{ block "main" . }}{{ end }} +
+{{ partial "footer.html" . }} + + diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..ea76a24 --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,10 @@ +{{ define "main" }} +

{{ .Title }}

+ +{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..60d1b41 --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,16 @@ +{{ define "main" }} +
+

{{ .Title }}

+ +
+ {{ if .Params.toc }} + + + {{ end }} + {{ .Content }} + {{ partial "tags.html" . }} +{{ end }} diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..fd3d675 --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,14 @@ +{{ define "main" }} +{{ .Content }} +{{ with .Site.RegularPages }} +

Posts

+ +{{ end }} +{{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..99d42f9 --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,5 @@ + diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..ce38afc --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,28 @@ + + +{{ with (or .Description .Site.Params.description) }} + +{{ end }} +{{ with .Keywords }}{{ end }} + + +{{- with resources.Get "style.css" }} + {{- if eq hugo.Environment "development" }} + + {{- else }} + {{- with . | minify | fingerprint }} + + {{- end }} + {{- end }} +{{- end }} +{{- with resources.Get "syntax.css" }} + {{- if eq hugo.Environment "development" }} + + {{- else }} + {{- with . | minify | fingerprint }} + + {{- end }} + {{- end }} +{{- end }} +{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }} + diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..e69de29 diff --git a/layouts/partials/tags.html b/layouts/partials/tags.html new file mode 100644 index 0000000..8062534 --- /dev/null +++ b/layouts/partials/tags.html @@ -0,0 +1,5 @@ +{{ with .GetTerms "tags" }} +
+tags: +{{ range $i, $e := . }}{{- if $i -}}, {{ end -}}{{ with $e }}{{lower .Title}}{{end}}{{ end }} +{{ end }}