Skip to content

Commit

Permalink
Adds authors
Browse files Browse the repository at this point in the history
  • Loading branch information
orta committed Dec 13, 2023
1 parent 9645c48 commit 4979bdb
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 21 deletions.
5 changes: 5 additions & 0 deletions content/authors/orta/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
name: "Orta Therox"
bio: "Programmer of sorts"
twitter: "orta"
---
3 changes: 2 additions & 1 deletion content/posts/2023/12/13/first.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
+++
title = 'First Post'
date = 2023-12-13T12:56:32Z
comments = false
authors = ["orta"]
tags = ["meta"]
+++

### Hello world!
Expand Down
26 changes: 6 additions & 20 deletions hugo.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,17 @@
baseURL = 'https://puzzmo-com.github.io/blog.puzzmo.com/'
baseURL = 'https://blog.puzzmo.com/'
languageCode = 'en-us'
title = 'Puzzmo Blog'
theme = 'paper'

[params]
# color style
color = 'linen' # linen, wheat, gray, light
color = 'gray' # linen, wheat, gray, light

# header social icons
twitter = 'puzzmotoday' # twitter.com/YOUR_TWITTER_ID
github = 'puzzmo-com' # github.com/YOUR_GITHUB_ID
instagram = 'puzzmo' # instagram.com/YOUR_INSTAGRAM_ID
# linkedin = 'company/puzzmo' # linkedin.com/in/YOUR_LINKEDIN_ID
# mastodon = 'YOUR_MASTODON_LINK' # e.g. 'https://mastodon.instance/@xxx'
rss = true # show rss icon
twitter = 'puzzmotoday'
github = 'puzzmo-com'
instagram = 'puzzmo'
rss = true



# misc
# disableHLJS = true # disable highlight.js
# disablePostNavigation = true # disable post navigation
# monoDarkIcon = true # show monochrome dark mode icon
# gravatarCdn = 'GRAVATAR_CDN_LINK' # e.g. 'https://cdn.v2ex.com/gravatar/'
# graphCommentId = "YOUR_GRAPH_COMMENT_ID" # use graph comment (disqus alternative)
# math = true # enable KaTeX math typesetting globally

# giscus
[params.giscus]
repo = 'puzzmo-com/blog.puzzmo.com' # see https://giscus.app for more details
repoId = 'R_kgDOK5Q10A'
Expand Down
3 changes: 3 additions & 0 deletions layouts/_default/author.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{ define "main" }}

{{ end }}
10 changes: 10 additions & 0 deletions layouts/_default/author.terms.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{ define "main" }}

<H1>Authors</H1>

{{ range .Data.Pages }}
<h2>{{ .Params.name }}</h2>
<p>{{ .Params.bio }}</p>
{{end}}

{{ end }}
100 changes: 100 additions & 0 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{{ define "main" }}


<article>
<header class="mb-16">
<h1 class="!my-0 pb-2.5">{{ .Title }}</h1>

{{ if ne .Type "page" }}
<div class="text-sm antialiased opacity-60">
{{ if .Date }}
<time>{{ .Date | time.Format ":date_medium" }}</time>
{{ end }}<!---->
-
<span>
{{ range .Param "authors" }}
{{ $name := . }}
{{ $path := printf "/%s/%s" "authors" ($name | urlize) }}
{{ with $.Site.GetPage $path }}
<span>{{ .Params.name }}</span>
{{ end }}
{{ end }}
</span>
</div>
{{ end }}
</header>

<section>{{ .Content }}</section>

<!-- Post Tags -->
{{ if .Params.tags }}
<footer class="mt-12 flex flex-wrap">
{{ range .Params.tags }} {{ $href := print (absURL "tags/") (urlize .) }}
<a
class="mb-1.5 mr-1.5 rounded-lg bg-black/[3%] px-5 py-1.5 no-underline dark:bg-white/[8%]"
href="{{ $href }}"
>{{ . }}</a
>
{{ end }}
</footer>
{{ end }}

<!-- Post Nav -->
{{ if not site.Params.disablePostNavigation }}<!---->
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}<!---->
{{ if and (gt (len $pages) 1) (in $pages . ) }}
<nav class="mt-24 flex rounded-lg bg-black/[3%] text-lg dark:bg-white/[8%]">
{{ with $pages.Next . }}
<a
class="flex w-1/2 items-center rounded-l-md p-6 pr-3 font-semibold no-underline hover:bg-black/[2%] dark:hover:bg-white/[3%]"
href="{{ .Permalink }}"
><span class="mr-1.5"></span><span>{{ .Name }}</span></a
>
{{ end }}<!---->
{{ with $pages.Prev . }}
<a
class="ml-auto flex w-1/2 items-center justify-end rounded-r-md p-6 pl-3 font-semibold no-underline hover:bg-black/[2%] dark:hover:bg-white/[3%]"
href="{{ .Permalink }}"
><span>{{ .Name }}</span><span class="ml-1.5"></span></a
>
{{ end }}
</nav>
{{ end }}<!---->
{{ end }}

<!-- Disqus -->
{{ if and site.DisqusShortname (not (eq .Params.comments false)) }}
<div class="mt-24" id="disqus_thread"></div>
<script>
const disqusShortname = '{{ site.DisqusShortname }}';
const script = document.createElement('script');
script.src = 'https://' + disqusShortname + '.disqus.com/embed.js';
script.setAttribute('data-timestamp', +new Date());
document.head.appendChild(script);
</script>
{{ end }}


<!-- giscus comment -->
{{ if and site.Params.giscus.repo (eq .Params.comments true) }}
<div class="giscus mt-24"></div>
<script src="https://giscus.app/client.js"
data-repo="{{ site.Params.giscus.repo }}"
data-repo-id="{{ site.Params.giscus.repoId }}"
data-category="{{ site.Params.giscus.category }}"
data-category-id="{{ site.Params.giscus.categoryId }}"
data-mapping="{{ site.Params.giscus.mapping | default (print `pathname`) }}"
data-strict="{{ site.Params.giscus.strict | default (print `1`) }}"
data-reactions-enabled="{{ site.Params.giscus.reactionsEnabled | default (print `0`) }}"
data-emit-metadata="{{ site.Params.giscus.emitMetadata | default (print `0`) }}"
data-input-position="{{ site.Params.giscus.inputPosition | default (print `top`) }}"
data-theme="{{ site.Params.giscus.theme | default (print `light`) }}"
data-lang="{{ site.Params.giscus.lang | default (print `en`) }}"
data-loading="{{ site.Params.giscus.loading | default (print `lazy`) }}"
crossorigin="anonymous"
async>
</script>
{{ end }}
</article>

{{ end }}

0 comments on commit 4979bdb

Please sign in to comment.