mirror of
https://github.com/fooflington/selfdefined.git
synced 2025-06-12 13:41:40 +00:00
📄 Add Detail Pages for Definitions (#75)
* fix: untrack definitions in dist * feat(detail pages): update item link * feat(detail pages): add layout * feat(detail pages): render whole definition content * feat(detail pages): remove definitons from homepage * 🧹 def list component * feat(layout): render site footer in all pages * feat(detail pages): rename definition root class && move css into partials * chore: abstract further css into own files * feat(detail pages): update headling level of definition content * feat(styles): set box sizing * feat(styles): add margin bottom utility * feat(styles): selection * feat(components): sub page header own component * feat(detail pages): add sections * feat(style): mian headline * feat(page layout): rename page content grid * feat(page layout): add wide content class * feat(detail pages): set document title * feat(detail pages): set uniform document title for docs and definitions * feat(page title): add comment * feat(detail pages): add meta description * feat(detail pages): wrap def header in article tag * chore: set up ava * feat(filters): move permalink function into file, add test * chore: rename _temp to _util, remove creation script * feat(detail pages): helper function to find additional definitions * chore: move helpers to single directory * feat(detail pages): create shortcode for further definition navigation * feat(detail pages): fix find defs function * feat(detail pages): shortcode for browse nav markup * chore: fix collection mock data * feat(detail pages): render browse nav * feat(detail pages): style browse nav, style improvements * feat(detail pages): test redirect * feat(detail pages): client side redirect * feat(homepage): set title * 💅 * feat(detail pages): incorporate design changes * feat(detail pages): hide browse headlines * feat(detail pages): label lists * feat(footer): add aria label * feat(detail pages): redice heading level in md * feat(detail pages): spacing in browse nav * feat(detail pages): reduce line height * feat(detail pages): set max width w/o breaking homepage * feat(detail pages): replace in-definition definition links * 🧹 * feat(detail pages): recover spacing utility * 🧹 * chore(packages): update ava * config: specify nvm version * 💅 * 💅
This commit is contained in:
44
_util/_mocks/testCollection.json
Normal file
44
_util/_mocks/testCollection.json
Normal file
@ -0,0 +1,44 @@
|
||||
[
|
||||
{ "data": { "slug": "ok-hand", "title": "👌 [ok-hand]" } },
|
||||
{ "data": { "slug": "ableism", "title": "Ableism" } },
|
||||
{ "data": { "slug": "barbaric", "title": "Barbaric" } },
|
||||
{ "data": { "slug": "biromantic", "title": "Biromantic" } },
|
||||
{ "data": { "slug": "bisexual", "title": "Bisexual" } },
|
||||
{ "data": { "slug": "cisgender", "title": "Cisgender" } },
|
||||
{ "data": { "slug": "crazy", "title": "crazy" } },
|
||||
{
|
||||
"data": {
|
||||
"slug": "english-as-second-language",
|
||||
"title": "English as Second Language (ESL)"
|
||||
}
|
||||
},
|
||||
{ "data": { "slug": "fatphobia", "title": "Fatphobia" } },
|
||||
{ "data": { "slug": "gaslighting", "title": "Gaslighting" } },
|
||||
{ "data": { "slug": "minorities", "title": "minorities" } },
|
||||
{ "data": { "slug": "minoritised", "title": "minoritised" } },
|
||||
{ "data": { "slug": "non-binary", "title": "Non-binary" } },
|
||||
{
|
||||
"data": {
|
||||
"slug": "obsessive-compulsive-disorder",
|
||||
"title": "Obsessive Compulsive Disorder (OCD)"
|
||||
}
|
||||
},
|
||||
{ "data": { "slug": "pan-sexual", "title": "Pansexual" } },
|
||||
{
|
||||
"data": {
|
||||
"slug": "performative-allyship",
|
||||
"title": "performative allyship"
|
||||
}
|
||||
},
|
||||
{ "data": { "slug": "polyamory", "title": "Polyamory" } },
|
||||
{ "data": { "slug": "spaz", "title": "Spaz" } },
|
||||
{ "data": { "slug": "transgender", "title": "Transgender" } },
|
||||
{ "data": { "slug": "unreal", "title": "unreal" } },
|
||||
{ "data": { "slug": "white-fragility", "title": "White Fragility" } },
|
||||
{
|
||||
"data": {
|
||||
"slug": "women-and-people-of-colour",
|
||||
"title": "women and people of colour"
|
||||
}
|
||||
}
|
||||
]
|
1
_util/create-empty-definitions-min.js
vendored
Normal file
1
_util/create-empty-definitions-min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
import slugify from"slugify";import path from"path";import fs from"fs";import{promisify}from"util";const writeFile=promisify(fs.writeFile);import{words}from"./undefined-words";const defintionPath=path.resolve(process.cwd(),"11ty/definitions/"),template="\n---\ntitle: {{title}}\nslug: {{slug}}\ndefined: false\n---\n";export function createDefinitions(){return words.forEach(async t=>{const e=t,i=slugify(t.toLowerCase().replace(/ \([a-z]+\)| ([a-z-]+) slur/i,"")),r=template.replace("{{title}}",e).replace("{{slug}}",i).trim();try{await writeFile(`${defintionPath}/${i}.md`,r,"utf8")}catch(t){console.error(t),process.exit(1)}return!0})}
|
36
_util/create-empty-definitions.js
Normal file
36
_util/create-empty-definitions.js
Normal file
@ -0,0 +1,36 @@
|
||||
import slugify from 'slugify'
|
||||
import path from 'path'
|
||||
import fs from 'fs'
|
||||
import { promisify } from 'util'
|
||||
|
||||
const writeFile = promisify(fs.writeFile)
|
||||
|
||||
import { words } from './undefined-words'
|
||||
const defintionPath = path.resolve(process.cwd(), '11ty/definitions/')
|
||||
|
||||
const template = `
|
||||
---
|
||||
title: {{title}}
|
||||
slug: {{slug}}
|
||||
defined: false
|
||||
---
|
||||
`
|
||||
|
||||
export function createDefinitions() {
|
||||
return words.forEach(async (word) => {
|
||||
const title = word
|
||||
const slug = slugify(word.toLowerCase().replace(/ \([a-z]+\)| ([a-z-]+) slur/i, ''))
|
||||
|
||||
const content = template.replace('{{title}}', title).replace('{{slug}}', slug).trim()
|
||||
|
||||
try {
|
||||
await writeFile(`${defintionPath}/${slug}.md`, content, 'utf8')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
return true
|
||||
})
|
||||
}
|
162
_util/undefined-words.json
Normal file
162
_util/undefined-words.json
Normal file
@ -0,0 +1,162 @@
|
||||
{
|
||||
"words": [
|
||||
"Ableism",
|
||||
"American",
|
||||
"Ambulatory Wheelchair",
|
||||
"Ancestors",
|
||||
"Anti-",
|
||||
"Anxiety disorders",
|
||||
"aromantic",
|
||||
"Asian",
|
||||
"asexual",
|
||||
"Acquired Immune Deficiency Syndrome (AIDS)",
|
||||
"assigned at birth",
|
||||
"Attraction",
|
||||
"Attention-Deficit/Hyperactivity Disorder (ADHD)",
|
||||
"Autism spectrum",
|
||||
"Bias",
|
||||
"Bierasure",
|
||||
"Bipolar medical appropriation",
|
||||
"Black Asian Minority Ethnic (BAME)",
|
||||
"Black Indigenous People of Color (BIPOC)",
|
||||
"Black",
|
||||
"Brown",
|
||||
"Bropropriating",
|
||||
"Burka",
|
||||
"Child of a Deaf Adult (CODA)",
|
||||
"Climate change",
|
||||
"Colonial narrative",
|
||||
"Colonialism",
|
||||
"colorism",
|
||||
"Complex Post-Traumatic Stress Disorder (PTSD)",
|
||||
"cultural appropriation",
|
||||
"Crippled ableist slur",
|
||||
"Demi",
|
||||
"deaf and Deaf",
|
||||
"Disability",
|
||||
"Disabled",
|
||||
"Discordant couples",
|
||||
"Discrimination",
|
||||
"Dominant culture",
|
||||
"Dominant culture habits",
|
||||
"Ehlers-Danlos Syndromes (EDS)",
|
||||
"Egalitarian",
|
||||
"Empathy",
|
||||
"enby",
|
||||
"Entitlement",
|
||||
"Equality",
|
||||
"Equity",
|
||||
"Ethnicity",
|
||||
"Fat",
|
||||
"Fem",
|
||||
"Femme",
|
||||
"Gender",
|
||||
"Gender confirmation surgery (GCS)",
|
||||
"Gender pronouns",
|
||||
"Genocide",
|
||||
"Governmentality",
|
||||
"gray ace",
|
||||
"Gray asexuality",
|
||||
"Hard of Hearing (HOH)",
|
||||
"hegemonic",
|
||||
"Hermaphrodite",
|
||||
"High-Functioning",
|
||||
"Hijab",
|
||||
"Hispanic",
|
||||
"Human Immunodeficiency Virus (HIV)",
|
||||
"Homophobia",
|
||||
"Hormone Replacement Therapy (HRT)",
|
||||
"Idiot ableist slur",
|
||||
"Illness",
|
||||
"Immigrant",
|
||||
"Impact",
|
||||
"Implicit bias",
|
||||
"Indigenous",
|
||||
"Inherent",
|
||||
"Intent",
|
||||
"internalized oppression",
|
||||
"Intersectionality",
|
||||
"intersex",
|
||||
"invisible disabilities",
|
||||
"Jihad",
|
||||
"Lame ableist slur",
|
||||
"Latinx",
|
||||
"Lunatic ableist slur",
|
||||
"Maniac ableist slur",
|
||||
"Marginalized",
|
||||
"Matriarchy",
|
||||
"Medication sensitive",
|
||||
"Midget ableist slur",
|
||||
"Militarisation",
|
||||
"Misogynoir",
|
||||
"Moron ableist slur",
|
||||
"Neurodivergent",
|
||||
"Neurodiverse",
|
||||
"Neurotypical",
|
||||
"N-word racist slur",
|
||||
"-normative",
|
||||
"nuts ableist slur",
|
||||
"Obese anti-fat slur",
|
||||
"Oppression",
|
||||
"Other specified feeding or eating disorders (OSFED)",
|
||||
"Panic attacks",
|
||||
"-passing",
|
||||
"Parachuting",
|
||||
"Patriarchy",
|
||||
"People of Color (PoC)",
|
||||
"People with disabilities",
|
||||
"-phile",
|
||||
"-phobia",
|
||||
"Platonic",
|
||||
"Positivism",
|
||||
"Post-Traumatic Stress Disorder (PTSD)",
|
||||
"power",
|
||||
"Poz",
|
||||
"Prejudice",
|
||||
"Pride",
|
||||
"Prophylaxis",
|
||||
"Privilege",
|
||||
"Psych ableist slur",
|
||||
"Psychopath ableist slur",
|
||||
"Race",
|
||||
"Racism",
|
||||
"Racist",
|
||||
"R-tard ableist slur",
|
||||
"Savage racist slur",
|
||||
"Savior",
|
||||
"Semitic",
|
||||
"Serodiscordant",
|
||||
"settler",
|
||||
"Sexual",
|
||||
"Socially constructed",
|
||||
"Solidarity",
|
||||
"Spaz ableist slur",
|
||||
"-Splaining",
|
||||
"Spirit animalcultural appropriation",
|
||||
"Stupid ableist slur",
|
||||
"Systematic",
|
||||
"Systemic",
|
||||
"-tard ableist slur",
|
||||
"Top-down approach",
|
||||
"Totemic animal",
|
||||
"Tawhid",
|
||||
"Tranny anti-trans slur",
|
||||
"Trans",
|
||||
"Trans Exclusionary Radical Feminist (TERF)",
|
||||
"Tribe",
|
||||
"Triggers",
|
||||
"Two-spirited",
|
||||
"Undetectable=Untransmittable (U=U)",
|
||||
"Undetectable",
|
||||
"Unqueer",
|
||||
"Indigenous",
|
||||
"Vertigo",
|
||||
"Vestibular migraine",
|
||||
"Violence against women and girls (VAWG)",
|
||||
"Viral Load",
|
||||
"White",
|
||||
"White supremacist capitalist patriarchy",
|
||||
"womanism",
|
||||
"womxn"
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user