🎨 Code cleanup

This commit is contained in:
James Panther
2024-05-01 15:17:15 +10:00
parent 0561b834c8
commit 4b3038bb49
10 changed files with 50 additions and 44 deletions

View File

@@ -1,8 +1,8 @@
<!DOCTYPE html>
<!doctype html>
<html lang="{{ with .Site.LanguageCode }}{{ . }}{{ else }}en{{ end }}">
{{- partial "head.html" . -}}
<body
class="flex flex-col h-screen px-6 m-auto text-lg leading-7 bg-neutral max-w-7xl text-neutral-900 dark:bg-neutral-800 dark:text-white sm:px-14 md:px-24 lg:px-32"
class="bg-neutral m-auto flex h-screen max-w-7xl flex-col px-6 text-lg leading-7 text-neutral-900 sm:px-14 md:px-24 lg:px-32 dark:bg-neutral-800 dark:text-white"
>
<main class="flex-grow">{{- block "main" . }}{{- end }}</main>
{{- partial "footer.html" . -}}

View File

@@ -1,10 +1,10 @@
{{ define "main" }}
<article class="flex flex-col items-center justify-center mt-10">
<article class="mt-10 flex flex-col items-center justify-center">
<nav class="place-self-start">
<a href="{{ "" | relURL }}" class="text-neutral-500">&larr; {{ i18n "nav.home" }}</a>
</nav>
<header>
<h1 class="mt-2 mb-6 text-4xl font-extrabold text-center text-neutral-800 dark:text-white">
<h1 class="mb-6 mt-2 text-center text-4xl font-extrabold text-neutral-800 dark:text-white">
{{ .Title | emojify }}
</h1>
</header>

View File

@@ -1,6 +1,6 @@
{{ define "main" }}
<article class="flex flex-col items-center justify-center h-full mt-10 text-center">
<header class="flex flex-col items-center mb-3">
<article class="mt-10 flex h-full flex-col items-center justify-center text-center">
<header class="mb-3 flex flex-col items-center">
{{ with .Site.Params.Author.image }}
{{ $src := . }}
{{ $resource := "" }}
@@ -13,7 +13,7 @@
{{ $src = (.Fill "288x288").RelPermalink }}
{{ end }}
<img
class="mb-2 rounded-full h-36 w-36"
class="mb-2 h-36 w-36 rounded-full"
width="144"
height="144"
alt="{{ $.Site.Params.Author.name | default "Author" }}"
@@ -29,11 +29,11 @@
</h2>
{{ end }}
{{ with .Content }}
<section class="pt-5 prose dark:prose-invert">{{ . | emojify }}</section>
<section class="prose pt-5 dark:prose-invert">{{ . | emojify }}</section>
{{ end }}
</header>
{{ with .Site.Params.Author.links }}
<div class="flex flex-col flex-wrap min-w-full mt-4 sm:min-w-0">
<div class="mt-4 flex min-w-full flex-col flex-wrap sm:min-w-0">
{{ range $links := . }}
{{ range $type, $data := $links }}
{{ $href := $data }}

View File

@@ -1,10 +1,6 @@
{{ if hugo.IsProduction }}
{{ with .Site.Params.fathomAnalytics.site }}
{{ if isset $.Site.Params.fathomanalytics "domain" }}
<script defer src="https://{{ $.Site.Params.fathomanalytics.domain }}/script.js" data-site="{{ . }}"></script>
{{ else }}
<script defer src="https://cdn.usefathom.com/script.js" data-site="{{ . }}"></script>
{{ end }}
<script defer src="https://cdn.usefathom.com/script.js" data-site="{{ . }}"></script>
{{ end }}
{{ template "_internal/google_analytics.html" . }}
{{ end }}

View File

@@ -1,6 +1,6 @@
{{ $icon := resources.Get (print "icons/" . ".svg") }}
{{ if $icon }}
<span class="relative inline-block align-text-bottom icon">
<span class="icon relative inline-block align-text-bottom">
{{ $icon.Content | safeHTML }}
</span>
{{ end }}

View File

@@ -1,4 +1,4 @@
<span class="relative inline-block align-text-bottom icon">
<span class="icon relative inline-block align-text-bottom">
{{ $icon := resources.Get (printf "icons/%s.svg" ($.Get 0)) }}
{{ if $icon }}
{{ $icon.Content | safeHTML }}