-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use components for repeated sections, cleanup
- Loading branch information
Showing
12 changed files
with
147 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{{ import { Time } from './time.vto' }} | ||
{{ import { Tags } from './tags.vto' }} | ||
|
||
{{ export function PostList(posts) }} | ||
{{- for index, post of posts -}} | ||
<div class="{{ if index === 0 }}mt-0{{ else }}mx-0 my-8{{ /if }} no-underline"> | ||
<h2 class="font-semibold mx-0 my-0 text-xl leading-8" style="view-transition-name: post-{{ post.data.title |> slugify }}"> | ||
<a href="{{ post.url }}">{{ post.data.title }}</a> | ||
</h2> | ||
<div class="flex flex-row flex-wrap gap-2 lowercase my-2"> | ||
{{ Time(post.data.date, post.data.edited) }} | ||
{{ Tags(post.data.tags) }} | ||
</div> | ||
<p class="mb-0 mt-1">{{ post.data.description }}</p> | ||
</div> | ||
{{- /for -}} | ||
{{ /export }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{{ export async function ProjectList(projects) }} | ||
<div class="grid grid-cols-1 md:grid-cols-2 gap-[1rem_1rem] m-0 p-0"> | ||
{{- for project of projects -}} | ||
<a class="flex flex-col p-6 gap-2 rounded-md hover:bg-mantle transition-colors justify-between not-fancy no-external-link" href="{{ project.link }}" data-umami-event="project-link-{{ project.name |> slugify }}"> | ||
<div> | ||
<h2 class="font-bold text-lg m-0">{{ project.name }}</h2> | ||
<p class="mx-0 my-1">{{ project.description }}</p> | ||
</div> | ||
<div class="flex flex-row justify-between items-center "> | ||
{{ set classes = 'block w-5 h-5 text-text align-baseline' }} | ||
<div class="flex flex-row gap-4"> | ||
{{ for item of project.stack }} | ||
{{- icon "si:" + item, { class: classes } -}} | ||
{{ /for }} | ||
</div> | ||
<div class="flex flex-row gap-4"> | ||
<div>{{- icon "si:github", { class: classes } -}}</div> | ||
{{ if project.live && !project.live.startsWith("https://crates.io") }} | ||
{{- if project.live.startsWith("https://discord.gg") -}} | ||
{{- set liveIcon = 'si:discord' -}} | ||
{{- else if project.live.startsWith("https://npmjs.com") || project.live.startsWith("https://www.npmjs.com") -}} | ||
{{- set liveIcon = 'si:npm' -}} | ||
{{ else if project.live.startsWith("https://chrome.google.com/webstore") || project.live.startsWith("https://chromewebstore.google.com") }} | ||
{{- set liveIcon = 'si:chromewebstore' -}} | ||
{{- else -}} | ||
{{- set liveIcon = 'lucide:globe' -}} | ||
{{- /if -}} | ||
<div>{{- icon liveIcon, { class: classes } -}}</div> | ||
{{ /if }} | ||
</div> | ||
</div> | ||
</a> | ||
{{ /for }} | ||
</div> | ||
{{ /export }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{{ export function Tags(tags) }} | ||
{{- if tags -}} | ||
<span>·</span> | ||
<div class="flex flex-row flex-wrap space-x-1"> | ||
{{- for index, tag of tags -}} | ||
<span> | ||
<a href="/tags/{{ tag |> slugify }}">{{ tag }}</a> | ||
{{- index != (tags.length - 1) ? ',' : '' -}} | ||
</span> | ||
{{- /for -}} | ||
</div> | ||
{{- /if -}} | ||
{{ /export }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{{ export function Time(written, edited) }} | ||
{{ if written }} | ||
<span> | ||
{{ set shortWritten = written |> toShortDate }} | ||
{{ set shortEdited = edited |> toShortDate }} | ||
<time datetime="{{ written }}">{{ shortWritten }}</time> | ||
{{- if edited && (edited !== written) -}} | ||
(last edited <time datetime="{{ edited }}">{{ shortEdited }}</time>) | ||
{{- /if -}} | ||
</span> | ||
{{ /if }} | ||
{{ /export }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters