Skip to content

Commit

Permalink
more tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
viperML committed Jul 1, 2024
1 parent a4fe6f6 commit 9d9eeee
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 16 deletions.
2 changes: 1 addition & 1 deletion astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default defineConfig({
tailwind()
],
devToolbar: {
enabled: false
enabled: true
},
output: 'static',
site: "https://ayats.org",
Expand Down
5 changes: 2 additions & 3 deletions src/components/NavBar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import logo from '../img/avatar-text.svg';
---

<header class="flex justify-center">
<nav class="py-2 px-4 flex justify-between items-center">
<nav class="py-2 px-4 flex-auto flex justify-between items-center">

<a href="/" class="logo">
<Image src={logo} alt="Site logo."/>
Expand All @@ -24,12 +24,11 @@ import logo from '../img/avatar-text.svg';
z-index: 100;
position: sticky;
font-weight: 600;
margin-bottom: 20px;
background-color: red;
}

nav {
background-color: rgb(137, 137, 137);
width: 100vw;
}

.logo {
Expand Down
18 changes: 16 additions & 2 deletions src/components/PostList.astro
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,24 @@ import { getCollection } from "astro:content";
// }
// });
const blogEntries = await getCollection("blog");
const blogEntries = (await getCollection("blog"))
.sort((a, b) => {
if (a.data.pubDate === undefined || b.data.pubDate === undefined) {
return 0;
}
return a.data.pubDate.getSeconds() - b.data.pubDate.getSeconds();
})
.filter((elem) => {
if (elem.data.draft === true) {
return false;
} else {
return true;
}
});
---

Post List
<h1>Post List</h1>

<ul>
{
Expand Down
2 changes: 1 addition & 1 deletion src/content/blog/ipsum/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Ipsum
pubDate: 2023-05-28T21:18:09Z
tags: ['nix']
draft: true
summary:
summary: ""
slug: ipsum
---

Expand Down
1 change: 1 addition & 0 deletions src/content/blog/nixos-lustrate/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ tags: ['nix']
draft: true
# summary: Call a toolchain.toml from nix, for better interoperability with non-nix developers
# hidden: true
summary: ""
---

- Install nix
Expand Down
6 changes: 5 additions & 1 deletion src/content/config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { defineCollection } from 'astro:content';
import { rssSchema } from '@astrojs/rss';
import { z } from 'astro/zod';

const blog = defineCollection({
schema: rssSchema,
schema: rssSchema.extend({
draft: z.boolean().optional(),
summary: z.string(),
}),
});

export const collections = { blog };
22 changes: 14 additions & 8 deletions src/layouts/Base.astro
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Footer from "../components/Footer.astro";
<body class="text-base flex flex-col items-center">
<NavBar />

<main>
<main class="max-w-4xl m-4">
<slot />

<Footer />
Expand All @@ -25,14 +25,7 @@ import Footer from "../components/Footer.astro";

<style>
main {
max-width: 100vw;
margin: 0 10px;
}

@media screen(md) {
main {
max-width: 1000px;
}
}
</style>

Expand All @@ -41,9 +34,22 @@ import Footer from "../components/Footer.astro";
overflow: scroll !important;
max-width: 100vw;
}

h1 {
font-weight: 800;
font-size: 1.75em;
text-align: center;
}

h2 {
font-weight: 700;
font-size: 1.5em;
}
</style>

<script is:inline>
// This script automatically loads the theme from either the user's preference
// or from localStorage
const theme = (() => {
if (typeof localStorage !== "undefined" && localStorage.getItem("theme")) {
return localStorage.getItem("theme");
Expand Down

0 comments on commit 9d9eeee

Please sign in to comment.