Skip to content

Commit

Permalink
paths
Browse files Browse the repository at this point in the history
  • Loading branch information
mudkipdev committed Dec 2, 2024
1 parent 0ea179f commit e8b4c31
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 15 deletions.
22 changes: 21 additions & 1 deletion src/components/Profile.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
---
interface Props {
path: string;
}
const { path } = Astro.props;
---
<div id="profile">
<img src="https://avatars.githubusercontent.com/u/86132148" width="80" height="80">
<h1>mudkip</h1>
<div id="text">
<h1>mudkip</h1>
<p>{path}</p>
</div>
</div>

<hr>
Expand All @@ -14,4 +22,16 @@
user-select: none;
gap: 1.25em;
}

/* fix all this */
#profile #text {
margin-top: -1em;
flex-direction: column;
gap: 0;
}

#profile p {
margin-top: -0.5em;
color: var(--surface-5);
}
</style>
2 changes: 1 addition & 1 deletion src/content/blog/welcome.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
date: 2024-05-09
title: welcome
---
This page only exists because of a code limitation.
this page only exists because of a code limitation
14 changes: 7 additions & 7 deletions src/layouts/Page.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ import "../style.css";
interface Props {
title: string;
path?: string;
}
const { title } = Astro.props;
const { title, path = "~/" + title.toLowerCase().replaceAll(" ", "-") } = Astro.props;
---
<html lang="en">
<head>
<title>{path}</title>
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link
rel="alternate" type="application/rss+xml"
Expand All @@ -21,15 +23,13 @@ const { title } = Astro.props;
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<meta name="theme-color" content="#C6A0F6" />
<slot name="metadata">
<title>~/{title === "mudkip" ? "" : title}</title>
<meta property="og:title" content={title} />
</slot>
<meta property="og:title" content={title} />
<slot name="metadata" />
</head>
<body>
<main>
<slot name="title">
<Profile />
<slot name="profile">
<Profile path={path} />
</slot>

<Header />
Expand Down
2 changes: 1 addition & 1 deletion src/pages/about.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Page from "@layouts/Page.astro";
</Page>

<script>
let element = document.getElementById("wip");
const element = document.getElementById("wip");
let iteration = 3;

setInterval(() => {
Expand Down
6 changes: 2 additions & 4 deletions src/pages/blog/[...slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type { InferGetStaticPropsType, GetStaticPaths } from "astro";
import { getCollection } from "astro:content";
import { stripContent } from "@content/config";
import Page from "@layouts/Page.astro";
import Date from "@components/Date.astro";
type Props = InferGetStaticPropsType<typeof getStaticPaths>;
Expand All @@ -21,12 +20,11 @@ export const getStaticPaths = (async () => {
const { post, data } = Astro.props;
const { Content } = await post.render();
const stripped = await stripContent(post);
const path = "~/blog/" + data.title.toLowerCase().replaceAll(" ", "-") + ".txt";
---
<Page title={data.title}>
<Page title={data.title} path={path}>
<Fragment slot="metadata">
<title>~/blog/{data.title}.txt</title>
<meta property="og:site_name" content="mudkip" />
<meta property="og:title" content={data.title} />
<meta property="og:description" content={stripped} />
</Fragment>

Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Page from "@layouts/Page.astro";
const bio = "I'm a software developer and security researcher, my interests include programming, video games, and music.";
---
<Page title="mudkip">
<Page title="mudkip" path="~/">
<Fragment slot="metadata">
<title>~/</title>
<meta property="og:title" content="mudkip" />
Expand Down

0 comments on commit e8b4c31

Please sign in to comment.