mirror of
https://github.com/versia-pub/blog.git
synced 2025-12-06 00:48:18 +01:00
feat: ✨ Add author to articles
This commit is contained in:
parent
f85bc75145
commit
5fc72966dd
20
components/article/author.vue
Normal file
20
components/article/author.vue
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
<template>
|
||||||
|
<div class="flex flex-col gap-2 justify-center items-center">
|
||||||
|
<p class="text-gray-400 text-xs font-semibold uppercase">Written by</p>
|
||||||
|
<div class="flex items-center gap-4 ring-white/20 ring-1 rounded py-1 px-2">
|
||||||
|
<nuxt-img :preload="true" format="webp" :src="avatar" alt="Author avatar" class="size-12 rounded" />
|
||||||
|
<div class="flex flex-col justify-center pr-1">
|
||||||
|
<h2 class="text font-bold text-gray-50">{{ name }}</h2>
|
||||||
|
<p class="text-gray-500 text-sm">{{ handle }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
defineProps<{
|
||||||
|
avatar?: string;
|
||||||
|
name: string;
|
||||||
|
handle?: string;
|
||||||
|
}>();
|
||||||
|
</script>
|
||||||
|
|
@ -119,7 +119,7 @@ export default defineNuxtConfig({
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
image: {
|
image: {
|
||||||
domains: ["images.pexels.com"],
|
domains: ["images.pexels.com", "cpluspatch.com"],
|
||||||
},
|
},
|
||||||
sitemap: {
|
sitemap: {
|
||||||
sources: [...getRouteRenderingPaths(), "/"],
|
sources: [...getRouteRenderingPaths(), "/"],
|
||||||
|
|
|
||||||
132
package.json
132
package.json
|
|
@ -1,65 +1,71 @@
|
||||||
{
|
{
|
||||||
"name": "@versia/blog",
|
"name": "@versia/blog",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "The source code for Versia's blog.",
|
"description": "The source code for Versia's blog.",
|
||||||
"author": {
|
"author": {
|
||||||
"email": "contact@cpluspatch.com",
|
"email": "contact@cpluspatch.com",
|
||||||
"name": "Jesse Wierzbinski",
|
"name": "Jesse Wierzbinski",
|
||||||
"url": "https://cpluspatch.com"
|
"url": "https://cpluspatch.com"
|
||||||
},
|
},
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/versia-pub/blog/issues"
|
"url": "https://github.com/versia-pub/blog/issues"
|
||||||
},
|
},
|
||||||
"license": "AGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
"maintainers": [
|
"maintainers": [
|
||||||
{
|
{
|
||||||
"email": "contact@cpluspatch.com",
|
"email": "contact@cpluspatch.com",
|
||||||
"name": "Jesse Wierzbinski",
|
"name": "Jesse Wierzbinski",
|
||||||
"url": "https://cpluspatch.com"
|
"url": "https://cpluspatch.com"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/versia-pub/blog.git"
|
"url": "git+https://github.com/versia-pub/blog.git"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "nuxt build",
|
"build": "nuxt build",
|
||||||
"dev": "nuxt dev",
|
"dev": "nuxt dev",
|
||||||
"generate": "nuxt generate",
|
"generate": "nuxt generate",
|
||||||
"preview": "nuxt preview",
|
"preview": "nuxt preview",
|
||||||
"postinstall": "nuxt prepare",
|
"postinstall": "nuxt prepare",
|
||||||
"lint": "bunx @biomejs/biome check .",
|
"lint": "bunx @biomejs/biome check .",
|
||||||
"typecheck": "bunx tsc -p ."
|
"typecheck": "bunx tsc -p ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@hackmd/markdown-it-task-lists": "^2.1.4",
|
"@hackmd/markdown-it-task-lists": "^2.1.4",
|
||||||
"@nuxt/fonts": "^0.10.3",
|
"@nuxt/fonts": "^0.10.3",
|
||||||
"@nuxt/icon": "^1.10.3",
|
"@nuxt/icon": "^1.10.3",
|
||||||
"@nuxt/image": "^1.9.0",
|
"@nuxt/image": "^1.9.0",
|
||||||
"@nuxtjs/seo": "^2.0.3",
|
"@nuxtjs/seo": "^2.0.3",
|
||||||
"@nuxtjs/tailwindcss": "^6.13.1",
|
"@nuxtjs/tailwindcss": "^6.13.1",
|
||||||
"@shikijs/markdown-it": "^1.27.2",
|
"@shikijs/markdown-it": "^1.27.2",
|
||||||
"@tailwindcss/forms": "^0.5.10",
|
"@tailwindcss/forms": "^0.5.10",
|
||||||
"@tailwindcss/typography": "^0.5.16",
|
"@tailwindcss/typography": "^0.5.16",
|
||||||
"@vueuse/nuxt": "^12.4.0",
|
"@vueuse/nuxt": "^12.4.0",
|
||||||
"markdown-it": "^14.1.0",
|
"markdown-it": "^14.1.0",
|
||||||
"markdown-it-anchor": "^9.2.0",
|
"markdown-it-anchor": "^9.2.0",
|
||||||
"markdown-it-container": "^4.0.0",
|
"markdown-it-container": "^4.0.0",
|
||||||
"markdown-it-toc-done-right": "^4.2.0",
|
"markdown-it-toc-done-right": "^4.2.0",
|
||||||
"nuxt": "^3.15.2",
|
"nuxt": "^3.15.2",
|
||||||
"nuxt-security": "^2.1.5",
|
"nuxt-security": "^2.1.5",
|
||||||
"sharp": "^0.33.5",
|
"sharp": "^0.33.5",
|
||||||
"shiki": "^1.27.2",
|
"shiki": "^1.27.2",
|
||||||
"vue": "^3.5.13",
|
"vue": "^3.5.13",
|
||||||
"vue-router": "^4.5.0"
|
"vue-router": "^4.5.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "^1.9.4",
|
"@biomejs/biome": "^1.9.4",
|
||||||
"@iconify-json/tabler": "^1.2.14",
|
"@iconify-json/tabler": "^1.2.14",
|
||||||
"@types/bun": "^1.1.17",
|
"@types/bun": "^1.1.17",
|
||||||
"@types/markdown-it-container": "^2.0.10",
|
"@types/markdown-it-container": "^2.0.10",
|
||||||
"tailwindcss": "^3.4.17"
|
"tailwindcss": "^3.4.17"
|
||||||
},
|
},
|
||||||
"trustedDependencies": ["@biomejs/biome", "@parcel/watcher", "esbuild", "sharp", "vue-demi"]
|
"trustedDependencies": [
|
||||||
|
"@biomejs/biome",
|
||||||
|
"@parcel/watcher",
|
||||||
|
"esbuild",
|
||||||
|
"sharp",
|
||||||
|
"vue-demi"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,12 @@
|
||||||
<Title v-if="post.title" :created_at="post.created_at" :title="post.title" />
|
<Title v-if="post.title" :created_at="post.created_at" :title="post.title" />
|
||||||
<Image v-if="post.image" :image="post.image.url" :width="post.image.width" :height="post.image.height" :caption="post.image.credit" />
|
<Image v-if="post.image" :image="post.image.url" :width="post.image.width" :height="post.image.height" :caption="post.image.credit" />
|
||||||
<Content :body="body" />
|
<Content :body="body" />
|
||||||
|
<Author v-if="post.author" :avatar="post.author.image" :name="post.author.name" :handle="post.author.handle" class="mt-10" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import Author from "~/components/article/author.vue";
|
||||||
import Content from "~/components/article/content.vue";
|
import Content from "~/components/article/content.vue";
|
||||||
import Image from "~/components/article/image.vue";
|
import Image from "~/components/article/image.vue";
|
||||||
import Title from "~/components/article/title.vue";
|
import Title from "~/components/article/title.vue";
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue