hexo-theme-stellar/scripts/events/lib/links.js

17 lines
376 B
JavaScript
Raw Normal View History

2024-01-02 20:19:49 +08:00
/**
* doc_tree.js v2 | https://github.com/xaoxuu/hexo-theme-stellar/
*/
'use strict';
module.exports = ctx => {
var allLinks = {}
const data = ctx.locals.get('data')
for (let key of Object.keys(data)) {
if (key.startsWith('links/')) {
let newKey = key.replace('links/', '')
allLinks[newKey] = data[key]
}
}
ctx.theme.config.links = allLinks
}