From e05706cf488bcec6e4c5494a622eedfc4e47d763 Mon Sep 17 00:00:00 2001 From: Christine Tham Date: Sun, 31 Mar 2024 19:48:37 +1100 Subject: [PATCH] v4.0..0 --- README.md | 9 ++- package.json | 4 +- pnpm-lock.yaml | 58 +++++++++---------- src/components/blogcard.astro | 42 ++++++++------ src/components/bloghero.astro | 25 ++++---- src/components/blogroll.astro | 7 ++- src/components/carousel.astro | 3 - src/components/categories.astro | 2 + src/components/latestarticles.astro | 18 ++++-- src/components/leftsidebar.astro | 7 ++- src/components/lightbox.astro | 6 +- src/components/map.astro | 19 +++--- src/components/nextprev.astro | 4 +- src/components/pagecontent.astro | 7 ++- src/components/pagehero.astro | 28 ++++----- src/components/seo.astro | 20 +++---- src/config.ts | 16 ++--- src/content/author/default.md | 2 +- src/content/blog/2000-01-01-template.md | 2 +- src/content/blog/2022-08-09-mit-licence.md | 2 +- .../blog/2022-08-10-markdown-cheat-sheet.md | 2 +- .../blog/2022-08-19-sample-carousel.mdx | 2 +- .../blog/2022-08-20-mermaid-diagrams.md | 2 +- .../2022-08-21-sample-gallery-post-mdx.mdx | 2 +- ...2022-08-22-sample-gallery-post-markdown.md | 2 +- .../blog/2022-08-22-sample-images-post.md | 2 +- .../blog/2022-08-23-sample-mdx-post.mdx | 2 +- src/content/blog/2022-08-24-math-equations.md | 2 +- .../blog/2022-08-25-plantuml-diagrams.md | 2 +- .../blog/2022-08-26-markmap-diagrams.md | 2 +- ...023-06-10-sample-gallery-post-markdoc.mdoc | 2 +- src/content/blog/2023-06-11-how-to-use.md | 2 +- src/content/blog/2023-06-13-roadmap.md | 2 +- src/content/config.ts | 8 +-- src/content/page/about.md | 2 +- src/content/page/privacy.md | 2 +- src/layouts/base.astro | 17 +++--- src/layouts/blog.astro | 2 +- src/layouts/doc.astro | 6 +- src/layouts/page.astro | 1 + src/pages/author/[author]/[...page].astro | 10 ++-- src/pages/blog/[...page].astro | 8 +-- src/pages/blog/[slug].astro | 8 +-- src/pages/carousel.astro | 10 +--- src/pages/category/[category]/[...page].astro | 9 ++- src/pages/contact.astro | 6 +- src/pages/index.astro | 10 +--- src/pages/rss.xml.js | 49 +++++++++++----- src/pages/search-docs.json.js | 10 +++- src/pages/search-index.json.js | 10 ++-- src/pages/tag/[tag]/[...page].astro | 12 ++-- src/pages/tags.astro | 17 +++--- tsconfig.json | 5 +- 53 files changed, 269 insertions(+), 240 deletions(-) diff --git a/README.md b/README.md index 92ab06b..acbd2d4 100644 --- a/README.md +++ b/README.md @@ -231,6 +231,11 @@ All commands are run from the root of the project, from a terminal: - Make BlogHero accept post as props rather than frontmatter - Moved Markdown pages to content collection - Eliminated Frontmatter type -- 3.4.1: Maintenance: +- 4.0.0: Major changes: - Updated packages - - Removed @types/photoswipe and photoswipe tsconfig \ No newline at end of file + - Removed @types/photoswipe and photoswipe tsconfig + - Moved to RSS schema + - getPosts() function + - schema tags + - automatically generated sidebar links + - improved RSS and search metadata diff --git a/package.json b/package.json index 0775ff6..9571fe6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "hello-astro", "description": "Hello Astro is a full featured Astro corporate/marketing/blog starter theme written in Typescript and TailwindCSS. It supports Markdown and MDX based pages and blog posts.", - "version": "3.4.1", + "version": "4.0.0", "scripts": { "dev": "astro dev", "clean": "rm -rf node_modules .astro dist", @@ -50,7 +50,7 @@ "tailwindcss": "^3.4.3", "typescript": "~5.4.3", "unist-util-visit": "^5.0.0", - "vite": "^5.2.6" + "vite": "^5.2.7" }, "dependencies": { "@astrojs/check": "^0.5.10", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3bd0dc3..58ab563 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -158,8 +158,8 @@ devDependencies: specifier: ^5.0.0 version: 5.0.0 vite: - specifier: ^5.2.6 - version: 5.2.6 + specifier: ^5.2.7 + version: 5.2.7 packages: @@ -1424,13 +1424,13 @@ packages: /@types/cheerio@0.22.35: resolution: {integrity: sha512-yD57BchKRvTV+JD53UZ6PD8KWY5g5rvvMLRnZR3EQBCZXiDT/HR+pKpMzFGlWNhFrXlo7VPZXtKvIEwZkAWOIA==} dependencies: - '@types/node': 20.11.30 + '@types/node': 20.12.2 dev: false /@types/concat-stream@2.0.3: resolution: {integrity: sha512-3qe4oQAPNwVNwK4C9c8u+VJqv9kez+2MR4qJpoPFfXtgxxif1QbFusvXzK0/Wra2VX07smostI2VMmJNSpZjuQ==} dependencies: - '@types/node': 20.11.30 + '@types/node': 20.12.2 dev: true /@types/d3-scale-chromatic@3.0.3: @@ -1531,8 +1531,8 @@ packages: resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==} dev: true - /@types/node@20.11.30: - resolution: {integrity: sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==} + /@types/node@20.12.2: + resolution: {integrity: sha512-zQ0NYO87hyN6Xrclcqp7f8ZbXNbRfoGWNcMvHTPQp9UUrwI0mI7XBz+cu7/W6/VClYo2g63B0cjull/srU7LgQ==} dependencies: undici-types: 5.26.5 @@ -1549,7 +1549,7 @@ packages: /@types/tar@6.1.11: resolution: {integrity: sha512-ThA1WD8aDdVU4VLuyq5NEqriwXErF5gEIJeyT6gHBWU7JtSmW2a5qjNv3/vR82O20mW+1vhmeZJfBQPT3HCugg==} dependencies: - '@types/node': 20.11.30 + '@types/node': 20.12.2 minipass: 4.2.8 dev: false @@ -1563,7 +1563,7 @@ packages: resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} requiresBuild: true dependencies: - '@types/node': 20.11.30 + '@types/node': 20.12.2 dev: false optional: true @@ -1851,7 +1851,7 @@ packages: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.23.2 + es-abstract: 1.23.3 es-object-atoms: 1.0.0 get-intrinsic: 1.2.4 is-string: 1.0.7 @@ -1871,7 +1871,7 @@ packages: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.23.2 + es-abstract: 1.23.3 es-shim-unscopables: 1.0.2 dev: true @@ -1881,7 +1881,7 @@ packages: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.23.2 + es-abstract: 1.23.3 es-shim-unscopables: 1.0.2 dev: true @@ -1892,7 +1892,7 @@ packages: array-buffer-byte-length: 1.0.1 call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.23.2 + es-abstract: 1.23.3 es-errors: 1.3.0 get-intrinsic: 1.2.4 is-array-buffer: 3.0.4 @@ -2013,8 +2013,8 @@ packages: tsconfck: 3.0.3(typescript@5.4.3) unist-util-visit: 5.0.0 vfile: 6.0.1 - vite: 5.2.6 - vitefu: 0.2.5(vite@5.2.6) + vite: 5.2.7 + vitefu: 0.2.5(vite@5.2.7) which-pm: 2.1.1 yargs-parser: 21.1.1 zod: 3.22.4 @@ -2188,7 +2188,7 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001600 - electron-to-chromium: 1.4.720 + electron-to-chromium: 1.4.722 node-releases: 2.0.14 update-browserslist-db: 1.0.13(browserslist@4.23.0) @@ -2994,8 +2994,8 @@ packages: /eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - /electron-to-chromium@1.4.720: - resolution: {integrity: sha512-5zwcKNkOj3GN0jBzpcpGonNPkn667VJpQwRYWdo/TiJEHTQswZyA/vALhZFiAXgL5NuK9UarX1tbdvXu3hG6Yw==} + /electron-to-chromium@1.4.722: + resolution: {integrity: sha512-5nLE0TWFFpZ80Crhtp4pIp8LXCztjYX41yUcV6b+bKR2PqzjskTMOOlBi1VjBHlvHwS+4gar7kNKOrsbsewEZQ==} /elkjs@0.9.2: resolution: {integrity: sha512-2Y/RaA1pdgSHpY0YG4TYuYCD2wh97CRvu22eLG3Kz0pgQ/6KbIFTxsTnDc4MH/6hFlg2L/9qXrDMG0nMjP63iw==} @@ -3041,8 +3041,8 @@ packages: is-arrayish: 0.2.1 dev: true - /es-abstract@1.23.2: - resolution: {integrity: sha512-60s3Xv2T2p1ICykc7c+DNDPLDMm9t4QxCOUU0K9JxiLjM3C1zB9YVdN7tjxrFd4+AkZ8CdX1ovUga4P2+1e+/w==} + /es-abstract@1.23.3: + resolution: {integrity: sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==} engines: {node: '>= 0.4'} dependencies: array-buffer-byte-length: 1.0.1 @@ -3111,7 +3111,7 @@ packages: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.23.2 + es-abstract: 1.23.3 es-errors: 1.3.0 es-set-tostringtag: 2.0.3 function-bind: 1.1.2 @@ -3734,7 +3734,7 @@ packages: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.23.2 + es-abstract: 1.23.3 functions-have-names: 1.2.3 dev: true @@ -5813,7 +5813,7 @@ packages: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.23.2 + es-abstract: 1.23.3 es-object-atoms: 1.0.0 dev: true @@ -6359,7 +6359,7 @@ packages: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.23.2 + es-abstract: 1.23.3 es-errors: 1.3.0 get-intrinsic: 1.2.4 globalthis: 1.0.3 @@ -6861,7 +6861,7 @@ packages: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.23.2 + es-abstract: 1.23.3 es-object-atoms: 1.0.0 dev: true @@ -7293,7 +7293,7 @@ packages: '@types/concat-stream': 2.0.3 '@types/debug': 4.1.12 '@types/is-empty': 1.2.3 - '@types/node': 20.11.30 + '@types/node': 20.12.2 '@types/unist': 3.0.2 '@ungap/structured-clone': 1.2.0 concat-stream: 2.0.0 @@ -7549,8 +7549,8 @@ packages: unist-util-stringify-position: 4.0.0 vfile-message: 4.0.2 - /vite@5.2.6: - resolution: {integrity: sha512-FPtnxFlSIKYjZ2eosBQamz4CbyrTizbZ3hnGJlh/wMtCrlp1Hah6AzBLjGI5I2urTfNnpovpHdrL6YRuBOPnCA==} + /vite@5.2.7: + resolution: {integrity: sha512-k14PWOKLI6pMaSzAuGtT+Cf0YmIx12z9YGon39onaJNy8DLBfBJrzg9FQEmkAM5lpHBZs9wksWAsyF/HkpEwJA==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: @@ -7583,7 +7583,7 @@ packages: optionalDependencies: fsevents: 2.3.3 - /vitefu@0.2.5(vite@5.2.6): + /vitefu@0.2.5(vite@5.2.7): resolution: {integrity: sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==} peerDependencies: vite: ^3.0.0 || ^4.0.0 || ^5.0.0 @@ -7591,7 +7591,7 @@ packages: vite: optional: true dependencies: - vite: 5.2.6 + vite: 5.2.7 /volar-service-css@0.0.34(@volar/language-service@2.1.6): resolution: {integrity: sha512-C7ua0j80ZD7bsgALAz/cA1bykPehoIa5n+3+Ccr+YLpj0fypqw9iLUmGLX11CqzqNCO2XFGe/1eXB/c+SWrF/g==} diff --git a/src/components/blogcard.astro b/src/components/blogcard.astro index 0c127f2..126f5c4 100644 --- a/src/components/blogcard.astro +++ b/src/components/blogcard.astro @@ -38,43 +38,51 @@ if (post.data.author) { alt={post.data.title + ' featured image'} class='relative h-64 w-full overflow-hidden rounded-lg bg-purple-100 object-cover object-center group-hover:opacity-75 dark:bg-purple-800' /> -

{post.data.title}

+

{post.data.title}

{post.data.categories && } - +
- - - {post.data.publishDate.toDateString()} - { - post.data.minutesRead && ( - - - {post.data.minutesRead} + post.data.pubDate && ( + ) } { - post.data.author && ( - - - {author.data.title} + post.data.minutesRead && ( + + + {post.data.minutesRead} ) } +
-

+

{post.data.description}

diff --git a/src/components/bloghero.astro b/src/components/bloghero.astro index fce1672..53b6ae9 100644 --- a/src/components/bloghero.astro +++ b/src/components/bloghero.astro @@ -34,6 +34,7 @@ if (post.data.author) { >
featured image + + {author.data.title} + {author.data.title} + { - post.data.author && ( + post.data.pubDate && ( - {author.data.title} - {author.data.title} + + {post.data.pubDate.toString()} ) } - - - - {new Date(post.data.publishDate).toString()} - - { post.data.minutesRead && ( diff --git a/src/components/blogroll.astro b/src/components/blogroll.astro index 761bd18..4ce334b 100644 --- a/src/components/blogroll.astro +++ b/src/components/blogroll.astro @@ -9,6 +9,11 @@ export interface Props { const { posts } = Astro.props --- -
+
{posts.map((post) => )}
diff --git a/src/components/carousel.astro b/src/components/carousel.astro index 9cfd2d6..a8f72b7 100644 --- a/src/components/carousel.astro +++ b/src/components/carousel.astro @@ -54,9 +54,6 @@ const images = folderFiles.map((image) => imageFiles[image]) // @ts-ignore import Swiper from 'swiper/bundle' - // import Swiper styles - import 'swiper/css/bundle' - new Swiper('.mySwiper', { cssMode: true, // lazy: true, diff --git a/src/components/categories.astro b/src/components/categories.astro index e304dbc..9a7a30d 100644 --- a/src/components/categories.astro +++ b/src/components/categories.astro @@ -2,6 +2,7 @@ import { getEntries } from 'astro:content' const { categories } = Astro.props + const cats = await getEntries(categories) --- @@ -10,6 +11,7 @@ const cats = await getEntries(categories)
{cats.map((category) => ( diff --git a/src/components/latestarticles.astro b/src/components/latestarticles.astro index c44b9ac..035374a 100644 --- a/src/components/latestarticles.astro +++ b/src/components/latestarticles.astro @@ -72,9 +72,13 @@ const otherPosts = posts.slice(1, 5) {newestPost.data.title} -

- {newestPost.data.publishDate?.toDateString()} -

+ { + newestPost.data.pubDate && ( +

+ {newestPost.data.pubDate.toDateString()} +

+ ) + }

{newestPost.data.description}

@@ -114,9 +118,11 @@ const otherPosts = posts.slice(1, 5) {post.data.title}
-

- {post.data.publishDate?.toDateString()} -

+ {post.data.pubDate && ( +

+ {post.data.pubDate.toDateString()} +

+ )}

{post.data.description}

diff --git a/src/components/leftsidebar.astro b/src/components/leftsidebar.astro index c3c9676..d133254 100644 --- a/src/components/leftsidebar.astro +++ b/src/components/leftsidebar.astro @@ -1,11 +1,12 @@ --- -import { SIDEBAR } from '../config' +import type { Sidebar } from '../config' type Props = { currentPage: string + sidebar: Sidebar } -const { currentPage } = Astro.props as Props +const { currentPage, sidebar } = Astro.props const currentPageMatch = currentPage.slice(1) --- @@ -15,7 +16,7 @@ const currentPageMatch = currentPage.slice(1)