Skip to content

Commit ad685ec

Browse files
Production dependencies fix (#33)
* Upgrade dependencies and modernize pages deploy workflow Co-authored-by: Jeremy Ward <basicBrogrammer@users.noreply.github.com> * Migrate to latest deps and Nuxt Content v3 APIs --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
1 parent 6936940 commit ad685ec

File tree

10 files changed

+11976
-14305
lines changed

10 files changed

+11976
-14305
lines changed

.github/workflows/build-pages.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,26 @@ on:
77

88
jobs:
99
cd:
10-
runs-on: ${{ matrix.os }}
11-
12-
strategy:
13-
matrix:
14-
os: [ubuntu-latest]
15-
node: [14]
10+
runs-on: ubuntu-latest
1611

1712
steps:
1813
- name: Checkout
19-
uses: actions/checkout@master
14+
uses: actions/checkout@v4
2015

2116
- name: Setup node env
22-
uses: actions/setup-node@v2.1.2
17+
uses: actions/setup-node@v4
2318
with:
24-
node-version: ${{ matrix.node }}
19+
node-version: 22
20+
cache: npm
2521

2622
- name: Install dependencies
27-
run: npm install
23+
run: npm ci
2824

2925
- name: Generate
3026
run: npm run generate
3127

3228
- name: Deploy
33-
uses: peaceiris/actions-gh-pages@v3
29+
uses: peaceiris/actions-gh-pages@v4
3430
with:
3531
github_token: ${{ secrets.GITHUB_TOKEN }}
36-
publish_dir: ./dist
32+
publish_dir: ./.output/public

components/ArticleCard.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ const props = defineProps({
2929
})
3030
3131
const tags = computed(() => {
32-
return props.article.tags.split(',').map((tag) => tag.trim())
32+
if (Array.isArray(props.article.tags)) {
33+
return props.article.tags.map((tag) => String(tag).trim()).filter(Boolean)
34+
}
35+
if (typeof props.article.tags === 'string') {
36+
return props.article.tags.split(',').map((tag) => tag.trim()).filter(Boolean)
37+
}
38+
return []
3339
})
3440
</script>
3541

content.config.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { defineCollection, defineContentConfig } from '@nuxt/content'
2+
3+
export default defineContentConfig({
4+
collections: {
5+
articles: defineCollection({
6+
type: 'page',
7+
source: 'articles/*.md',
8+
}),
9+
pages: defineCollection({
10+
type: 'page',
11+
source: '*.md',
12+
}),
13+
},
14+
})

eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export default [
5757
useRoute: 'readonly',
5858
useRouter: 'readonly',
5959
useAsyncData: 'readonly',
60-
queryContent: 'readonly',
60+
queryCollection: 'readonly',
6161
ref: 'readonly',
6262
computed: 'readonly',
6363
watch: 'readonly',

0 commit comments

Comments
 (0)