Skip to content

Commit ff2afe0

Browse files
committed
Changes
1 parent 11be0e0 commit ff2afe0

9 files changed

Lines changed: 685 additions & 23 deletions

File tree

.prettierignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
# .png is unformattable (binary)
33
*/*.ico
44
# .ico is unformattable (same as above)
5-
*/*.svg
5+
*.svg
66
# Prettier doesn't support svg yet
77
.*
88
# Most . files shouldn't be formatted
99
.*/
1010
# Most . folders shouldn't be formatted
11-
.github/*
11+
.github/*
12+
# .github shouldn't be formatted

components/global/InfoBox.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="bg-blue-500 text-white p-4 mb-4">
3-
<p><slot name="info-box"></slot></p>
2+
<div class="bg-indigo-500 rounded text-white p-4 mb-4">
3+
<p><slot></slot></p>
44
</div>
55
</template>

components/global/NextPrev.vue

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,40 @@
11
<template>
2-
<div>
2+
<div class="flex justify-between">
33
<NuxtLink
44
v-if="prev"
55
:to="{ name: 'blog-slug', params: { slug: prev.slug } }"
6+
class="text-primary font-bold hover:underline"
67
>
7-
{{ prev.title }}
8+
<unicon name="arrow-left" fill="currentColor" /> {{ prev.title }}
89
</NuxtLink>
9-
10+
<span v-else>&nbsp;</span>
1011
<NuxtLink
1112
v-if="next"
1213
:to="{ name: 'blog-slug', params: { slug: next.slug } }"
14+
class="font-bold hover:underline"
1315
>
14-
{{ next.title }}
16+
{{ next.title }} <unicon name="arrow-right" fill="currentColor" />
1517
</NuxtLink>
18+
<span v-else>&nbsp;</span>
1619
</div>
1720
</template>
1821

1922
<script>
2023
export default {
21-
async asyncData({ $content, params }) {
22-
const [prev, next] = await $content("articles")
23-
.sortBy("createdAt", "asc")
24-
.surround(params.slug)
25-
.fetch();
26-
27-
return {
28-
prev,
29-
next,
30-
};
24+
props: {
25+
prev: {
26+
type: Object,
27+
default: () => null,
28+
},
29+
next: {
30+
type: Object,
31+
default: () => null,
32+
},
3133
},
3234
};
3335
</script>
36+
<style lang="postcss">
37+
.unicon {
38+
vertical-align: text-bottom;
39+
}
40+
</style>

content/articles/nuxt.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ categories: site
88
---
99

1010
Hi, and welcome to my new Nuxt site and blog! It's a lot faster and has a PWA. Currently, it's staticly generated with `nuxt generate` in GitHub Actions and deployed to GitHub Pages.
11+
12+
<InfoBox>
13+
<h3 class="text-white">This is an infobox that I can use in any article.</h3>
14+
</InfoBox>

nuxt.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,5 @@ export default {
9696
routes: createSitemapRoutes,
9797
exclude: ["/articles/**"],
9898
},
99-
plugins: ["~/plugins/json-ld"],
99+
plugins: ["~/plugins/json-ld", "~/plugins/unicons"],
100100
};

0 commit comments

Comments
 (0)