[v0.3.1] Removes footer completely when config.author is null or empty

This commit is contained in:
sup39 2023-03-21 22:57:51 +09:00
parent 9c32cea6b8
commit f7f688196d
7 changed files with 12 additions and 10 deletions

View file

@ -1,4 +1,6 @@
# ChangeLog
## v0.3.1
- Removes footer completely when config.author is null or empty
## v0.3.0
- Uses `@sup39/mdx-nav` v0.3.0, which
- changed `Link` (next/link) to `a`

4
dist/index.esm.js vendored
View file

@ -7,12 +7,12 @@ function Footer(_a) {
var year = new Date().getFullYear();
var _b = config.site, _c = _b.startYear, year0 = _c === void 0 ? year : _c, author = _b.author;
var yearStr = year > year0 ? "".concat(year0, "-").concat(year) : year;
return React.createElement("footer", null, author && React.createElement("div", null,
return author ? React.createElement("footer", null, React.createElement("div", null,
"Copyright \u00A9 ",
yearStr,
" ",
author,
" All rights reserved."));
" All rights reserved.")) : React.createElement(React.Fragment, null);
}
/******************************************************************************

File diff suppressed because one or more lines are too long

4
dist/index.js vendored
View file

@ -9,12 +9,12 @@ function Footer(_a) {
var year = new Date().getFullYear();
var _b = config.site, _c = _b.startYear, year0 = _c === void 0 ? year : _c, author = _b.author;
var yearStr = year > year0 ? "".concat(year0, "-").concat(year) : year;
return React.createElement("footer", null, author && React.createElement("div", null,
return author ? React.createElement("footer", null, React.createElement("div", null,
"Copyright \u00A9 ",
yearStr,
" ",
author,
" All rights reserved."));
" All rights reserved.")) : React.createElement(React.Fragment, null);
}
/******************************************************************************

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,6 @@
{
"name": "@sup39/mdx-page",
"version": "0.3.0",
"version": "0.3.1",
"author": "sup39 <dev@sup39.dev>",
"repository": "github.com:sup39/supMDX-page",
"description": "Page component for supMDX",

View file

@ -10,7 +10,7 @@ export function Footer({config}: {config: FooterConfig}) {
const year = new Date().getFullYear();
const {site: {startYear: year0 = year, author}} = config;
const yearStr = year>year0 ? `${year0}-${year}` : year;
return <footer>{
author && <div>Copyright © {yearStr} {author} All rights reserved.</div>
}</footer>;
return author ? <footer>{
<div>Copyright © {yearStr} {author} All rights reserved.</div>
}</footer> : <></>;
}