diff options
Diffstat (limited to 'src/content/dependencies/linkStationaryIndex.js')
-rw-r--r-- | src/content/dependencies/linkStationaryIndex.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/content/dependencies/linkStationaryIndex.js b/src/content/dependencies/linkStationaryIndex.js new file mode 100644 index 00000000..d5506e60 --- /dev/null +++ b/src/content/dependencies/linkStationaryIndex.js @@ -0,0 +1,24 @@ +// Not to be confused with "html.Stationery". + +export default { + contentDependencies: ['linkTemplate'], + extraDependencies: ['language'], + + relations(relation) { + return { + linkTemplate: relation('linkTemplate'), + }; + }, + + data(pathKey, stringKey) { + return {pathKey, stringKey}; + }, + + generate(data, relations, {language}) { + return relations.linkTemplate + .slots({ + path: [data.pathKey], + content: language.formatString(data.stringKey), + }); + } +} |