reference/scripts/nodes/footer.mjs

26 lines
564 B
JavaScript
Raw Normal View History

2022-11-17 13:26:30 +08:00
import formatter from '@uiw/formatter';
2022-09-26 22:14:52 +08:00
2022-11-17 13:26:30 +08:00
export function footer(options = {}) {
2022-11-17 13:28:01 +08:00
let footerText = '© 2022 Kenny Wang.';
2022-11-17 13:26:30 +08:00
if (options.isHome) {
footerText += ` Updated on ${formatter('YYYY/MM/DD HH:mm:ss', new Date())}`;
}
2022-09-26 22:14:52 +08:00
return {
type: 'element',
tagName: 'footer',
properties: {
2022-09-28 13:35:52 +08:00
class: 'footer-wrap',
2022-09-26 22:14:52 +08:00
},
children: [
{
type: 'element',
tagName: 'footer',
properties: {
class: ['max-container'],
},
2022-11-17 13:26:30 +08:00
children: [{ type: 'text', value: footerText }],
},
2022-09-26 22:14:52 +08:00
],
};
}