Add last updated to note pages

This commit is contained in:
2024-10-10 01:58:33 -04:00
parent c2e1817567
commit 7500465542
4 changed files with 31 additions and 2 deletions

View File

@@ -8,8 +8,11 @@ import remarkGithubAdmonitionsToDirectives from 'remark-github-admonitions-to-di
import Layout from '../../components/layout';
import readMarkdown from '../../lib/read-markdown';
import { toLocaleString } from '../../lib/date';
import NotesInfo from '../../public/notes.json';
import style from '../../styles/note.module.css';
interface Note {
title: string,
mtime: string,
@@ -50,6 +53,9 @@ function Markdown({ content }: any) {
function Note({ note }: any) {
return (<>
<Layout >
<span className={style['last-updated']}>
Last updated: {toLocaleString(note.mtime)}
</span>
<section className='block'>
<Markdown content={note.content} />
</section>