diff --git a/_temp/create-empty-definitions-min.js b/_temp/create-empty-definitions-min.js new file mode 100644 index 00000000..bb543c16 --- /dev/null +++ b/_temp/create-empty-definitions-min.js @@ -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})} \ No newline at end of file diff --git a/_temp/create-empty-definitions.js b/_temp/create-empty-definitions.js new file mode 100644 index 00000000..8afe85a3 --- /dev/null +++ b/_temp/create-empty-definitions.js @@ -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 + }) +} diff --git a/_temp/undefined-words.json b/_temp/undefined-words.json new file mode 100644 index 00000000..63e4fe38 --- /dev/null +++ b/_temp/undefined-words.json @@ -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" + ] +} diff --git a/bin/create-definitions b/bin/create-definitions new file mode 100755 index 00000000..8d4bca94 --- /dev/null +++ b/bin/create-definitions @@ -0,0 +1,5 @@ +#!/usr/bin/env node + +require = require('esm')(module /*, options*/); + +require('../_temp/create-empty-definitions').createDefinitions() diff --git a/package-lock.json b/package-lock.json index 7c1f701a..763466b9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1344,6 +1344,12 @@ } } }, + "esm": { + "version": "3.2.25", + "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", + "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==", + "dev": true + }, "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", diff --git a/package.json b/package.json index 2ce1a6e5..62889594 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,11 @@ "build": "eleventy", "watch": "eleventy --watch", "serve": "eleventy --serve", - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "create-definitions": "bin/create-definitions" + }, + "bin": { + "create-definitions": "bin/create-definitions" }, "repository": { "type": "git", @@ -28,5 +32,9 @@ "markdown-it-anchor": "^5.2.5", "markdown-it-prism": "^2.0.3", "prism-themes": "^1.3.0" + }, + "devDependencies": { + "esm": "^3.2.25", + "slugify": "^1.3.6" } }