From fcdc6a4fa178e6252f038095c8faf7c1960eaca1 Mon Sep 17 00:00:00 2001 From: Ash Date: Fri, 8 Mar 2024 14:00:47 +0000 Subject: [PATCH] Dev (#24) * added contact page and updated links Signed-off-by: Ash Entwisle * Feature/blog (#22) * updated blogpost component Signed-off-by: Ash Entwisle * added first post and template post Signed-off-by: Ash Entwisle * updated styles Signed-off-by: Ash Entwisle * tweaked stuff Signed-off-by: Ash Entwisle * added custom header components Signed-off-by: Ash Entwisle * updated scss Signed-off-by: Ash Entwisle * added placeholder for future reference Signed-off-by: Ash Entwisle * tweaked around styles a bit :3 Signed-off-by: Ash Entwisle * added basic search to blogposts Signed-off-by: Ash Entwisle * added pdading to md Signed-off-by: Ash Entwisle * fixed css issue Signed-off-by: Ash Entwisle * tweaked css to make links more visible for blogposts Signed-off-by: Ash Entwisle --------- Signed-off-by: Ash Entwisle * updated footer Signed-off-by: Ash Entwisle * added ability to view draft sites Signed-off-by: Ash Entwisle * changed 501 to 404 Signed-off-by: Ash Entwisle --------- Signed-off-by: Ash Entwisle --- src/components/compound/Footer.astro | 8 ++++---- src/layouts/Blogpost.astro | 9 ++++++--- src/pages/posts/template.mdx | 2 ++ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/components/compound/Footer.astro b/src/components/compound/Footer.astro index a0dfea8..f35e88a 100644 --- a/src/components/compound/Footer.astro +++ b/src/components/compound/Footer.astro @@ -51,16 +51,16 @@ import Copywright from "./Copywright.astro" links={[ { name: "Discord", - href: "links/discord" + href: "/links/discord" }, { name: "GitHub", - href: "links/github" + href: "/links/github" }, { name: "Instagram", - href: "links/instagram" + href: "/links/instagram" }, { name: "HUSU", - href: "links/husu" + href: "/links/husu" }, ]} /> diff --git a/src/layouts/Blogpost.astro b/src/layouts/Blogpost.astro index 50feae7..74cec9c 100644 --- a/src/layouts/Blogpost.astro +++ b/src/layouts/Blogpost.astro @@ -14,13 +14,16 @@ const url = Astro.url.pathname.split("/").pop(); const headings = Astro.props.headings || []; +const draft_view = Astro.url.searchParams.get("draft") === "true"; + --- { - props.frontmatter.draft ? - - Sorry, the page `{Astro.url}` is in draft mode. + props.frontmatter.draft && !draft_view ? + + Sorry, the page `{Astro.url}` does not exist, + Click here to go back to the homepage. : diff --git a/src/pages/posts/template.mdx b/src/pages/posts/template.mdx index b70187a..c0db9b2 100644 --- a/src/pages/posts/template.mdx +++ b/src/pages/posts/template.mdx @@ -23,6 +23,8 @@ If you set `draft: true` then the blogpost will not be published. If you set `dr if someone tries to access a draft blogpost, they will get an unauthorised error, once draft is set to false, they will be able to access it. +to access a draft post, put "?draft=true" at the end of the url. + ## Layout ***DO NOT EDIT THE LAYOUT !!!!!!*** \ No newline at end of file