Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ブログを作るなら Nuxt Content v2はいいぞ
Search
Fulu
October 16, 2022
Technology
0
130
ブログを作るなら Nuxt Content v2はいいぞ
Vue Fes Japan 2022 のLT内容です
https://vuefes.jp/2022/sessions/FurusawaKaoru
Fulu
October 16, 2022
Tweet
Share
Other Decks in Technology
See All in Technology
脅威をモデリングしてMCPのセキュリティ対策を考えよう
flatt_security
4
1.7k
AIエージェントの継続的改善のためオブザーバビリティ
pharma_x_tech
6
1.3k
Perk アプリの技術選定とリリースから1年弱経ってのふりかえり
stomk
0
110
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
5
38k
開発効率と信頼性を両立する Ubieのプラットフォームエンジニアリング
teru0x1
0
140
DenoとJSRで実現する最速MCPサーバー開発記 / Building MCP Servers at Lightning Speed with Deno and JSR
yamanoku
1
100
技術職じゃない私がVibe Codingで感じた、AGIが身近になる未来
blueb
0
130
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
7.4k
TODAY 看世界(?) 是我們在看扣啦!
line_developers_tw
PRO
0
240
Nonaka Sensei
kawaguti
PRO
4
730
OpenTelemetry Collector internals
ymotongpoo
5
550
評価の納得感を2段階高める「構造化フィードバック」
aloerina
1
210
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
269
20k
Designing Experiences People Love
moore
142
24k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
46
9.6k
Art, The Web, and Tiny UX
lynnandtonic
299
21k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
4
170
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
How GitHub (no longer) Works
holman
314
140k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
780
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
16
920
Six Lessons from altMBA
skipperchong
28
3.8k
Transcript
ブログを作るなら Nuxt Content v2はいいぞ Vue Fes Japan 2022
自己紹介 Furusawa Kaoru ユアマイスター株式会社 フロントエンドエンジニア Twitter: @firirice
ブログを作るって大変だと思いませんか?
例えば、〇〇ヘッドレスCMSを使うとして • API仕様を確認してからNuxtからAPIを呼ぶように実装する • APIの仕様変更や他のCMSへの移行を考慮しながらComposable 設計を行う
ファイルを置くだけで静的コンテンツが作れる contentディレクトリを作って、記事ファイルを置くだけで静的コンテンツを作れる。 (ファイルの対応形式は Markdown、YML、CSV、 JSON) # Hello ## Nuxt Contentはいいぞ
content/index.md <template> <main> <ContentDoc /> </main> </template> pages/index.vue
ファイルを置くだけで静的コンテンツが作れる contentディレクトリを作って、記事ファイルを置くだけで静的コンテンツを作れる。 対応している形式は Markdown、YML、CSV、 JSON。 # Hello ## Nuxt Contentはいいぞ
content/index.md
自動でパースされるものって装飾が大変じゃない?
Prose Componentsで各タグの装飾ができる Nuxt Content内部にあるComponentと同じ名前のComponentを配置することでオーバーライドして、各タグ の装飾ができる。 https://content.nuxtjs.org/api/components/prose#prose-components
使用例① <script setup lang="ts"> defineProps<{ id: string }>() </script> <template>
<h1 :id="id" class="mb-8 border-b pb-2 text-4xl font-bold"> <a :href="`#${id}`" class="group relative"> <slot /> <font-awesome-icon icon="link" class="absolute text-base opacity-0 group-hover:opacity-100" /> </a> </h1> </template> components/content/ProseH1.vue
使用例② <template> <div class="bg-gray-100 p-4 relative"> <slot /> <font-awesome-icon icon="copy"
class="absolute bottom-2 right-2 opacity-0 hover:opacity-100" @click="copy" /> </div> </template> components/content/ProseCode.vue
MDC(MarkDown Components) Syntax markdownから任意のVue Componentを使うことができる。 # Hello ## Nuxt Content
はいいぞ ::card The content of the card :: content/index.md <template> <div class="rounded border bg-white p-6"> <slot /> </div> </template> components/content/Card.vue
• markdownで書いた記事をディレクトリに置くだけで静的コンテンツを作れます • Prose Components: 各タグを簡単にカスタマイズできる • MDC Syntax: markdownからVue
Componentが使える • 他にも便利な機能がある ◦ nuxt.configに設定するだけでcodeのHigh Lightができる ◦ Mongo DBライクにデータを取得できるAPI Nuxt Contentはいいぞ
ご清聴ありがとうございました
Coming Soon
None