Skip to content

Commit c718b4e

Browse files
committed
updates w/ demo article
1 parent c43db8d commit c718b4e

File tree

7 files changed

+265
-37
lines changed

7 files changed

+265
-37
lines changed

src/components/Footer.astro

Lines changed: 61 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,39 @@ const hash = childProcess
99

1010
<footer class="footer-container">
1111
<div class="footer-words">
12-
<p style="margin-left: 15px;">&copy; 2024 Andrew Moses</p>
12+
<p>&copy; 2024 Andrew Moses</p>
1313
</div>
1414
<div class="footer-right">
15-
<p class="made-with-love" style="margin-right: 5px;">
16-
Made with &lt3. Commit
17-
</p>
18-
<a
19-
class="commit-hash"
20-
href={`https://github.com/AndrewDTR/website/commit/${hash}`}
21-
style="margin-left: 0; margin-right: 20px;"
22-
target="_blank">{hash}</a
23-
>
15+
<div class="footer-section">
16+
<p class="made-with-love">Made with &lt;3</p>
17+
</div>
18+
<div class="footer-section">
19+
<p class="commit-text">
20+
Commit
21+
<a
22+
class="commit-hash"
23+
href={`https://github.com/AndrewDTR/website/commit/${hash}`}
24+
target="_blank"
25+
>
26+
{hash}
27+
</a>
28+
</p>
29+
</div>
2430
</div>
2531
</footer>
2632

2733
<style>
2834
.footer-container {
2935
width: 100%;
3036
background-color: #392e2e;
31-
height: 60px;
3237
display: flex;
3338
justify-content: space-between;
3439
align-items: center;
35-
/* padding: 0px 15px; */
3640
margin-top: 20px;
3741
border-top: 2px solid #f0e7d8;
3842
margin-bottom: 5px;
43+
flex-wrap: wrap;
44+
padding: 10px 15px;
3945
}
4046

4147
.footer-words {
@@ -46,24 +52,58 @@ const hash = childProcess
4652
.footer-right {
4753
display: flex;
4854
align-items: center;
55+
flex-wrap: wrap;
4956
}
5057

51-
.footer-words p,
52-
.footer-icons a {
58+
.footer-section {
59+
display: flex;
60+
align-items: center;
5361
margin-right: 20px;
62+
}
63+
64+
.made-with-love,
65+
.commit-text {
66+
color: #f0e7d8;
67+
margin: 0;
68+
}
69+
70+
.commit-hash {
71+
margin-left: 5px;
5472
color: #f0e7d8;
55-
text-decoration: none;
73+
text-decoration: underline;
74+
font-size: 1em;
5675
}
5776

58-
.footer-icons a:hover,
59-
.footer-words a:hover {
77+
.commit-hash:hover {
6078
color: #ffaaaa;
6179
text-decoration: underline;
6280
}
6381

64-
.made-with-love,
65-
.commit-hash {
66-
display: inline-block;
67-
margin-right: 10px; /* Adjust spacing as needed */
82+
@media (max-width: 600px) {
83+
.footer-container {
84+
flex-direction: column;
85+
align-items: flex-start;
86+
padding: 10px 15px;
87+
}
88+
89+
.footer-right {
90+
width: 100%;
91+
justify-content: space-between;
92+
margin-top: 10px;
93+
}
94+
95+
.footer-section {
96+
width: 48%;
97+
margin-right: 0;
98+
margin-bottom: 10px;
99+
}
100+
101+
.footer-section:last-child {
102+
text-align: right;
103+
}
104+
105+
.commit-hash {
106+
word-break: break-all;
107+
}
68108
}
69109
</style>

src/layouts/Blog.astro

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,35 @@
11
---
22
import BaseLayout from "./BaseLayout.astro";
33
const { frontmatter } = Astro.props;
4+
const hasTags = frontmatter.tags && frontmatter.tags.length > 0;
45
---
56

67
<BaseLayout>
7-
<!-- Content for the outside slot (left-aligned, outside content div) -->
88
<div slot="outside-content">
99
<p class="blog-title">{frontmatter.title}</p>
1010
<p class="subtitle">{frontmatter.subtitle}</p>
1111
<p class="others">
12-
<i class="fa-solid fa-user fa-sm " style="padding-right: 2px;"></i>
12+
<i class="fa-solid fa-user fa-sm" style="padding-right: 2px;"></i>
1313
By {frontmatter.author || "Me"} | <i
14-
class="fa-regular fa-calendar fa-sm "
14+
class="fa-regular fa-calendar fa-sm"
1515
style="padding-right: 2px;"></i>
1616
{frontmatter.date || "Date Unknown"}
1717
</p>
18-
<p class="tags">
19-
<i class="fa-solid fa-tag fa-sm" style="padding-right: 2px;"></i>
20-
Tags:
21-
{frontmatter.tags && frontmatter.tags.map((tag) => <code>{tag}</code>)}
22-
</p>
18+
{
19+
hasTags && (
20+
<p class="tags">
21+
<i class="fa-solid fa-tag fa-sm" style="padding-right: 2px;" />
22+
Tags:
23+
{frontmatter.tags.map((tag) => (
24+
<code>{tag}</code>
25+
))}
26+
</p>
27+
)
28+
}
29+
30+
<hr class="custom-hr" />
2331
</div>
2432

25-
<!-- Main blog content inside the content div -->
2633
<slot />
2734

2835
<style>

src/pages/index.astro

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,36 @@ const allPosts = await Astro.glob("./posts/*.md");
1414
<p class="writeup">
1515
Hello! I'm Andrew Moses, an engineer who loves tinkering with
1616
anything remotely electronic. I'm currently a sophomore at the
17-
<a href="https://wisc.edu" target="_blank" style="font-size: 1em;">University of Wisconsin-Madison</a>,
18-
where I'm currently studying Computer Science. My current
17+
<a href="https://wisc.edu" target="_blank" style="font-size: 1em;"
18+
>University of Wisconsin-Madison</a
19+
>, where I'm currently studying Computer Science. My current
1920
interests include computer vision and communication protocols
2021
(feel free to ask me about Zigbee or MQT!).
2122
</p>
2223
<p class="writeup writeup2">
2324
I've taken a recent interest in making projects that allow people
2425
to access information in a more convenient way. Check out my
25-
writeup on the <a href="/projects/upl-people-counter" class="project-link" style="font-size: 1em;">UPL's people counter</a>
26-
or my <a href="/projects/ics-schedule-generator" class="project-link" style="font-size: 1em;">.ics schedule generator</a>
26+
writeup on the <a
27+
href="/projects/upl-people-counter"
28+
class="project-link"
29+
style="font-size: 1em;">UPL's people counter</a
30+
>
31+
or my <a
32+
href="/projects/ics-schedule-generator"
33+
class="project-link"
34+
style="font-size: 1em;">.ics schedule generator</a
35+
>
2736
for more info!
2837
</p>
2938
</div>
3039
</div>
40+
<hr class="custom-hr" />
3141
<p>Here are some of my latest blog posts:</p>
3242
<ul>
3343
{
3444
allPosts.slice(0, 5).map((post) => (
3545
<li>
36-
<a href={post.url}>
46+
<a href={post.url} class="blog-bullet">
3747
{post.frontmatter.title} -{" "}
3848
<i>
3949
{post.frontmatter.subtitle} | {post.frontmatter.date}
@@ -120,4 +130,17 @@ const allPosts = await Astro.glob("./posts/*.md");
120130
padding-left: 20px;
121131
}
122132
}
133+
134+
.blog-bullet,
135+
.blog-bullet i {
136+
color: #f0e7d8;
137+
text-decoration: none;
138+
transition: color 0.2s ease;
139+
text-decoration: underline;
140+
}
141+
142+
.blog-bullet:hover,
143+
.blog-bullet:hover i {
144+
color: #ffaaaa;
145+
}
123146
</style>

src/pages/posts.astro

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,34 @@
11
---
22
import BaseLayout from "../layouts/BaseLayout.astro";
3-
const allPosts = await Astro.glob('./posts/*.md');
3+
const allPosts = await Astro.glob("./posts/*.md");
44
---
55

66
<BaseLayout>
7-
{allPosts.map((post) => <li><a href={post.url}>{post.frontmatter.title} - <i>{post.frontmatter.subtitle}</i></a></li>)}
7+
<ul>
8+
{
9+
allPosts.map((post) => (
10+
<li>
11+
<a href={post.url} class="blog-link">
12+
{post.frontmatter.title} - <i>{post.frontmatter.subtitle}</i>
13+
</a>
14+
</li>
15+
))
16+
}
17+
</ul>
18+
</BaseLayout>
19+
20+
<style>
21+
.blog-link,
22+
.blog-link i {
23+
color: #f0e7d8;
24+
text-decoration: none;
25+
transition: color 0.2s ease;
26+
text-decoration: underline;
27+
}
28+
29+
.blog-link:hover,
30+
.blog-link:hover i {
31+
color: #ffaaaa;
32+
}
33+
</style>
34+

src/pages/posts/blog1.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ layout: "../../layouts/Blog.astro"
33
title: "Blog 1"
44
date: "2021-09-01"
55
subtitle: "This is the first blog post"
6+
# tags: ["one", "two", "three"]
67
---
78

89
# Hello World

src/pages/posts/sandwich.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
---
2+
layout: "../../layouts/Blog.astro"
3+
title: "The Mathematics of Sandwich Making"
4+
subtitle: "A Comprehensive Exploration of the Physics, Chemistry, and Engineering of Sandwiches"
5+
author: ChatGPT
6+
tags: ["food", "mathematics", "physics", "engineering"]
7+
---
8+
9+
## Introduction
10+
11+
What makes a sandwich a great sandwich? Is it the choice of bread, the quality of the ingredients, or the order in which you assemble it? The art of sandwich making has transcended mere culinary skill and enters a realm that involves the principles of physics, chemistry, and even mathematics. In this post, we'll dive deep into the theory behind sandwich making, using some typographic magic, mathematical notations, and even a bit of science.
12+
13+
## Typographic replacements
14+
15+
Let's start with some simple typographic replacements to make sure everything looks good.
16+
17+
(c) stands for ©, (r) stands for ®, and (tm) stands for ™. This is how we ensure clarity and protect intellectual property.
18+
19+
## The Science Behind Sandwich Layers
20+
21+
### The Perfect Bread-to-Filling Ratio
22+
23+
Have you ever wondered why some sandwiches feel "just right" while others are too bready or too meaty? The secret lies in the bread-to-filling ratio, which can be mathematically represented as:
24+
25+
\\[
26+
R = \\frac{B}{F}
27+
\\]
28+
29+
where:
30+
31+
- \\(R\\) is the ratio of bread to filling.
32+
- \\(B\\) is the thickness of the bread.
33+
- \\(F\\) is the total volume of the fillings.
34+
35+
The ideal ratio \\(R_{ideal}\\) depends on personal preference, but most agree that a ratio of approximately 1:1 is pleasing to the palate. This can be written as:
36+
37+
\\[
38+
R_{ideal} = 1
39+
\\]
40+
41+
If \\(R > 1\\), the sandwich is too bready, and if \\(R < 1\\), it’s overloaded with fillings.
42+
43+
### The Geometry of Sandwich Construction
44+
45+
Sandwiches can come in many shapes—rectangular, circular, even triangular—but regardless of form, geometry plays a key role in ensuring an optimal eating experience.
46+
47+
For a rectangular sandwich with length \\(L\\), width \\(W\\), and height \\(H\\), the total volume \\(V\\) is given by:
48+
49+
\\[
50+
V = L \\times W \\times H
51+
\\]
52+
53+
Where \\(L\\), \\(W\\), and \\(H\\) are the dimensions of the bread and fillings combined.
54+
55+
When constructing a multi-layered sandwich, maintaining stability is crucial. The stacking order affects the center of mass \\(C_{mass}\\), which must be balanced over the base area of the sandwich for structural integrity.
56+
57+
For a simple sandwich consisting of \\(n\\) layers, the total height \\(H_{total}\\) is:
58+
59+
\\[
60+
H_{total} = \\sum_{i=1}^{n} h_i
61+
\\]
62+
63+
Where \\(h_i\\) is the height of the \\(i\\)-th layer. The center of mass \\(C_{mass}\\) must be positioned to avoid tipping over while biting.
64+
65+
## The Physics of Sandwich Compression
66+
67+
No one wants to bite into a sandwich that's too tall to fit in their mouth. Therefore, a certain amount of compression is necessary. According to Hooke's Law, the amount of compression \\(x\\) of a sandwich can be described as:
68+
69+
\\[
70+
F = kx
71+
\\]
72+
73+
Where:
74+
75+
- \\(F\\) is the force applied (the pressure of your hands).
76+
- \\(k\\) is the stiffness of the bread (a constant depending on the bread type).
77+
- \\(x\\) is the compression distance.
78+
79+
The goal is to compress the sandwich just enough to ensure a good bite, but not so much that fillings are pushed out from the sides.
80+
81+
## Heat Transfer in Toasted Sandwiches
82+
83+
When toasting a sandwich, heat transfer becomes an important factor. The heat flows from the outer surfaces to the core, and the temperature distribution can be modeled using Fourier’s Law of Heat Conduction:
84+
85+
\\[
86+
q = -k \\nabla T
87+
\\]
88+
89+
Where:
90+
91+
- \\(q\\) is the heat flux (the rate of heat transfer per unit area).
92+
- \\(k\\) is the thermal conductivity of the bread.
93+
- \\(\\nabla T\\) is the temperature gradient.
94+
95+
The challenge here is to toast the bread enough to develop a crisp crust, while ensuring that the fillings remain warm but not overheated.
96+
97+
## Condiments and Viscosity
98+
99+
The viscosity of condiments like mayonnaise, mustard, and ketchup can affect the structural integrity of the sandwich. Viscosity \\( \\eta \\) is the measure of a fluid's resistance to flow and can be described by the formula:
100+
101+
\\[
102+
\\eta = \\frac{\\tau}{\\gamma}
103+
\\]
104+
105+
Where:
106+
107+
- \\( \\tau \\) is the shear stress applied to the condiment layer.
108+
- \\( \\gamma \\) is the shear rate (the rate at which the condiment is spread).
109+
110+
Too much viscosity and the condiment will not spread evenly; too little and it may leak out from the edges of the sandwich.
111+
112+
## Conclusion
113+
114+
The humble sandwich is much more than just a quick meal—it’s a complex system that involves physics, geometry, and chemistry. Whether you're aiming for the perfect balance of flavors or optimizing the stability of your creation, understanding the science behind sandwich making can elevate your sandwich game to new heights. Now that you've been equipped with the knowledge, go ahead and make the perfect sandwich. Bon appétit!
115+
116+
\\[
117+
\\text{Happy Sandwich Making!}
118+
\\]

0 commit comments

Comments
 (0)