From 94c2687752f9302d1fc579023679b11cd72c5b0c Mon Sep 17 00:00:00 2001 From: Ruthenic Date: Tue, 20 Dec 2022 13:57:53 -0500 Subject: [PATCH] fanfic time --- src/components/blogList.astro | 37 +++++-- src/components/chapterList.astro | 25 +++++ src/css/base.scss | 12 +- src/layout/Base.astro | 2 + src/layout/BaseBlog.astro | 4 +- src/layout/BaseNested.astro | 42 +++++++ src/pages/fanfic.astro | 33 ++++++ src/pages/fanfic/inkyDesires.mdx | 9 ++ src/pages/fanfic/inkyDesires/chapter1.mdx | 26 +++++ src/pages/fanfic/inkyDesires/chapter2.mdx | 31 ++++++ src/pages/fanfic/inkyDesires/chapter3.mdx | 45 ++++++++ src/pages/fanfic/inkyDesires/chapter4.mdx | 129 ++++++++++++++++++++++ 12 files changed, 375 insertions(+), 20 deletions(-) create mode 100644 src/components/chapterList.astro create mode 100644 src/layout/BaseNested.astro create mode 100644 src/pages/fanfic.astro create mode 100644 src/pages/fanfic/inkyDesires.mdx create mode 100644 src/pages/fanfic/inkyDesires/chapter1.mdx create mode 100644 src/pages/fanfic/inkyDesires/chapter2.mdx create mode 100644 src/pages/fanfic/inkyDesires/chapter3.mdx create mode 100644 src/pages/fanfic/inkyDesires/chapter4.mdx diff --git a/src/components/blogList.astro b/src/components/blogList.astro index d027c8d..d4227bd 100644 --- a/src/components/blogList.astro +++ b/src/components/blogList.astro @@ -1,17 +1,30 @@ --- -const allPosts = await Astro.glob('../pages/blog/*.md*') -//@ts-ignore -const posts = allPosts.map(item => (Object.assign({}, item.frontmatter, {url: item.url}))).sort((a, b) => new Date(b.pubDate) - new Date(a.pubDate)); +const allPosts = await Astro.glob("../pages/blog/*.md*"); +const posts = allPosts + .map((item) => Object.assign({}, item.frontmatter, { url: item.url })) + //@ts-expect-error cease this bitch crying, what do you mean i shouldn't implicitly convert Dates to Numbers + .sort((a, b) => new Date(b.pubDate) - new Date(a.pubDate)); ---
-{posts.map((post) => { - if (!post.wip || process.env.NODE_ENV === "development") { return ( - -
-
{post.title} - {post.pubDate}
- {post.description} -
-
-)}})} + { + posts.map((post) => { + if (!post.wip || process.env.NODE_ENV === "development") { + return ( + +
+
+ {post.title} - {post.pubDate} +
+
+ {post.description} +
+
+ ); + } + }) + }
diff --git a/src/components/chapterList.astro b/src/components/chapterList.astro new file mode 100644 index 0000000..77ec7da --- /dev/null +++ b/src/components/chapterList.astro @@ -0,0 +1,25 @@ +--- +const allFicChapters = await Astro.glob(`../pages/fanfic/**/*.md*`); +const sortedChapters = allFicChapters + .filter(v => v.file.includes(Astro.props.name + "/")) + .map((item) => Object.assign({}, item.frontmatter, { url: item.url })) + //@ts-expect-error cease this bitch crying, what do you mean i shouldn't implicitly convert Dates to Numbers + .sort((a, b) => new Date(b.pubDate) - new Date(a.pubDate)); +let i = 1 +--- + +
+ { + sortedChapters.map((chapter) => ( + +
+ Chapter {i++} - {chapter.title} + {chapter.pubDate} +
+
+ )) + } +
diff --git a/src/css/base.scss b/src/css/base.scss index 857555b..a510017 100644 --- a/src/css/base.scss +++ b/src/css/base.scss @@ -13,10 +13,10 @@ align-items: center; justify-content: center; text-align: center; - @media (max-width: 470px) { + @media (max-width: 520px) { margin-bottom: 132px; } - @media (min-width: 470px) { + @media (min-width: 520px) { margin-bottom: 3.4375em; } } @@ -33,12 +33,12 @@ position: fixed; display: flex; flex-grow: 1; - @media (max-width: 470px) { //mobile + @media (max-width: 520px) { //mobile justify-content: flex-end; align-items: center; flex-direction: row; } - @media (min-width: 470px) { //desktop + @media (min-width: 520px) { //desktop justify-content: center; align-items: center; flex-direction: row; @@ -51,14 +51,14 @@ .img-container { display: flex; flex-direction: row; - @media (max-width: 470px) { + @media (max-width: 520px) { flex-direction: column; } img { display: flex; height: 45px; margin-right: 0.625em; - @media (max-width: 470px) { //even smoler mobile + @media (max-width: 520px) { //even smoler mobile height: 30px; margin-top: 0.3125em; margin-bottom: 0.3125em; diff --git a/src/layout/Base.astro b/src/layout/Base.astro index 2cf2420..a040067 100644 --- a/src/layout/Base.astro +++ b/src/layout/Base.astro @@ -8,6 +8,7 @@ import Footer from '../components/footer.astro'; const {title} = Astro.props; --- + @@ -20,6 +21,7 @@ const {title} = Astro.props;