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