Skip to content

Commit

Permalink
website: update footer. #102
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Nov 17, 2022
1 parent 13e67d6 commit 709aef6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
},
"keywords": [],
"devDependencies": {
"@uiw/formatter": "^1.3.3",
"@wcj/markdown-to-html": "^2.1.2",
"chokidar": "^3.5.3",
"fs-extra": "^10.1.0",
Expand Down
2 changes: 1 addition & 1 deletion scripts/create.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export function create(str = '', options = {}) {
node.children = tocsData;
}
node.children.unshift(header(options));
node.children.push(footer());
node.children.push(footer(options));
node.children.push(anchorPoint());
}
}
Expand Down
13 changes: 8 additions & 5 deletions scripts/nodes/footer.mjs
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -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 }],
},
],
};
}
1 change: 1 addition & 0 deletions scripts/style/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1196,6 +1196,7 @@ body:not(.home) .h2wrap-body > .wrap:hover .h3wrap > h3 a::after {
color: rgb(100 116 139/1);
background-color: var(--color-canvas-subtle);
text-align: center;
font-size: 0.75rem;
}

@media (min-width: 1024px) {
Expand Down

0 comments on commit 709aef6

Please sign in to comment.