Compare commits

...

2 Commits

Author SHA1 Message Date
Rin 2b93a43494 wip: font changes 2023-06-07 10:24:51 +10:00
Rin 4dad03e3c9 wip: fortune 2023-06-07 10:22:55 +10:00
9 changed files with 3089 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));
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,74 @@
---
title: "Cleaning up fortune and friends"
date: 2022-11-20T22:22:22+11:00
draft: true
showSummary: true
summary: "As it turns out, fortune-mod has an -o option for \"offensive\" fortunes, which range from vaguely off-colour
to wildly homophobic and outright racist. We figured someone should clean up and reorganise the program to get rid
of anything vile, and replace the offensive category with an NSFW category."
---
# Background
> **(Selene)** Hi there. Unlike most of the blogs on here, I'll be narrating this one. This topic is closer to my heart,
> and requires less technical expertise than most of the others. I'll still defer to Ashe for any code changes, though.
> The gods know I can't grok C to save my life.
The [original fortune package](https://en.wikipedia.org/wiki/Fortune_(Unix)) was written in 1979, a good 43 years ago.
Obviously, times have changed since than, and the package itself has gone through several revisions and re-writes.
Fortunes have also been added, removed, and moved around.
There currently exist two maintained distributions. The [original BSD version](https://github.com/ahills/fortune),
repackaged to run on Alpine Linux, and [fortune-mod](https://github.com/shlomif/fortune-mod), which is a re-write in C.
## Why is this a problem?
Three Reasons:
1. A lot of the "offensive" fortunes are simply insensitive, mocking, or degrading by today's standards.
Even were they not, it sets a bad example to have a fortunes package that spits out slurs or homophobia[^1]
at people by default, even if it *is* gated behind a flag. If people truly want these fortunes, they should
be contained in their own package that distros can opt and out of as they please,
instead of everything being clubbed together.
2. Sensibilities have changed since the 1970s, and while some fortunes have been removed, a lot of the fortunes in these
packages would get you a stern talking-to if your manager saw it. These should live in an NSFW category.
While this overlaps with an "offensive" category, it is not the same thing.
3. As fortunes have been written, added, modified, and removed, the categories have gotten blurry and indistinct. The
fortunes themselves need a re-organisation and trim.
[^1]: Or Hitler quotes, for that matter.
## How do we fix this?
There's a number of problems here, but fundamentally, they are all organisational problems. As such, our first task is to tag each fortune as NSFW, a candidate for removal, or inaccurate in its category.
From there we can restructure the packages and propose these changes upstream.
## Where do we start?
We'll start with BSD's `fortune` package, as used in Alpine, for two reasons. For one, it is smaller than `fortunes-mod`. For two, the Alpine Linux maintainers tend to be relatively sensible, so this will be a good proving ground.
## Let's get to it
We started by mirroring the [fortune](https://github.com/ahills/fortune) package used on Alpine.
### First steps
The very first thing we'll do is move the default branch from `master` to `main`. This is a very small thing, but if we should be thorough if we're going to do this.
### Scanning through the fortunes
In the BSD/Alpine version, the fortunes are located in the `datfiles` directory, and the files we care about are:
- fortunes-o
- fortunes2-o
- limerick
These are noted as having the "offensive" fortunes, however we'll also give the non-offensive fortunes a scan. Since the fortunes in this version aren't categorised, we'll leave them uncategorised for now. Maybe a project for later.
> **(Doll)** Doll will remind Miss Selene about this another time!
>
> **(Selene)** Thanks Doll.
We've created a [full breakdown]({{< ref "lists/fortunes-cleanup" >}}) of each fortune that was removed, moved, or altered, and *why*, if you're interested. Content Notices for that page are **everything**. This is not a joke. I try to provide a summary near the top of the kinds
of content present, but it is not exhaustive, and fortunes are not individually marked and spoilered.
By the by, huge thanks to the Treehouse Systems community for helping us out with screening these.

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 */ -}}