Skip to content

Commit 5fc7296

Browse files
committed
feat: ✨ Add author to articles
1 parent f85bc75 commit 5fc7296

File tree

4 files changed

+92
-64
lines changed

4 files changed

+92
-64
lines changed

components/article/author.vue

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<template>
2+
<div class="flex flex-col gap-2 justify-center items-center">
3+
<p class="text-gray-400 text-xs font-semibold uppercase">Written by</p>
4+
<div class="flex items-center gap-4 ring-white/20 ring-1 rounded py-1 px-2">
5+
<nuxt-img :preload="true" format="webp" :src="avatar" alt="Author avatar" class="size-12 rounded" />
6+
<div class="flex flex-col justify-center pr-1">
7+
<h2 class="text font-bold text-gray-50">{{ name }}</h2>
8+
<p class="text-gray-500 text-sm">{{ handle }}</p>
9+
</div>
10+
</div>
11+
</div>
12+
</template>
13+
14+
<script lang="ts" setup>
15+
defineProps<{
16+
avatar?: string;
17+
name: string;
18+
handle?: string;
19+
}>();
20+
</script>

nuxt.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export default defineNuxtConfig({
119119
]),
120120
),
121121
image: {
122-
domains: ["images.pexels.com"],
122+
domains: ["images.pexels.com", "cpluspatch.com"],
123123
},
124124
sitemap: {
125125
sources: [...getRouteRenderingPaths(), "/"],

package.json

Lines changed: 69 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,71 @@
11
{
2-
"name": "@versia/blog",
3-
"private": true,
4-
"type": "module",
5-
"description": "The source code for Versia's blog.",
6-
"author": {
7-
"email": "contact@cpluspatch.com",
8-
"name": "Jesse Wierzbinski",
9-
"url": "https://cpluspatch.com"
10-
},
11-
"bugs": {
12-
"url": "https://github.com/versia-pub/blog/issues"
13-
},
14-
"license": "AGPL-3.0-only",
15-
"maintainers": [
16-
{
17-
"email": "contact@cpluspatch.com",
18-
"name": "Jesse Wierzbinski",
19-
"url": "https://cpluspatch.com"
20-
}
21-
],
22-
"repository": {
23-
"type": "git",
24-
"url": "git+https://github.com/versia-pub/blog.git"
25-
},
26-
"scripts": {
27-
"build": "nuxt build",
28-
"dev": "nuxt dev",
29-
"generate": "nuxt generate",
30-
"preview": "nuxt preview",
31-
"postinstall": "nuxt prepare",
32-
"lint": "bunx @biomejs/biome check .",
33-
"typecheck": "bunx tsc -p ."
34-
},
35-
"dependencies": {
36-
"@hackmd/markdown-it-task-lists": "^2.1.4",
37-
"@nuxt/fonts": "^0.10.3",
38-
"@nuxt/icon": "^1.10.3",
39-
"@nuxt/image": "^1.9.0",
40-
"@nuxtjs/seo": "^2.0.3",
41-
"@nuxtjs/tailwindcss": "^6.13.1",
42-
"@shikijs/markdown-it": "^1.27.2",
43-
"@tailwindcss/forms": "^0.5.10",
44-
"@tailwindcss/typography": "^0.5.16",
45-
"@vueuse/nuxt": "^12.4.0",
46-
"markdown-it": "^14.1.0",
47-
"markdown-it-anchor": "^9.2.0",
48-
"markdown-it-container": "^4.0.0",
49-
"markdown-it-toc-done-right": "^4.2.0",
50-
"nuxt": "^3.15.2",
51-
"nuxt-security": "^2.1.5",
52-
"sharp": "^0.33.5",
53-
"shiki": "^1.27.2",
54-
"vue": "^3.5.13",
55-
"vue-router": "^4.5.0"
56-
},
57-
"devDependencies": {
58-
"@biomejs/biome": "^1.9.4",
59-
"@iconify-json/tabler": "^1.2.14",
60-
"@types/bun": "^1.1.17",
61-
"@types/markdown-it-container": "^2.0.10",
62-
"tailwindcss": "^3.4.17"
63-
},
64-
"trustedDependencies": ["@biomejs/biome", "@parcel/watcher", "esbuild", "sharp", "vue-demi"]
2+
"name": "@versia/blog",
3+
"private": true,
4+
"type": "module",
5+
"description": "The source code for Versia's blog.",
6+
"author": {
7+
"email": "contact@cpluspatch.com",
8+
"name": "Jesse Wierzbinski",
9+
"url": "https://cpluspatch.com"
10+
},
11+
"bugs": {
12+
"url": "https://github.com/versia-pub/blog/issues"
13+
},
14+
"license": "AGPL-3.0-only",
15+
"maintainers": [
16+
{
17+
"email": "contact@cpluspatch.com",
18+
"name": "Jesse Wierzbinski",
19+
"url": "https://cpluspatch.com"
20+
}
21+
],
22+
"repository": {
23+
"type": "git",
24+
"url": "git+https://github.com/versia-pub/blog.git"
25+
},
26+
"scripts": {
27+
"build": "nuxt build",
28+
"dev": "nuxt dev",
29+
"generate": "nuxt generate",
30+
"preview": "nuxt preview",
31+
"postinstall": "nuxt prepare",
32+
"lint": "bunx @biomejs/biome check .",
33+
"typecheck": "bunx tsc -p ."
34+
},
35+
"dependencies": {
36+
"@hackmd/markdown-it-task-lists": "^2.1.4",
37+
"@nuxt/fonts": "^0.10.3",
38+
"@nuxt/icon": "^1.10.3",
39+
"@nuxt/image": "^1.9.0",
40+
"@nuxtjs/seo": "^2.0.3",
41+
"@nuxtjs/tailwindcss": "^6.13.1",
42+
"@shikijs/markdown-it": "^1.27.2",
43+
"@tailwindcss/forms": "^0.5.10",
44+
"@tailwindcss/typography": "^0.5.16",
45+
"@vueuse/nuxt": "^12.4.0",
46+
"markdown-it": "^14.1.0",
47+
"markdown-it-anchor": "^9.2.0",
48+
"markdown-it-container": "^4.0.0",
49+
"markdown-it-toc-done-right": "^4.2.0",
50+
"nuxt": "^3.15.2",
51+
"nuxt-security": "^2.1.5",
52+
"sharp": "^0.33.5",
53+
"shiki": "^1.27.2",
54+
"vue": "^3.5.13",
55+
"vue-router": "^4.5.0"
56+
},
57+
"devDependencies": {
58+
"@biomejs/biome": "^1.9.4",
59+
"@iconify-json/tabler": "^1.2.14",
60+
"@types/bun": "^1.1.17",
61+
"@types/markdown-it-container": "^2.0.10",
62+
"tailwindcss": "^3.4.17"
63+
},
64+
"trustedDependencies": [
65+
"@biomejs/biome",
66+
"@parcel/watcher",
67+
"esbuild",
68+
"sharp",
69+
"vue-demi"
70+
]
6571
}

pages/articles/[...path].vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
<Title v-if="post.title" :created_at="post.created_at" :title="post.title" />
44
<Image v-if="post.image" :image="post.image.url" :width="post.image.width" :height="post.image.height" :caption="post.image.credit" />
55
<Content :body="body" />
6+
<Author v-if="post.author" :avatar="post.author.image" :name="post.author.name" :handle="post.author.handle" class="mt-10" />
67
</div>
78
</template>
89

910
<script lang="ts" setup>
11+
import Author from "~/components/article/author.vue";
1012
import Content from "~/components/article/content.vue";
1113
import Image from "~/components/article/image.vue";
1214
import Title from "~/components/article/title.vue";

0 commit comments

Comments
 (0)