* fixed css fuckup

Signed-off-by: Ash Entwisle <ash.entwisle@protonmail.com>

* tweaked css

Signed-off-by: Ash Entwisle <ash.entwisle@protonmail.com>

* tweaked css

Signed-off-by: Ash Entwisle <ash.entwisle@protonmail.com>

* updated exec names

Signed-off-by: Ash Entwisle <ash.entwisle@protonmail.com>

* fixed blogpost sort (#30)

Signed-off-by: Ash Entwisle <ash.entwisle@protonmail.com>

* Hotfix/done goofery (#32)

* fixed blogpost sort

Signed-off-by: Ash Entwisle <ash.entwisle@protonmail.com>

* forgor to change the path of my pfp lol

Signed-off-by: Ash Entwisle <ash.entwisle@protonmail.com>

---------

Signed-off-by: Ash Entwisle <ash.entwisle@protonmail.com>

* Revert "Bugfix/blogpost sort (#28)" (#29)

This reverts commit 58f452c9bb.

---------

Signed-off-by: Ash Entwisle <ash.entwisle@protonmail.com>
main
Ash 2024-07-17 20:55:58 +01:00 committed by GitHub
parent 6388bbd180
commit 1376a56766
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 36 additions and 34 deletions

View File

@ -3,7 +3,6 @@ import Center from "../components/base/Center.astro";
import Icon from "../components/base/Icon.astro"; import Icon from "../components/base/Icon.astro";
import Boilerplate from "../layouts/Boilerplate.astro"; import Boilerplate from "../layouts/Boilerplate.astro";
const rawPosts = await Astro.glob("./posts/*.mdx"); const rawPosts = await Astro.glob("./posts/*.mdx");
const search = Astro.url.searchParams.get("q") || ""; const search = Astro.url.searchParams.get("q") || "";
@ -13,15 +12,14 @@ const posts = rawPosts
return { return {
url: post.url ?? "/", url: post.url ?? "/",
data: post.frontmatter, data: post.frontmatter,
} };
}); });
const filteredPosts = posts.filter((post) => { const filteredPosts = posts.filter((post) => {
return post.data.title.toLowerCase() return (
.includes(search.toLowerCase()) post.data.title.toLowerCase().includes(search.toLowerCase()) ||
|| post.data.description.toLowerCase().includes(search.toLowerCase())
post.data.description.toLowerCase() );
.includes(search.toLowerCase());
}); });
// sort posts in decscending order of date // sort posts in decscending order of date
@ -29,10 +27,6 @@ filteredPosts.sort((a, b) => {
return a.data.date < b.data.date ? 1 : -1; return a.data.date < b.data.date ? 1 : -1;
}); });
const keywords = [ const keywords = [
"hull", "hull",
"computer", "computer",
@ -62,10 +56,15 @@ const keywords = [
<div id="blog_main"> <div id="blog_main">
<div class="blog_search"> <div class="blog_search">
<Center id="search"> <Center id="search">
<form action="/blog" method="get"> <form action="/blog" method="get">
<input type="text" name="q" placeholder={search || "Search..."} value="" /> <input
type="text"
name="q"
placeholder={search || "Search..."}
value=""
/>
<button type="submit"> <button type="submit">
<Icon icon={{code: "f002", bold: true}}/> <Icon icon={{ code: "f002", bold: true }} />
</button> </button>
</form> </form>
</Center> </Center>
@ -73,21 +72,28 @@ const keywords = [
<div class="blog_posts"> <div class="blog_posts">
{ {
filteredPosts.map((post) => ( filteredPosts.map((post) => (
<div class="blog_post" id={ post.url.split("/").pop() }> <div class="blog_post" id={post.url.split("/").pop()}>
<h2> <h2>
<span class="blog_post_hash">#</span> <span class="blog_post_hash">#</span>
<a href={post.url}> <a href={post.url}>
<span class="blog_post_title">{post.data.title}</span> <span class="blog_post_title">{post.data.title}</span>
{ /* <span class="blog_post_link"><Icon icon={{code: "f0c1", bold: true}}/></span> */ } {/* <span class="blog_post_link"><Icon icon={{code: "f0c1", bold: true}}/></span> */}
</a> </a>
</h2> </h2>
<p> <p>{post.data.description}</p>
{post.data.description} <h3>
</p> <em>
<h3><em> <span class="blog_post_author">
<span class="blog_post_author"> By: <a href={post.data.link}> @{post.data.author.replace(" ", "_").toLowerCase()}</a> </span> {" "}
<span class="blog_post_date"> ({post.data.date}) </span> By:{" "}
</em></h3> <a href={post.data.link}>
{" "}
@{post.data.author.replace(" ", "_").toLowerCase()}
</a>{" "}
</span>
<span class="blog_post_date"> ({post.data.date}) </span>
</em>
</h3>
</div> </div>
)) ))
} }
@ -97,13 +103,9 @@ const keywords = [
<script> <script>
document.addEventListener("keydown", (e) => { document.addEventListener("keydown", (e) => {
if ( if ((e.key === "k" && (e.metaKey || e.ctrlKey)) || e.key === "/") {
e.key === "k" && (e.metaKey || e.ctrlKey) ||
e.key === "/"
) {
e.preventDefault(); e.preventDefault();
document.querySelector("input")?.focus(); document.querySelector("input")?.focus();
} }
}); });
</script> </script>

View File

@ -44,7 +44,7 @@ const keywords = [
</div> </div>
<div class="execs"> <div class="execs">
<h2>Meet the Team (2024-2025): </h2> <h2>Meet the Team (2024-2025):</h2>
<Exec <Exec
title="President" title="President"