From c0a63a4a97a342897f9a48d8bb6ae4cc13e73a5d Mon Sep 17 00:00:00 2001 From: Henry-Hiles Date: Mon, 19 Jun 2023 10:57:04 -0400 Subject: [PATCH] Many many changes --- package.json | 5 +- pnpm-lock.yaml | 16 +++++ public/{images => }/favicon-16x16.png | Bin public/{images => }/favicon-32x32.png | Bin public/{images => }/favicon.ico | Bin public/rss.xsl | 87 ++++++++++++++++++++++++++ src/components/BlogPost.astro | 28 +++++++++ src/components/Top.astro | 2 +- src/content/blog/test copy 2.md | 6 ++ src/content/blog/test copy 3.md | 6 ++ src/content/blog/test copy 4.md | 6 ++ src/content/blog/test copy.md | 6 ++ src/content/blog/test.md | 6 ++ src/content/blog/welcome.md | 4 ++ src/layouts/Layout.astro | 15 +++-- src/pages/blog/[slug].astro | 20 ++++++ src/pages/blog/index.astro | 62 ++++++++++++++++++ src/pages/blog/rss.xml.js | 24 +++++++ src/styles/Blog.module.css | 52 +++++++++++++++ src/styles/BlogPost.module.css | 44 +++++++++++++ src/styles/Button.module.css | 6 +- src/styles/Jumbo.module.css | 2 +- src/styles/Layout.css | 28 +++++++-- 23 files changed, 405 insertions(+), 20 deletions(-) rename public/{images => }/favicon-16x16.png (100%) rename public/{images => }/favicon-32x32.png (100%) rename public/{images => }/favicon.ico (100%) create mode 100644 public/rss.xsl create mode 100644 src/components/BlogPost.astro create mode 100644 src/content/blog/test copy 2.md create mode 100644 src/content/blog/test copy 3.md create mode 100644 src/content/blog/test copy 4.md create mode 100644 src/content/blog/test copy.md create mode 100644 src/content/blog/test.md create mode 100644 src/content/blog/welcome.md create mode 100644 src/pages/blog/[slug].astro create mode 100644 src/pages/blog/index.astro create mode 100644 src/pages/blog/rss.xml.js create mode 100644 src/styles/Blog.module.css create mode 100644 src/styles/BlogPost.module.css diff --git a/package.json b/package.json index 84d8932..94018ec 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,11 @@ "astro": "astro" }, "dependencies": { + ",mmarked": "link:@types/,mmarked", "@astrojs/rss": "^2.4.3", + "@types/marked": "^5.0.0", "astro": "^2.6.4", - "astro-icon": "^0.8.1" + "astro-icon": "^0.8.1", + "marked": "^5.1.0" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ef3dcb8..530816c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,14 +1,20 @@ lockfileVersion: 5.4 specifiers: + ',mmarked': link:@types/,mmarked '@astrojs/rss': ^2.4.3 + '@types/marked': ^5.0.0 astro: ^2.6.4 astro-icon: ^0.8.1 + marked: ^5.1.0 dependencies: + ',mmarked': link:@types/,mmarked '@astrojs/rss': 2.4.3 + '@types/marked': 5.0.0 astro: 2.6.4 astro-icon: 0.8.1 + marked: 5.1.0 packages: @@ -672,6 +678,10 @@ packages: resolution: {integrity: sha512-sqm9g7mHlPY/43fcSNrCYfOeX9zkTTK+euO5E6+CVijSMm5tTjkVdwdqRkY3ljjIAf8679vps5jKUoJBCLsMDA==} dev: false + /@types/marked/5.0.0: + resolution: {integrity: sha512-YcZe50jhltsCq7rc9MNZC/4QB/OnA2Pd6hrOSTOFajtabN+38slqgDDCeE/0F83SjkKBQcsZUj7VLWR0H5cKRA==} + dev: false + /@types/mdast/3.0.11: resolution: {integrity: sha512-Y/uImid8aAwrEA24/1tcRZwpxX3pIFTSilcNDKSPn+Y2iDywSEachzRuvgAYYLR3wpGXAsMbv5lvKLDZLeYPAw==} dependencies: @@ -1858,6 +1868,12 @@ packages: resolution: {integrity: sha512-Z1NL3Tb1M9wH4XESsCDEksWoKTdlUafKc4pt0GRwjUyXaCFZ+dc3g2erqB6zm3szA2IUSi7VnPI+o/9jnxh9hw==} dev: false + /marked/5.1.0: + resolution: {integrity: sha512-z3/nBe7aTI8JDszlYLk7dDVNpngjw0o1ZJtrA9kIfkkHcIF+xH7mO23aISl4WxP83elU+MFROgahqdpd05lMEQ==} + engines: {node: '>= 18'} + hasBin: true + dev: false + /mdast-util-definitions/5.1.2: resolution: {integrity: sha512-8SVPMuHqlPME/z3gqVwWY4zVXn8lqKv/pAhC57FuJ40ImXyBpmO5ukh98zB2v7Blql2FiHjHv9LVztSIqjY+MA==} dependencies: diff --git a/public/images/favicon-16x16.png b/public/favicon-16x16.png similarity index 100% rename from public/images/favicon-16x16.png rename to public/favicon-16x16.png diff --git a/public/images/favicon-32x32.png b/public/favicon-32x32.png similarity index 100% rename from public/images/favicon-32x32.png rename to public/favicon-32x32.png diff --git a/public/images/favicon.ico b/public/favicon.ico similarity index 100% rename from public/images/favicon.ico rename to public/favicon.ico diff --git a/public/rss.xsl b/public/rss.xsl new file mode 100644 index 0000000..921dcd1 --- /dev/null +++ b/public/rss.xsl @@ -0,0 +1,87 @@ + + + + + + + + + + +
+
+

RSS Feed

+
+

+ Hello, this is my blog's RSS Feed. Copy the URL from + the address bar, and add it to your RSS reader. +

+
+
+ + +
+
diff --git a/src/components/BlogPost.astro b/src/components/BlogPost.astro new file mode 100644 index 0000000..5dbc04f --- /dev/null +++ b/src/components/BlogPost.astro @@ -0,0 +1,28 @@ +--- +import styles from "../styles/BlogPost.module.css" +import Divider from "../components/Divider.astro" + +import type { CollectionEntry } from "astro:content" +interface Props { + post: CollectionEntry<"blog"> +} + +const { data: post, render } = Astro.props.post +const { Content } = await render() +const pubDate = new Intl.DateTimeFormat("en-US", { + month: "long", + day: "numeric", + year: "numeric" +}).format(post.pubDate) +--- + +
+ {pubDate} +

+ {post.title} +

+ +
+ +
+
diff --git a/src/components/Top.astro b/src/components/Top.astro index df357a4..415a924 100644 --- a/src/components/Top.astro +++ b/src/components/Top.astro @@ -7,7 +7,7 @@ import styles from "../styles/Top.module.css"