mirror of
https://github.com/Lumither/nocturne.git
synced 2026-10-17 10:26:21 +00:00
fix(blog::post::footer) remove update_date section if undefined
This commit is contained in:
1 file changed
+3
-1
@@ -17,7 +17,7 @@ const Footer = (props: Props) => {
|
|||||||
const author = post['meta']['author'] ?? 'Tao';
|
const author = post['meta']['author'] ?? 'Tao';
|
||||||
const author_link = post['meta']['author_link'] ?? '/about';
|
const author_link = post['meta']['author_link'] ?? '/about';
|
||||||
const post_date = new Date(post['first_update']);
|
const post_date = new Date(post['first_update']);
|
||||||
const update_date = new Date(post['last_update']);
|
const update_date: Date | undefined = post['last_update'] ? new Date(post['last_update']) : undefined;
|
||||||
const cc = post['meta']['cc'] ?? 'by-nc-sa';
|
const cc = post['meta']['cc'] ?? 'by-nc-sa';
|
||||||
|
|
||||||
|
|
||||||
@@ -55,6 +55,7 @@ const Footer = (props: Props) => {
|
|||||||
year: `numeric`
|
year: `numeric`
|
||||||
}) }</p>
|
}) }</p>
|
||||||
</div>
|
</div>
|
||||||
|
{ update_date &&
|
||||||
<div>
|
<div>
|
||||||
<p className={ 'text-lg font-bold' }>Updated on</p>
|
<p className={ 'text-lg font-bold' }>Updated on</p>
|
||||||
<p>{ update_date.toLocaleString('default', {
|
<p>{ update_date.toLocaleString('default', {
|
||||||
@@ -63,6 +64,7 @@ const Footer = (props: Props) => {
|
|||||||
year: `numeric`
|
year: `numeric`
|
||||||
}) }</p>
|
}) }</p>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
<div>
|
<div>
|
||||||
<p className={ 'text-lg font-bold' }>Published under</p>
|
<p className={ 'text-lg font-bold' }>Published under</p>
|
||||||
<Link href={ `https://creativecommons.org/licenses/${ cc }/4.0/` }>
|
<Link href={ `https://creativecommons.org/licenses/${ cc }/4.0/` }>
|
||||||
|
|||||||
Reference in new issue
Block a user