Merge pull request #1 from smjklake/site-improvments

Site improvments
This commit was merged in pull request #1.
This commit is contained in:
Spencer Jones
2024-11-13 08:12:19 -07:00
committed by GitHub
7 changed files with 673 additions and 909 deletions

1333
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -14,7 +14,7 @@
"@astrojs/mdx": "^2.0.1", "@astrojs/mdx": "^2.0.1",
"@astrojs/rss": "^4.0.1", "@astrojs/rss": "^4.0.1",
"@astrojs/sitemap": "^3.0.3", "@astrojs/sitemap": "^3.0.3",
"astro": "^4.14.3", "astro": "^4.16.10",
"typescript": "^5.3.3" "typescript": "^5.3.3"
}, },
"devDependencies": { "devDependencies": {

View File

@@ -45,3 +45,6 @@ const { title, description, image = '/west-wing-sunrise.jpg' } = Astro.props;
<meta property="twitter:title" content={title} /> <meta property="twitter:title" content={title} />
<meta property="twitter:description" content={description} /> <meta property="twitter:description" content={description} />
<meta property="twitter:image" content={new URL(image, Astro.url)} /> <meta property="twitter:image" content={new URL(image, Astro.url)} />
<!-- Umami --->
<script is:inline src="https://cloud.umami.is/script.js" data-website-id="e7534182-fa03-41a0-8b35-07ff7f5d25e4"></script>

View File

@@ -34,6 +34,20 @@ const today = new Date();
></path> ></path>
</svg> </svg>
</a> </a>
<a href="https://bsky.app/profile/smrising.com" target="_blank">
<span class="sr-only">Follow me on Bluesky</span>
<svg
aria-hidden="true"
viewBox="0 0 320 286"
width="32"
height="32"
astro-icon="social/bluesky"
>
<path
d="M69.364 19.146c36.687 27.806 76.147 84.186 90.636 114.439 14.489-30.253 53.948-86.633 90.636-114.439C277.107-.917 320-16.44 320 32.957c0 9.865-5.603 82.875-8.889 94.729-11.423 41.208-53.045 51.719-90.071 45.357 64.719 11.12 81.182 47.953 45.627 84.785-80 82.874-106.667-44.333-106.667-44.333s-26.667 127.207-106.667 44.333c-35.555-36.832-19.092-73.665 45.627-84.785-37.026 6.362-78.648-4.149-90.071-45.357C5.603 115.832 0 42.822 0 32.957 0-16.44 42.893-.917 69.364 19.147Z"
fill="currentColor"></path>
</svg>
</a>
<a href="https://github.com/smjklake" target="_blank"> <a href="https://github.com/smjklake" target="_blank">
<span class="sr-only">Go to my GitHub repo</span> <span class="sr-only">Go to my GitHub repo</span>
<svg <svg

View File

@@ -1,7 +1,7 @@
--- ---
title: 'First post' title: 'First post'
description: 'First ever blog post' description: 'First ever blog post'
pubDate: 'Dec 19 2024' pubDate: 'Dec 19 2023'
heroImage: '/west-wing-sunrise.jpg' heroImage: '/west-wing-sunrise.jpg'
--- ---

View File

@@ -1,111 +1,121 @@
--- ---
import BaseHead from '../../components/BaseHead.astro'; import BaseHead from "../../components/BaseHead.astro";
import Header from '../../components/Header.astro'; import Header from "../../components/Header.astro";
import Footer from '../../components/Footer.astro'; import Footer from "../../components/Footer.astro";
import { SITE_TITLE, SITE_DESCRIPTION } from '../../consts'; import { SITE_TITLE, SITE_DESCRIPTION } from "../../consts";
import { getCollection } from 'astro:content'; import { getCollection } from "astro:content";
import FormattedDate from '../../components/FormattedDate.astro'; import FormattedDate from "../../components/FormattedDate.astro";
import { Image } from "astro:assets";
const posts = (await getCollection('blog')).sort( const posts = (await getCollection("blog")).sort((a, b) =>
(a, b) => a.data.pubDate.valueOf() - b.data.pubDate.valueOf() a.data.pubDate.valueOf() < b.data.pubDate.valueOf() ? 1 : -1,
); );
--- ---
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<BaseHead title={SITE_TITLE} description={SITE_DESCRIPTION} /> <BaseHead title={SITE_TITLE} description={SITE_DESCRIPTION} />
<style> <style>
main { main {
width: 960px; width: 960px;
} }
ul { ul {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 2rem; gap: 2rem;
list-style-type: none; list-style-type: none;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
ul li { ul li {
width: calc(50% - 1rem); width: calc(50% - 1rem);
} }
ul li * { ul li * {
text-decoration: none; text-decoration: none;
transition: 0.2s ease; transition: 0.2s ease;
} }
ul li:first-child { ul li:first-child {
width: 100%; width: 100%;
margin-bottom: 1rem; margin-bottom: 1rem;
text-align: center; text-align: center;
} }
ul li:first-child img { ul li:first-child img {
width: 100%; width: 100%;
} }
ul li:first-child .title { ul li:first-child .title {
font-size: 2.369rem; font-size: 2.369rem;
} }
ul li img { ul li img {
margin-bottom: 0.5rem; margin-bottom: 0.5rem;
border-radius: 12px; border-radius: 12px;
} }
ul li a { ul li a {
display: block; display: block;
} }
.title { .title {
margin: 0; margin: 0;
color: white; color: white;
line-height: 1; line-height: 1;
} }
.date { .date {
margin: 0; margin: 0;
color: rgb(var(--gray-light)); color: rgb(var(--gray-light));
} }
ul li a:hover h4, ul li a:hover h4,
ul li a:hover .date { ul li a:hover .date {
color: rgb(var(--gray)); color: rgb(var(--gray));
} }
ul a:hover img { ul a:hover img {
box-shadow: var(--box-shadow); box-shadow: var(--box-shadow);
} }
@media (max-width: 720px) { @media (max-width: 720px) {
ul { ul {
gap: 0.5em; gap: 0.5em;
} }
ul li { ul li {
width: 100%; width: 100%;
text-align: center; text-align: center;
} }
ul li:first-child { ul li:first-child {
margin-bottom: 0; margin-bottom: 0;
} }
ul li:first-child .title { ul li:first-child .title {
font-size: 1.563em; font-size: 1.563em;
} }
} }
</style> </style>
</head> </head>
<body> <body>
<Header /> <Header />
<main> <main>
<section> <section>
<ul> <ul>
{ {
posts.map((post) => ( posts.map((post) => (
<li> <li>
<a href={`/blog/${post.slug}/`}> <a href={`/blog/${post.slug}/`}>
<img width={720} height={360} src={post.data.heroImage} alt="" /> {post.data.heroImage &&
<h4 class="title">{post.data.title}</h4> <Image
<p class="date"> width={720}
<FormattedDate date={post.data.pubDate} /> height={360}
</p> src={post.data.heroImage}
</a> loading=eager
</li> alt=""
)) />}
} <h4 class="title">{post.data.title}</h4>
</ul> <p class="date">
</section> <FormattedDate
</main> date={post.data.pubDate}
<Footer /> />
</body> </p>
</a>
</li>
))
}
</ul>
</section>
</main>
<Footer />
</body>
</html> </html>

View File

@@ -3,6 +3,8 @@ import BaseHead from "../components/BaseHead.astro";
import Header from "../components/Header.astro"; import Header from "../components/Header.astro";
import Footer from "../components/Footer.astro"; import Footer from "../components/Footer.astro";
import { SITE_TITLE, SITE_DESCRIPTION } from "../consts"; import { SITE_TITLE, SITE_DESCRIPTION } from "../consts";
import { Image } from "astro:assets";
import profilePic from "../../public/profile-pic.jpg";
--- ---
<!doctype html> <!doctype html>
@@ -15,9 +17,9 @@ import { SITE_TITLE, SITE_DESCRIPTION } from "../consts";
<main> <main>
<h1>Hello</h1> <h1>Hello</h1>
<article> <article>
<img <Image
src="/profile-pic.jpg" src={profilePic}
width="250px" width={250}
alt="A man with short, dark, wavy hair and a beard is looking at the camera. He is wearing a gray shirt and standing against a plain background." alt="A man with short, dark, wavy hair and a beard is looking at the camera. He is wearing a gray shirt and standing against a plain background."
/> />
<p> <p>
@@ -26,9 +28,7 @@ import { SITE_TITLE, SITE_DESCRIPTION } from "../consts";
I was in the US Air Force for a large portion of my life as I was in the US Air Force for a large portion of my life as
a Jet Engine Mechanic and have transitioned into Software a Jet Engine Mechanic and have transitioned into Software
Development after separating. I enjoy running, cycling, and Development after separating. I enjoy running, cycling, and
rock climbing as well as exploring technology. I am a rock climbing as well as exploring technology.
motivated lifelong learner and eager to share what I've
learned.
</p> </p>
</article> </article>
</main> </main>