Skip to content

Commit 1a0f4bf

Browse files
author
robotism
committed
update
1 parent f8881a6 commit 1a0f4bf

File tree

9 files changed

+38
-35
lines changed

9 files changed

+38
-35
lines changed
File renamed without changes.

nuxt.config.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import appconfig from "./site.config";
44

5+
import tailwindcss from "@tailwindcss/vite";
6+
57
export default defineNuxtConfig({
68
compatibilityDate: "2025-02-19",
79
devtools: {
@@ -10,7 +12,9 @@ export default defineNuxtConfig({
1012
enabled: true,
1113
},
1214
},
13-
vite: {},
15+
vite: {
16+
plugins: [tailwindcss()],
17+
},
1418
nitro: {
1519
prerender: {
1620
crawlLinks: true,
@@ -135,4 +139,4 @@ export default defineNuxtConfig({
135139
},
136140
},
137141
content: {},
138-
});
142+
});

package-lock.json

Lines changed: 1 addition & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,14 @@
2828
"@nuxtjs/robots": "^5.2.4",
2929
"@nuxtjs/sitemap": "^7.2.6",
3030
"@quasar/extras": "^1.16.17",
31-
"@tailwindcss/postcss": "^4.0.9",
31+
"@tailwindcss/vite": "^4.0.9",
3232
"@unhead/vue": "^1.11.20",
3333
"@vueuse/nuxt": "^12.7.0",
3434
"eslint": "^9.21.0",
3535
"gsap": "^3.12.7",
3636
"moment": "^2.30.1",
3737
"nuxt": "^3.15.4",
3838
"nuxt-quasar-ui": "^2.1.12",
39-
"postcss": "^8.5.3",
4039
"quasar": "^2.17.7",
4140
"tailwindcss": "^4.0.9",
4241
"vue": "latest",
@@ -45,7 +44,6 @@
4544
"devDependencies": {
4645
"@iconify-json/lucide": "^1.2.27",
4746
"@iconify-json/simple-icons": "^1.2.26",
48-
"autoprefixer": "^10.4.20",
4947
"prettier": "3.5.2",
5048
"typescript": "^5.7.3"
5149
},

postcss.config.mjs

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/assets/css/typography.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ p {
4141
color: var(--ui-secondary);
4242
}
4343

44+
blockquote {
45+
border-left: 2px solid var(--ui-secondary);
46+
}
47+
4448
p {
4549
}
4650
}

src/components/article/ArticleItem.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
{{ article?.title }}
1212
</div>
1313
<div class="flex flex-row">
14-
<q-chip color="secondary" text-color="white" icon="alarm">
14+
<q-chip dense color="secondary" text-color="white" icon="alarm">
1515
{{ $fmt?.fromNow?.(article.updatedAt) }}
1616
</q-chip>
17-
<q-chip color="secondary" text-color="white" icon="event">
17+
<q-chip dense color="secondary" text-color="white" icon="event">
1818
{{ $fmt?.localDate?.(article.updatedAt, "YYYY-MM-DD HH:mm") }}
1919
</q-chip>
2020
</div>
@@ -42,6 +42,7 @@
4242
<div class="flex flex-row">
4343
<q-chip
4444
v-for="(tag, index) in articleRouteTags"
45+
dense
4546
:key="index"
4647
icon="las la-location-arrow"
4748
color="green-4"
@@ -71,6 +72,7 @@
7172
</q-chip>
7273
<q-chip
7374
v-for="(tag, index) in article?.tags"
75+
dense
7476
:key="index"
7577
icon="las la-tag"
7678
color="blue-4"

src/layouts/home/AppTitle.vue

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@
77
/>
88
<NuxtLinkLocale
99
to="/"
10-
class="cursor-pointer bg-gradient-to-r bg-clip-text text-transparent text-xl font-bold"
11-
:class="[
12-
'from-amber-500 to-pink-500',
13-
'hover:from-pink-500 hover:to-amber-500',
14-
]"
10+
class="cursor-pointer text-primary hover:text-secondary text-xl font-bold"
11+
style="text-shadow: #fc0 1px 0 10px"
1512
>
1613
{{ $t("app.name") }}
1714
</NuxtLinkLocale>

src/pages/articles/[...slug].md.vue

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,22 @@
55
class="w-full h-full flex flex-col gap-4 items-center justify-center"
66
>
77
<img
8+
class="object-contain w-full max-h-[30vh]"
89
v-if="article.cover"
910
:src="article.cover"
10-
class="object-contain w-full max-h-[30vh]"
1111
:alt="article.title"
1212
/>
1313
<MarkdownRender class="max-w-[1080px]" :value="article" />
14-
<div class="flex w-full justify-between">
14+
<div class="flex w-full justify-between px-2">
1515
<div v-if="previous">
16-
<NuxtLink :to="`/articles/${previous?.id}`">
17-
{{ previous?.title }}
18-
<q-btn :label="$t('articles.previous')" />
16+
<NuxtLink :to="previous?.route">
17+
<q-btn :label="$t('articles.previous') + ':' + previous?.title" />
1918
</NuxtLink>
2019
</div>
20+
<div></div>
2121
<div v-if="next">
22-
<NuxtLink :to="`/articles/${next?.id}`">
23-
{{ next?.title }}
24-
<q-btn :label="$t('articles.next')" />
22+
<NuxtLink :to="next?.route">
23+
<q-btn :label="$t('articles.next') + ':' + next?.title" />
2524
</NuxtLink>
2625
</div>
2726
</div>
@@ -39,11 +38,12 @@
3938
<script lang="ts" setup>
4039
import MarkdownRender from "~/components/article/MarkdownRender.vue";
4140
41+
const route = useRoute();
4242
const { locale } = useI18n();
4343
const { computedTitle } = useWindow();
44-
const { getArticleIdByRoute } = useArticles();
44+
const { getArticleIdByRoute, getRouteByArticleId } = useArticles();
4545
46-
const { data: article } = await useAsyncData(() =>
46+
const { data: article } = await useAsyncData(route.path + "#article", () =>
4747
queryCollection("articles")
4848
.where("id", "=", getArticleIdByRoute())
4949
.limit(1)
@@ -53,7 +53,7 @@ const { data: article } = await useAsyncData(() =>
5353
})
5454
);
5555
56-
const { data: previous } = await useAsyncData(() =>
56+
const { data: previous } = await useAsyncData(route.path + "#previous", () =>
5757
queryCollection("articles")
5858
.where("stem", "LIKE", locale.value + "/%")
5959
.where("updatedAt", "<", article.value?.updatedAt)
@@ -65,17 +65,24 @@ const { data: previous } = await useAsyncData(() =>
6565
})
6666
);
6767
68-
const { data: next } = await useAsyncData(() =>
68+
const { data: next } = await useAsyncData(route.path + "#next", () =>
6969
queryCollection("articles")
7070
.where("stem", "LIKE", locale.value + "/%")
71-
.where("updatedAt", "<", article.value?.updatedAt)
71+
.where("updatedAt", ">", article.value?.updatedAt)
7272
.order("updatedAt", "ASC")
7373
.limit(1)
7474
.first()
7575
.catch((err) => {
7676
console.error(err);
7777
})
7878
);
79+
if (previous.value) {
80+
previous.value.route = getRouteByArticleId(previous.value.id) || "";
81+
}
82+
83+
if (next.value) {
84+
next.value.route = getRouteByArticleId(next.value.id) || "";
85+
}
7986
8087
useHead(() => ({
8188
titleTemplate: computedTitle(article.value?.title),

0 commit comments

Comments
 (0)