Add multiple colour schemes

This commit is contained in:
James Panther
2021-08-20 17:02:08 +10:00
parent 62703a114b
commit ecfa2d395b
33 changed files with 331 additions and 176 deletions
+3 -1
View File
@@ -1,6 +1,8 @@
{{ define "main" }}
<h1 class="mb-3 text-4xl font-extrabold">{{ i18n "error.404_title" | emojify }}</h1>
<p class="mt-8 mb-12 text-gray-400 dark:text-gray-500">{{ i18n "error.404_error" | emojify }}</p>
<p class="mt-8 mb-12 text-neutral-400 dark:text-neutral-500">
{{ i18n "error.404_error" | emojify }}
</p>
<div class="prose dark:prose-light">
<p>{{ i18n "error.404_description" | emojify }}</p>
</div>
+1 -1
View File
@@ -2,7 +2,7 @@
<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-white text-grey-900 sm:px-14 md:px-24 lg:px-32 dark:bg-gray-800 dark:text-white max-w-7xl"
class="flex flex-col h-screen px-6 m-auto text-lg leading-7 bg-neutral text-neutral-900 sm:px-14 md:px-24 lg:px-32 dark:bg-neutral-800 dark:text-neutral max-w-7xl"
>
{{- partial "header.html" . -}}
<main class="flex-grow">{{- block "main" . }}{{- end }}</main>
+2 -2
View File
@@ -4,8 +4,8 @@
<section>
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
{{ if $.Site.Params.list.groupByYear }}
<h2 class="mt-12 text-2xl font-bold first:mt-8">{{ .Key }}</h2>
<hr class="border-gray-400 border-dotted w-36" />
<h2 class="mt-12 text-2xl font-bold first:mt-8 text-neutral-800">{{ .Key }}</h2>
<hr class="border-dotted border-neutral-400 w-36" />
{{ end }}
{{ range .Pages }}
{{ partial "article-link.html" . }}
+4 -2
View File
@@ -4,8 +4,10 @@
{{ if .Site.Params.article.showBreadcrumbs | default false }}
{{ partial "breadcrumbs.html" . }}
{{ end }}
<h1 class="mt-0 text-4xl font-extrabold">{{ .Title | emojify }}</h1>
<div class="mt-8 mb-12 text-base text-gray-400 dark:text-gray-500">
<h1 class="mt-0 text-4xl font-extrabold text-neutral-800 dark:text-neutral">
{{ .Title | emojify }}
</h1>
<div class="mt-8 mb-12 text-base text-neutral-400 dark:text-neutral-500">
{{ partial "article-meta.html" . }}
{{ if and .Draft .Site.Params.article.showDraftLabel }}
<span class="pl-2">{{ partial "badge.html" (i18n "article.draft" | emojify) }}</span>
+1 -1
View File
@@ -10,7 +10,7 @@
>{{ .Page.Title }}</a
>
{{ if $.Site.Params.taxonomy.showTermCount | default true }}
<span class="text-base text-gray-400">
<span class="text-base text-neutral-400">
<span class="px-1 text-primary-500">&middot;</span>
{{ .Count }}
</span>
+1 -1
View File
@@ -3,7 +3,7 @@
<section>
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
<h2 class="mt-12 text-2xl font-bold first:mt-8">{{ .Key }}</h2>
<hr class="border-gray-400 border-dotted w-36" />
<hr class="border-dotted border-neutral-400 w-36" />
{{ range .Pages }}
{{ partial "article-link.html" . }}
{{ end }}
+7 -3
View File
@@ -1,7 +1,11 @@
<article>
<h3 class="mt-6 text-xl font-semibold">
{{ if isset .Params "externalUrl" }}
<a class="hover:underline" href="{{ .Params.externalUrl }}" target="_blank" rel="external"
<a
class="hover:underline hover:underline-primary-500 hover:underline-offset-small text-neutral-800 dark:text-neutral"
href="{{ .Params.externalUrl }}"
target="_blank"
rel="external"
>{{ .Title }}</a
>
<span
@@ -12,7 +16,7 @@
>
{{ else }}
<a
class="hover:underline hover:underline-primary-500 hover:underline-offset-small"
class="hover:underline hover:underline-primary-500 hover:underline-offset-small text-neutral-800 dark:text-neutral"
href="{{ .Permalink }}"
>{{ .Title }}</a
>
@@ -24,7 +28,7 @@
{{ partial "extend-article-link.html" . }}
{{ end }}
</h3>
<div class="text-sm text-gray-400 dark:text-gray-500">
<div class="text-sm text-neutral-400 dark:text-neutral-500">
{{ partial "article-meta.html" . }}
</div>
</article>
+3 -3
View File
@@ -1,7 +1,7 @@
{{ if .Params.showPagination | default (.Site.Params.article.showPagination | default true) }}
{{ if or .NextInSection .PrevInSection }}
<div class="pt-8 article-pagination">
<hr class="border-gray-300 border-dotted dark:border-gray-600" />
<hr class="border-dotted border-neutral-300 dark:border-neutral-600" />
<div class="flex justify-between pt-3">
<span>
{{ if .NextInSection }}
@@ -11,7 +11,7 @@
<span class="article-pagination-title">{{ .NextInSection.Title }}</span>
{{ if .Params.showDate | default (.Site.Params.article.showDate | default true) }}
<time
class="-mt-1 text-xs text-gray-400 dark:text-gray-500"
class="-mt-1 text-xs text-neutral-400 dark:text-neutral-500"
datetime="{{ .Date }}"
>
{{ .Date.Format .Site.Params.article.dateFormat | default "2 January 2006" }}
@@ -28,7 +28,7 @@
<span class="article-pagination-title">{{ .PrevInSection.Title }}</span>
{{ if .Params.showDate | default (.Site.Params.article.showDate | default true) }}
<time
class="-mt-1 text-xs text-gray-400 dark:text-gray-500"
class="-mt-1 text-xs text-neutral-400 dark:text-neutral-500"
datetime="{{ .Date }}"
>
{{ .Date.Format .Site.Params.article.dateFormat | default "2 January 2006" }}
+1 -1
View File
@@ -1,5 +1,5 @@
{{ with .Site.Author.links }}
<div class="flex flex-wrap text-gray-400 dark:text-gray-500">
<div class="flex flex-wrap text-neutral-400 dark:text-neutral-500">
{{ range $links := . }}
{{ range $name, $url := $links }}
<a
+2 -2
View File
@@ -5,10 +5,10 @@
{{ end }}
<div>
{{ with .Site.Author.name }}
<div class="text-[0.6rem] leading-3 text-gray-400 dark:text-gray-500 uppercase">
<div class="text-[0.6rem] leading-3 text-neutral-400 dark:text-neutral-500 uppercase">
{{ i18n "author.byline_title" | emojify }}
</div>
<div class="font-semibold leading-6 text-gray-800 dark:text-gray-300">
<div class="font-semibold leading-6 text-neutral-800 dark:text-neutral-300">
{{ . }}
</div>
{{ end }}
+2 -2
View File
@@ -1,4 +1,4 @@
<ol class="text-sm text-gray-400 dark:text-gray-500">
<ol class="text-sm text-neutral-400 dark:text-neutral-500">
{{ template "crumb" (dict "p1" . "p2" .) }}
</ol>
{{ define "crumb" }}
@@ -9,7 +9,7 @@
{{ end }}
<li class="inline {{ if or (eq .p1 .p2) (.p1.IsHome) }}hidden{{ end }}">
<a
class="hover:underline hover:underline-gray-300 dark:underline-gray-600"
class="hover:underline hover:underline-neutral-300 dark:underline-neutral-600"
href="{{ .p1.Permalink }}"
>{{ .p1.Title }}</a
><span class="px-1 text-primary-500">/</span>
+2 -2
View File
@@ -1,6 +1,6 @@
<footer class="py-10 text-sm">
{{/* Copyright */}}
<p class="text-gray-400 dark:text-gray-500">
<p class="text-neutral-400 dark:text-neutral-500">
{{- with .Site.Copyright }}
{{ . | emojify | markdownify }}
{{- else }}
@@ -11,7 +11,7 @@
</p>
{{/* Theme attribution */}}
{{ if .Site.Params.attribution | default true }}
<p class="text-xs text-gray-300 dark:text-gray-600">
<p class="text-xs text-neutral-300 dark:text-neutral-600">
{{ i18n "footer.powered_by" }}
<a
class="hover:underline hover:underline-primary-300 hover:text-primary-400"
+6
View File
@@ -27,6 +27,12 @@
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}}
{{/* Styles */}}
{{ $cssScheme := resources.Get (printf "css/schemes/%s.css" (.Site.Params.colorScheme | default "congo")) }}
{{ if not $cssScheme }}
{{ $cssScheme = resources.Get "css/schemes/congo.css" }}
{{ end }}
{{ $stylesheet := $cssScheme | resources.Minify }}
<link type="text/css" rel="stylesheet" href="{{ $stylesheet.Permalink }}" />
<link type="text/css" rel="stylesheet" href="{{ "css/main.css" | absURL }}" />
{{ if (fileExists "static/css/custom.css") -}}
<link type="text/css" rel="stylesheet" href="{{ "css/custom.css" | absURL }}" />
+1 -1
View File
@@ -1,4 +1,4 @@
<header class="flex justify-between py-6 font-semibold sm:py-10">
<header class="flex justify-between py-6 font-semibold sm:py-10 text-neutral-800 dark:text-neutral">
<div>
<a
class="hover:underline hover:underline-primary-500 hover:underline-thickness-bold hover:underline-offset-small"
+4 -4
View File
@@ -5,7 +5,7 @@
<li>
<a
href="{{ $paginator.Prev.URL }}"
class="mx-1 block min-w-[1.8rem] text-center hover:bg-primary-600 hover:text-white rounded"
class="mx-1 block min-w-[1.8rem] text-center hover:bg-primary-600 hover:text-neutral rounded"
rel="prev"
>
&larr;
@@ -16,8 +16,8 @@
<li>
<a
href="{{ .URL }}"
class="mx-1 block min-w-[1.8rem] text-center hover:bg-primary-600 hover:text-white rounded {{ if eq . $paginator }}
bg-primary-200 dark:bg-primary-400 dark:text-gray-800
class="mx-1 block min-w-[1.8rem] text-center hover:bg-primary-600 hover:text-neutral rounded {{ if eq . $paginator }}
bg-primary-200 dark:bg-primary-400 dark:text-neutral-800
{{ end }}"
>
{{ .PageNumber }}
@@ -28,7 +28,7 @@
<li>
<a
href="{{ $paginator.Next.URL }}"
class="mx-1 block min-w-[1.8rem] text-center hover:bg-primary-600 hover:text-white rounded"
class="mx-1 block min-w-[1.8rem] text-center hover:bg-primary-600 hover:text-neutral rounded"
rel="next"
>
&rarr;
+1 -1
View File
@@ -3,7 +3,7 @@
{{ partial "breadcrumbs.html" . }}
{{ end }}
<section class="prose dark:prose-light">
<h1 class="mb-3 text-4xl font-extrabold">{{ .Title }}</h1>
<h1 class="mb-3 text-4xl font-extrabold text-neutral-800">{{ .Title }}</h1>
<section>{{ .Content }}</section>
</section>
</header>
+1 -1
View File
@@ -4,7 +4,7 @@
{{ range . }}
{{ with index $links . }}
<a
class="bg-gray-300 text-gray-700 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-primary-400 dark:hover:text-gray-800 m-1 hover:bg-primary-500 hover:text-white rounded min-w-[2.4rem] inline-block text-center p-1"
class="bg-neutral-300 text-neutral-700 dark:bg-neutral-700 dark:text-neutral-300 dark:hover:bg-primary-400 dark:hover:text-neutral-800 m-1 hover:bg-primary-500 hover:text-neutral rounded min-w-[2.4rem] inline-block text-center p-1"
href="{{ printf .url $.Permalink $.Title }}"
title="{{ i18n .title }}"
>{{ partial "icon.html" .icon }}</a
+1 -1
View File
@@ -2,7 +2,7 @@
<span class="pr-3 text-primary-400">
{{ partial "icon.html" "exclamation-triangle" }}
</span>
<span class="no-prose dark:text-gray-300">
<span class="no-prose dark:text-neutral-300">
{{- .Inner | markdownify -}}
</span>
</div>
+1 -1
View File
@@ -1,5 +1,5 @@
<a
class="px-4 py-2 !text-white !no-underline !rounded-md bg-primary-600 hover:!bg-primary-500 dark:bg-primary-800 dark:hover:!bg-primary-700"
class="px-4 py-2 !text-neutral !no-underline !rounded-md bg-primary-600 hover:!bg-primary-500 dark:bg-primary-800 dark:hover:!bg-primary-700"
{{ with .Get "href" }}href="{{ . }}"{{ end }}
{{ with .Get "target" }}target="{{ . }}"{{ end }}
role="button"