website: update footer. #102

This commit is contained in:
jaywcjlove
2022-11-17 13:26:30 +08:00
parent 13e67d63ac
commit 709aef66fb
4 changed files with 11 additions and 6 deletions

View File

@ -1,5 +1,10 @@
import formatter from '@uiw/formatter';
export function footer() {
export function footer(options = {}) {
const footerText = '© 2022 Kenny Wang.';
if (options.isHome) {
footerText += ` Updated on ${formatter('YYYY/MM/DD HH:mm:ss', new Date())}`;
}
return {
type: 'element',
tagName: 'footer',
@ -13,10 +18,8 @@ export function footer() {
properties: {
class: ['max-container'],
},
children: [
{ type: 'text', value: '© 2022 Kenny Wang, All rights reserved.' }
],
}
children: [{ type: 'text', value: footerText }],
},
],
};
}