Skip to content

Commit 32a4e8b

Browse files
committed
feat: Add more microformats
1 parent 53592d2 commit 32a4e8b

File tree

10 files changed

+40
-21
lines changed

10 files changed

+40
-21
lines changed

content/mf2.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
"family_name": "Bachmann",
55
"nickname": "Tiim",
66
"email": "[email protected]",
7-
"photo": "https://media.tiim.ch/tiim.jpg",
7+
"photo": "https://avatars.githubusercontent.com/u/1063187",
88
"url": "https://tiim.ch/",
99
"locality": "Basel",
1010
"country_name": "Switzerland",
11-
"org": "University of Basel",
12-
"job_title": "",
13-
"role": "master graduate in computer science",
11+
"org": "Coop Genossenschaft",
12+
"job_title": "Software Engineer",
13+
"role": "software engineer",
1414
"gender_identity": "male"
1515
}

src/lib/AboutCard.svelte

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
<div>
1111
<p class="author-bio p-note">{@html about.html}</p>
1212
<div class="author-detail">
13+
<span class="hidden p-name">{mf2.name}</span>
1314
<span class="hidden p-gender-identity">{mf2.gender_identity}</span>
15+
<span class="hidden p-locality">{mf2.locality}</span>
16+
<span class="hidden p-country-name">{mf2.country_name}</span>
17+
<span class="hidden p-org">{mf2.org}</span>
18+
<span class="hidden p-role">{mf2.role}</span>
1419
<a href={`mailto:${mf2.email}`} class="p-email">{mf2.email}</a>
1520
<a class="p-url" href={mf2.url}>{mf2.url}</a>
1621
</div>

src/lib/Card.svelte

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,33 @@
55
export let links = [];
66
export let tags = [];
77
export let date = null;
8+
export let url = null;
89
</script>
910

10-
<article class="card">
11+
<article class="card h-entry">
1112
<h3 class="card-header">
12-
{title}
13+
{#if url}
14+
<a href={url} class="p-name u-url">{title}</a>
15+
{:else}
16+
<span class="p-name">{title}</span>
17+
{/if}
1318
</h3>
1419
{#if date}
15-
<span class="date">{new Date(date).toLocaleDateString()}</span>
20+
<time class="date dt-published" datetime={date}>
21+
{new Date(date).toLocaleDateString()}
22+
</time>
1623
{/if}
1724
<div class="card-content">
1825
{#if image}
19-
<img src={image?.src} alt={image?.alt || title + " title image"} />
26+
<img class="u-featured" src={image?.src} alt={image?.alt || title + " title image"} />
2027
{/if}
21-
<p>
28+
<p class="p-summary">
2229
<slot />
2330
</p>
2431
{#if tags && tags.length > 0}
2532
<div class="tags">
2633
{#each tags as tag}
27-
<a href={`/tags/${tag}`} class="tag">
34+
<a href={`/tags/${tag}`} class="tag p-category">
2835
{tag}
2936
</a>
3037
{/each}

src/lib/MarkdownSite.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
<article class="container h-entry">
5656
{#if site.cover_image}
5757
<figure>
58-
<img alt={site.title} src={resolveUrl(site.cover_image)} />
58+
<img class="u-featured" alt={site.title} src={resolveUrl(site.cover_image)} />
5959
{#if site.cover_image_txt}
6060
<figcaption>{site.cover_image_txt}</figcaption>
6161
{/if}
@@ -77,7 +77,7 @@
7777
7878
<div class="by">
7979
<address class="author">
80-
by <a href="/" rel="author">Tim Bachmann</a>
80+
by <a class="u-author" href="/" rel="author">Tim Bachmann</a>
8181
</address>
8282
<PubDate {site} />
8383
</div>
@@ -99,7 +99,7 @@
9999
{#if site.photos}
100100
<div class="images">
101101
{#each site.photos as photo}
102-
<img alt={photo.alt} src={photo.url} />
102+
<img class="u-photo" alt={photo.alt} src={photo.url} />
103103
{/each}
104104
</div>
105105
{/if}

src/lib/PostCard.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
{links}
2020
{linksHtml}
2121
date={post.date}
22+
url={`/${post.slug}`}
2223
>
2324
<div>
2425
{@html post.description || post.abstract}

src/routes/+page.svelte

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@
3535
<a class="u-email" href={`mailto:${data.mf2.email}`}>{data.mf2.email}</a>
3636
<a class="u-url" href={data.mf2.url}>{data.mf2.url}</a>
3737
<span class="p-locality">{data.mf2.locality}</span>
38+
<span class="p-country-name">{data.mf2.country_name}</span>
39+
<span class="p-org">{data.mf2.org}</span>
40+
{#if data.mf2.job_title}
41+
<span class="p-job-title">{data.mf2.job_title}</span>
42+
{/if}
43+
<span class="p-role">{data.mf2.role}</span>
3844
<span class="p-gender-identity">{data.mf2.gender_identity}</span>
3945
</div>
4046
<div class="section">

src/routes/blog/+page.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
<title>Blog - Tim Bachmann</title>
1010
</svelte:head>
1111

12-
<div class="container has-text-centered">
12+
<div class="container has-text-centered h-feed">
1313
<div class="section">
14-
<h1>Blog 📖</h1>
14+
<h1 class="p-name">Blog 📖</h1>
1515
<p>
1616
Subscribe to my blog via
1717
<a href="blog/rss.xml" target="_blank">

src/routes/mf2/+page.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
export let data;
55
</script>
66

7-
<div class="container has-text-centered">
7+
<div class="container has-text-centered h-feed">
88
<div class="section">
9-
<h1>Notes 📒</h1>
9+
<h1 class="p-name">Notes 📒</h1>
1010
</div>
1111
<div class="section">
1212
<PostCardList posts={data.notes} />

src/routes/projects/+page.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
<title>Projects and Apps</title>
88
</svelte:head>
99

10-
<div class="container has-text-centered">
10+
<div class="container has-text-centered h-feed">
1111
<div class="section">
12-
<h1>Projects, Utility Apps &amp; other Resources⚙️</h1>
12+
<h1 class="p-name">Projects, Utility Apps &amp; other Resources⚙️</h1>
1313
<p>
1414
This is a list of some of my current or past projects, as well as some
1515
useful resources that I compiled. Go check them out!

src/routes/tags/[slug]/+page.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
<title>🏷️{data.details.tag} - Tim Bachmann</title>
88
</svelte:head>
99

10-
<div class="container has-text-centered">
10+
<div class="container has-text-centered h-feed">
1111
<div class="section">
12-
<h1>🏷️ Tag: {data.details.tag}</h1>
12+
<h1 class="p-name">🏷️ Tag: {data.details.tag}</h1>
1313
</div>
1414
{#if data.details.html}
1515
<div class="tag-content section">

0 commit comments

Comments
 (0)