Skip to content

Commit

Permalink
add 404.astro
Browse files Browse the repository at this point in the history
  • Loading branch information
louismorgan-linaro committed Oct 19, 2023
1 parent 6e9d980 commit 77e18d5
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 11 deletions.
7 changes: 3 additions & 4 deletions src/components/Home/Hero.astro
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ const blogLists = blogs
{data.main_body}
</p>
<a
onclick="
window.open('https://github.com/OpenAMP', '_blank')
"
class="bg-openampred align-middle mt-2 mx-auto p-4 rounded text-md text-center transition ease-in-out hover:bg-red-600 text-white"
href="https://github.com/OpenAM"
target="_blank"
class="bg-openampred align-middle mt-2 mx-auto p-4 rounded text-md text-center transition ease-in-out hover:bg-red-600 text-white cursor-pointer"
>View on Github</a
>
</div>
Expand Down
18 changes: 18 additions & 0 deletions src/content/pages/404.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
permalink: /404.html
title: 404 page not found!
description: >
404 page not found
links:
- title: General Information
style: text-center
url: /about/
- title: Governance
style: text-center
url: /governance/
- title: News
style: text-center
url: /news/
- title: Contact Us
url: https://www.linaro.org/contact/
---
3 changes: 0 additions & 3 deletions src/layouts/MainLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,4 @@ import "../styles/global.scss";
<slot />
</main>
<Footer />
<script
type="text/javascript"
src="../node_modules/tw-elements/dist/js/tw-elements.umd.min.js"></script>
</body>
30 changes: 30 additions & 0 deletions src/pages/404.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
import { getEntry } from "astro:content";
import BaseHead from "../components/Head/BaseHead.astro";
import MainLayout from "../layouts/MainLayout.astro";
const about = await getEntry("pages", "404");
const { data, render } = about;
const { Content } = await render();
---

<html lang="en">
<BaseHead title={"404 - OpenAMP Project"} description={data.description} />
<MainLayout>
<section class="my-16 max-w-3xl mx-auto px-5">
<h1>Page Not Found</h1>
<h2 class="text-left font-bold text-xl my-4">
You can also find out more about Open AMP through the following links:
</h2>
<ul class="ml-5 list-disc">
{
data.links.map((link: any) => (
<li>
<a href={link.url}>{link.title}</a>
</li>
))
}
</ul>
</section>
</MainLayout>
</html>
5 changes: 4 additions & 1 deletion src/pages/[slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import Header from "../components/Header.astro";
export async function getStaticPaths() {
const pages = await getCollection("pages");
const filteredPages = pages.filter(
(page) => page.id !== "homepage.md" && page.id !== "about.md"
(page) =>
page.id !== "homepage.md" &&
page.id !== "about.md" &&
page.id !== "404.md"
);
return filteredPages.map((page) => {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const { Content } = await render();
<MainLayout>
<Hero data={data} />

<section class="text-center decoration-0 prose-xl mb-8">
<section class="text-center decoration-0 prose-xl mb-8 prose-p:mb-4">
<Content />
</section>
</MainLayout>
Expand Down
3 changes: 1 addition & 2 deletions tailwind.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ module.exports = {
},
},
plugins: [
// require("@tailwindcss/typography"),

require("@tailwindcss/typography"),
require("tw-elements/dist/plugin.cjs"),
],
};

0 comments on commit 77e18d5

Please sign in to comment.