mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-24 05:05:20 -04:00
#117 slash-separated pronoun urls
This commit is contained in:
parent
e23c943f25
commit
a787f403a5
@ -34,6 +34,7 @@ pronouns:
|
|||||||
reflexive: '#self'
|
reflexive: '#self'
|
||||||
examples: ['💫', '💙']
|
examples: ['💫', '💙']
|
||||||
template: 'Open one of the examples and simply replace the emoji in the URL with your own.'
|
template: 'Open one of the examples and simply replace the emoji in the URL with your own.'
|
||||||
|
slashes: true
|
||||||
avoiding: false
|
avoiding: false
|
||||||
others: 'Other pronouns'
|
others: 'Other pronouns'
|
||||||
|
|
||||||
|
@ -51,6 +51,27 @@ export const buildPronoun = (pronouns, path) => {
|
|||||||
pronoun = buildPronounFromTemplate(path.substring(1), process.env.CONFIG.pronouns.null);
|
pronoun = buildPronounFromTemplate(path.substring(1), process.env.CONFIG.pronouns.null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const p = path.split('/').filter(s => !!s);
|
||||||
|
if (!pronoun && process.env.CONFIG.pronouns.slashes !== false && p.length === MORPHEMES.length) {
|
||||||
|
pronoun = new Pronoun(
|
||||||
|
`${p[0]}/${p[1]}`,
|
||||||
|
'',
|
||||||
|
false,
|
||||||
|
buildDict(function*() {
|
||||||
|
let i = 0;
|
||||||
|
for (let m of MORPHEMES) {
|
||||||
|
yield [m, p[i++]];
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
[ p[p.length - 1].endsWith('selves') ], // TODO English specific, extract somewhere
|
||||||
|
[ false ],
|
||||||
|
[],
|
||||||
|
[],
|
||||||
|
null,
|
||||||
|
false,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
return pronoun;
|
return pronoun;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user