Skip to content

Commit

Permalink
better!
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbloxhub committed Jul 22, 2023
1 parent c261a93 commit a3ee3e8
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 1 deletion.
36 changes: 36 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/rss": "^2.4.3",
"@astrojs/svelte": "^3.1.0",
"astro": "^2.9.1",
"svelte": "^4.1.1"
Expand Down
8 changes: 8 additions & 0 deletions src/components/Header.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
import Navigation from "./Navigation.astro"
---
<header class="text-center">
<nav>
<Navigation />
</nav>
</header>
2 changes: 2 additions & 0 deletions src/components/Navigation.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<a href="/">Home</a> |
<a href="/blog/">Blog</a>
4 changes: 4 additions & 0 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
import Header from "../components/Header.astro"
interface Props {
title: string
}
Expand All @@ -15,11 +16,14 @@ const { title } = Astro.props
<link rel="icon" href="https://github.com/bitbloxhub.png">
<meta name="generator" content={Astro.generator} />
<title>{title}</title>
<script src="https://instant.page/5.2.0" type="module" />
</head>
<body>
<Header />
<slot />
</body>
</html>

<style is:global>
:root {
--accent: 124, 58, 237;
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/MarkdownPostLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { frontmatter } = Astro.props
<main class="m-auto p-6 max-w-6xl text-left">
<h1>{frontmatter.title}</h1>
<p>Written by {frontmatter.author}</p>
<p>Published {frontmatter.pubDate}</p>
<p>Published on {frontmatter.pubDate.slice(0,10)}</p>
<slot />
</main>
</Layout>
13 changes: 13 additions & 0 deletions src/pages/blog.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
import Layout from "../layouts/Layout.astro"
const allPosts = await Astro.glob("../pages/posts/*.md")
const pageTitle = "bitbloxhub's blog"
---
<Layout title={pageTitle}>
<main class="m-auto p-6 max-w-6xl text-left">
<h1>bitbloxhub's blog!</p>
<ul class="text-base">
{allPosts.map((post) => <li ><a href={post.url}>{post.frontmatter.title}</a></li>)}
</ul>
</main>
</Layout>
11 changes: 11 additions & 0 deletions src/pages/rss.xml.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import rss, { pagesGlobToRssItems } from "@astrojs/rss"

export async function get() {
return rss({
title: "bitbloxhub's blog",
description: "a blog i might write stuff on",
site: "https://bitbloxhub.github.io",
items: await pagesGlobToRssItems(import.meta.glob("./**/*.md")),
customData: `<language>en-us</language>`
})
}

0 comments on commit a3ee3e8

Please sign in to comment.