wip: font changes

feature/font
Rin 2023-06-07 10:24:51 +10:00
parent 4dad03e3c9
commit 2b93a43494
7 changed files with 206 additions and 0 deletions

1
.gitignore vendored
View File

@ -2,6 +2,7 @@
/public/
/resources/_gen/
/assets/jsconfig.json
/static/fonts
hugo_stats.json
# Executable may be added to repository

View File

@ -1,3 +1,92 @@
/* Example Font-Face Set-Up */
@font-face {
font-family: 'Majesty';
src: url('/fonts/Majesty/majesty-medium.otf');
weight: 600;
}
@font-face {
font-family: 'Majesty Display';
src: url('/fonts/Majesty/majesty-display.otf');
weight: 400;
}
@font-face {
font-family: 'Majesty Light';
src: url('/fonts/Majesty/majesty-light.otf');
weight: 200;
}
@font-face {
font-family: 'Quincy';
src: url('/fonts/Fontspring-DEMO-quincycf-regular.otf');
font-weight: normal;
}
@font-face {
font-family: 'Quincy';
src: url('/fonts/Fontspring-DEMO-quincycf-regularitalic.otf');
font-weight: normal;
font-style: italic, oblique;
}
@font-face {
font-family: 'Quincy';
src: url('/fonts/Fontspring-DEMO-quincycf-bolditalic.otf');
font-weight: bold;
font-style: italic, oblique;
}
@font-face {
font-family: 'Roxborough';
src: url('/fonts/Fontspring-DEMO-Calluna-Regular.otf');
font-weight: normal;
}
@font-face {
font-family: 'Roxborough';
src: url('/fonts/Fontspring-DEMO-Calluna-It.otf');
font-weight: normal;
font-style: italic;
}
@font-face {
font-family: 'Roxborough';
src: url('/fonts/Fontspring-DEMO-Calluna-SemiboldIt.otf');
font-weight: bold;
font-style: italic, oblique;
}
html {
line-height: 1.1;
/*font-family: 'Roxborough';*/
}
a {
font-family: 'Roxborough';
}
time, .reading-time, .word-count {
font-family: 'Roxborough';
}
h1 {
font-family: 'Roxborough';
}
h2, h3, h4, h5, h6 {
font-family: 'Roxborough';
}
p, article {
font-family: 'Roxborough';
}
.text {
font-family: 'Roxborough';
}
/* Max Content Width */
.max-w-prose {
max-width: 80ch;
@ -31,6 +120,11 @@
color: rgba(var(--color-primary-700),var(--tw-text-opacity));
}
.prose :where(code):not(:where([class~=not-prose] *)) {
font-weight: normal;
}
.dark .chroma .ow {
color: rgba(var(--color-primary-400),var(--tw-text-opacity));
}

View File

@ -0,0 +1,95 @@
{{ $constrainItemsWidth := .Page.Site.Params.list.constrainItemsWidth | default false }}
{{ $articleClasses := "flex flex-wrap article" }}
{{ if .Site.Params.list.showCards }}
{{ $articleClasses = delimit (slice $articleClasses "border border-neutral-200 dark:border-neutral-700 border-2 rounded-md backdrop-blur") " " }}
{{ else }}
{{ $articleClasses = delimit (slice $articleClasses "") " " }}
{{ end }}
{{ $articleImageClasses := "w-full md:w-auto h-full thumbnail nozoom" }}
{{ if .Site.Params.list.showCards }}
{{ $articleImageClasses = delimit (slice $articleImageClasses "") " " }}
{{ else }}
{{ $articleImageClasses = delimit (slice $articleImageClasses "thumbnailshadow md:mr-7") " " }}
{{ end }}
{{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }}
{{ $articleInnerClasses := "" }}
{{ if .Site.Params.list.showCards }}
{{ $articleInnerClasses = delimit (slice $articleInnerClasses "p-4") " " }}
{{ else }}
{{ $articleInnerClasses = delimit (slice $articleInnerClasses "mt-3 md:mt-0") " " }}
{{ end }}
{{ if $constrainItemsWidth }}
{{ $articleClasses = delimit (slice $articleClasses "max-w-prose") " " }}
{{ end }}
{{ with .Params.externalUrl }}
<a class="{{ $articleClasses }}" href="{{ . }}" target="_blank" rel="external">
{{ else }}
<a class="{{ $articleClasses }}" href="{{ .RelPermalink }}">
{{ end }}
{{- with $.Params.images -}}
{{- range first 6 . }}
<meta property="og:image" content="{{ . | absURL }}" />{{ end -}}
{{- else -}}
{{- $images := $.Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{- with $featured -}}
{{ if $disableImageOptimization }}
{{ with . }}
<div class="{{ $articleImageClasses }}" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ else }}
{{ with .Resize "600x" }}
<div class="{{ $articleImageClasses }}" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ end }}
{{- else -}}
{{- with $.Site.Params.images }}
<meta property="og:image" content="{{ index . 0 | absURL }}" />{{ end -}}
{{- end -}}
{{- end -}}
<div class="{{ $articleInnerClasses }}">
<div class="items-center text-xl font-semibold">
{{ with .Params.externalUrl }}
<div>
<div
class="text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral">
{{ $.Title | emojify }}
<span class="text-xs align-top cursor-default text-neutral-400 dark:text-neutral-500">
<span class="rtl:hidden">&#8599;</span>
<span class="ltr:hidden">&#8598;</span>
</span>
</div>
</div>
{{ else }}
<div class="text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral"
href="{{ .RelPermalink }}"><h2>{{ .Title | emojify }}</h2></div>
{{ end }}
{{ if and .Draft .Site.Params.article.showDraftLabel }}
<div class=" ltr:ml-2 rtl:mr-2">
{{ partial "badge.html" (i18n "article.draft" | emojify) }}
</div>
{{ end }}
{{ if templates.Exists "partials/extend-article-link.html" }}
{{ partial "extend-article-link.html" . }}
{{ end }}
</div>
<div class="text-sm text-neutral-500 dark:text-neutral-400">
{{ partial "article-meta/basic.html" . }}
</div>
{{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }}
<div class="py-1 max-w-fit prose dark:prose-invert">
{{ .Summary | emojify }}
</div>
{{ end }}
</div>
</a>

View File

@ -0,0 +1,4 @@
<time datetime="{{ . }}">
{{- i18n "article.date_updated" (dict "Date" (partial "functions/date.html" .)) | markdownify | emojify -}}
</time>
{{- /* Trim EOF */ -}}

View File

@ -0,0 +1,4 @@
<time datetime="{{ . }}">
{{- i18n "article.date" (dict "Date" (partial "functions/date.html" .)) | markdownify | emojify -}}
</time>
{{- /* Trim EOF */ -}}

View File

@ -0,0 +1,4 @@
<span title="{{ i18n "article.reading_time_title" }}" class="reading-time">
{{- i18n "article.reading_time" .ReadingTime | markdownify | emojify -}}
</span>
{{- /* Trim EOF */ -}}

View File

@ -0,0 +1,4 @@
<span title="Word count" class="word-count">
{{- i18n "article.word_count" .WordCount | markdownify | emojify -}}
</span>
{{- /* Trim EOF */ -}}