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/rss": "^4.0.1",
"@astrojs/sitemap": "^3.0.3",
"astro": "^4.14.3",
"astro": "^4.16.10",
"typescript": "^5.3.3"
},
"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:description" content={description} />
<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>
</svg>
</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">
<span class="sr-only">Go to my GitHub repo</span>
<svg

View File

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

View File

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

View File

@@ -3,6 +3,8 @@ import BaseHead from "../components/BaseHead.astro";
import Header from "../components/Header.astro";
import Footer from "../components/Footer.astro";
import { SITE_TITLE, SITE_DESCRIPTION } from "../consts";
import { Image } from "astro:assets";
import profilePic from "../../public/profile-pic.jpg";
---
<!doctype html>
@@ -15,9 +17,9 @@ import { SITE_TITLE, SITE_DESCRIPTION } from "../consts";
<main>
<h1>Hello</h1>
<article>
<img
src="/profile-pic.jpg"
width="250px"
<Image
src={profilePic}
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."
/>
<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
a Jet Engine Mechanic and have transitioned into Software
Development after separating. I enjoy running, cycling, and
rock climbing as well as exploring technology. I am a
motivated lifelong learner and eager to share what I've
learned.
rock climbing as well as exploring technology.
</p>
</article>
</main>