mirror of
https://codeberg.org/uzu/strudel
synced 2026-09-05 14:58:03 -04:00
fix: ignore empty names
This commit is contained in:
@@ -13,15 +13,17 @@ export const getSynonyms = (doc) => {
|
||||
|
||||
export function getStaticPaths() {
|
||||
let paths: any = [];
|
||||
docs.forEach((doc) => {
|
||||
paths.push({ params: { ref: doc.name } });
|
||||
const synonyms = getSynonyms(doc);
|
||||
if (synonyms) {
|
||||
synonyms.forEach((synonym) => {
|
||||
paths.push({ params: { ref: synonym } });
|
||||
});
|
||||
}
|
||||
});
|
||||
docs
|
||||
.filter((doc) => !!doc.name)
|
||||
.forEach((doc) => {
|
||||
paths.push({ params: { ref: doc.name } });
|
||||
const synonyms = getSynonyms(doc);
|
||||
if (synonyms) {
|
||||
synonyms.forEach((synonym) => {
|
||||
paths.push({ params: { ref: synonym } });
|
||||
});
|
||||
}
|
||||
});
|
||||
return paths;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user