diff --git a/components/Header.vue b/components/Header.vue index dea3dc2ec..7aed2ac54 100644 --- a/components/Header.vue +++ b/components/Header.vue @@ -39,8 +39,6 @@ diff --git a/src/classes.js b/src/classes.js index 471216453..49664e904 100644 --- a/src/classes.js +++ b/src/classes.js @@ -347,3 +347,20 @@ export class Name { return false; } } + + +export class Person { + constructor(name, description, pronouns, sources = []) { + this.name = name; + this.description = description; + this.pronouns = {}; + for (let p of pronouns) { + const [language, display, link] = p.split(':'); + if (this.pronouns[language] === undefined) { + this.pronouns[language] = []; + } + this.pronouns[language].push({display: display, link: link}); + } + this.sources = sources; + } +} diff --git a/src/data.js b/src/data.js index ab33aa3d1..b1802fd81 100644 --- a/src/data.js +++ b/src/data.js @@ -1,4 +1,4 @@ -import { Source, Example, NounTemplate, TemplateGroup, TemplateLibrary, Name } from './classes' +import { Source, Example, NounTemplate, TemplateGroup, TemplateLibrary, Name, Person } from './classes' import { buildDict, buildList } from './helpers'; import { parseTemplates, getTemplate } from './buildTemplate'; @@ -115,3 +115,15 @@ export const names = buildDict(function* () { )]; } }); + +import peopleRaw from '../data/people.tsv'; +export const people = buildList(function* () { + for (let p of peopleRaw) { + yield new Person( + p.name, + p.description, + p.pronouns.split(','), + p.sources ? p.sources.split(',') : [], + ); + } +});