Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add 404.astro #110

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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"),
],
};