Explore themes · Nuxt Studioに掲載されている
ドキュメントサイトを作るテーマが3つあったので、
少しみてみたときの備忘録(*´ω`*)
- nuxt-themes/alpine: The minimalist blog theme, powered by Nuxt & Markdown.
- nuxt-themes/docus: Write beautiful documentations with Nuxt and Markdown.
- Atinux/content-wind: A lightweight Nuxt theme to build a Markdown driven website. Powered by Nuxt Content, TailwindCSS and Iconify.
ざっくりまとめ
基本構成
- サイトの設定 ... app.config.ts (theme独自 + )
- デザインの設定 ... tokens.config.ts (pinceauベース)
- コンポーネントのカスタマイズは、同じディレクトリ/ファイルで上書き可能
.nuxt/components.d.ts
を見ると、自分のパスになっている。
基本的なディレクトリ構成は同じ
doc-site/ ├── content/ ... Markdownファイル ├── public/ ... 画像などのstatic assset ├── app.config.ts ... テーマの設定 ├── tokens.config.ts ... デザイントークンの設定 ├── nuxt.config.ts ├── package.json └── tsconfig.json
各テーマの構成もこんな感じでNuxtの構成と一緒。
どんなコンポーネント、レイアウト、設定があるかは、
ここを見ると詳しくわかるかも。
doc-theme/ ├── assets/ ... cssなど ├── components/ ... コンポーネントの一覧 │ └── content/ ├── composables/ ... composables ├── layouts/ ... layout ├── app.vue ├── app.config.ts ... テーマの設定のデフォルト ├── nuxt.schema.ts ... テーマの設定の型定義 ├── tokens.config.ts ... デザイントークンのデフォルト ├── nuxt.config.ts └── tsconfig.json
使われているライブラリもだいたい同じ感じ。
- file-base CMS: nuxt/content
- icon: nuxt-icon / Iconify
- styling: @nuxt-themes/typography / @nuxt-themes/tokens / pinceau
- color-mode: @nuxtjs/color-mode
Apline
- シンプル。profile page / complete blogなど小規模向け。
- 30種類以上のコンポーネントを用意(nuxt-elements+alpine独自)
- styling: pinceau+@nuxt-themes/tokens
- layout: default/page/articleの3つ
- 各種リンク
- starter:
npx nuxi init -t themes/alpine alpine
- repo: nuxt-themes/alpine: The minimalist blog theme, powered by Nuxt & Markdown.
- starter:
Docus
- document-driven websitesなど全般をカバー。リッチ
- 30種類以上のコンポーネントを用意(nuxt-elements+alpine独自)
- styling: pinceau+@nuxt-themes/tokens
- layout: default/pageの2つ
- composablesも提供
- 各種リンク
- doc: Home · Docus
- starter:
npx nuxi init -t themes/docus doucus-sample
- repo: nuxt-themes/docus: Write beautiful documentations with Nuxt and Markdown.
Content Wind
- personal website向け
- styleはTailwindCSS + pinceau、@nuxt-themes/tokens
- tailwindのcolorをtokens.config.tsで利用している形
- layout: default/full-widthの2つ
- 他のテーマでTailwindCSSを入れたいときに参考になるかも。
- 各種リンク
- starter:
npx nuxi@latest init -t themes/content-wind content-wind-sample
- repo: Atinux/content-wind: A lightweight Nuxt theme to build a Markdown driven website. Powered by Nuxt Content, TailwindCSS and Iconify.
- starter:
各Themeの中身
Apline
Aplineテーマ自体が使ってるライブラリ
"dependencies": { "@nuxt-themes/elements": "^0.9.4", // UIコンポーネント。非公開リポジトリ? "@nuxt-themes/tokens": "^1.9.1", // "@nuxt-themes/typography": "^0.11.0", "@nuxt/content": "^2.7.0", "@nuxthq/studio": "^0.13.3", "@vueuse/core": "^10.2.1", "ufo": "^1.1.2" },
Aplineテーマが提供しているcomponentsやlayoutsなど
$ tree alpine-theme/ --dirsfirst -I node_modules # Alpine Theme # https://github.com/nuxt-themes/alpine alpine/ ├── assets │ └── main.css ├── components │ ├── content │ │ ├── ArticlesList.vue │ │ ├── ArticlesListItem.vue │ │ ├── ContactForm.vue │ │ ├── Gallery.vue │ │ └── Hero.vue │ ├── data-entry │ │ └── Input.vue │ ├── AppFooter.vue │ ├── AppHeader.vue │ ├── AppLayout.vue │ ├── AppLoadingBar.vue │ ├── Button.vue │ ├── ColorModeSwitch.vue │ ├── DocumentDrivenNotFound.vue │ ├── MainNav.vue │ └── SocialIcons.vue ├── composables │ └── date.ts ├── layouts │ ├── article.vue │ ├── default.vue │ └── page.vue ├── types │ └── contact.ts ├── app.vue ├── app.config.ts ... テーマの設定のデフォルト ├── nuxt.schema.ts ... テーマの設定の型定義 ├── tokens.config.ts ... デザイントークンのデフォルト ├── nuxt.config.ts └── tsconfig.json
Docus
Docusテーマ自体が使ってるライブラリ
"dependencies": { "@nuxt-themes/elements": "^0.9.4", "@nuxt-themes/tokens": "^1.9.1", "@nuxt-themes/typography": "^0.11.0", "@nuxt/content": "^2.7.0", "@nuxthq/studio": "^0.13.4", "@vueuse/integrations": "^10.2.1", "@vueuse/nuxt": "^10.2.1", "focus-trap": "^7.5.2", "fuse.js": "^6.6.2" },
Docusテーマが提供しているcomponentsやlayoutsなど
$ tree docus-theme/ --dirsfirst -I node_modules docus-theme/ ├── app ... Algoliaで検索用? │ ├── integrations │ │ └── docsearch.ts │ ├── module.ts │ └── router.options.ts ├── assets │ └── css │ └── main.css ├── components │ ├── app │ │ ├── AppFooter.vue │ │ ├── AppHeader.vue │ │ ├── AppHeaderDialog.vue │ │ ├── AppHeaderLogo.vue │ │ ├── AppHeaderNavigation.vue │ │ ├── AppLayout.vue │ │ ├── AppLoadingBar.vue │ │ ├── AppSearch.vue │ │ ├── AppSocialIcons.vue │ │ ├── DocumentDrivenNotFound.vue │ │ ├── Ellipsis.vue │ │ ├── Logo.vue │ │ └── ThemeSelect.vue │ └── docs │ ├── DocsAside.vue │ ├── DocsAsideTree.vue │ ├── DocsPageBottom.vue │ ├── DocsPageLayout.vue │ ├── DocsPrevNext.vue │ ├── DocsToc.vue │ ├── DocsTocLinks.vue │ ├── EditOnLink.vue │ └── SourceLink.vue ├── composables │ ├── useDocSearch.ts │ ├── useDocus.ts │ ├── useMenu.ts │ └── useScrollspy.ts ├── layouts │ ├── default.vue │ └── page.vue ├── plugins │ ├── menu.ts │ └── scrollbars.client.ts ├── server │ └── api │ └── search.ts ├── app.vue ├── app.config.ts ... テーマの設定のデフォルト ├── nuxt.schema.ts ... テーマの設定の型定義 ├── tokens.config.ts ... デザイントークンのデフォルト ├── nuxt.config.ts ├── package.json └── tsconfig.json
"devDependencies": { "@nuxtjs/algolia": "^1.8.0", "@algolia/client-search": "^4.18.0", "@docsearch/css": "^3.5.1", "@docsearch/js": "^3.5.1", },
- nuxt-modules/algolia: 🔎 Algolia module for Nuxt
- algolia/algoliasearch-client-javascript: ⚡️ A fully-featured and blazing-fast JavaScript API client to interact with Algolia.
- algolia/docsearch: :blue_book: The easiest way to add search to your documentation.
Content Wind
- TailwindCSS
- Atinux/content-wind: A lightweight Nuxt theme to build a Markdown driven website. Powered by Nuxt Content, TailwindCSS and Iconify.
Content Windテーマ自体が使ってるライブラリ
"dependencies": { "@nuxt-themes/elements": "^1.0.4", "@nuxt-themes/tokens": "^2.0.1", "@nuxt-themes/typography": "^1.0.0", "@nuxt/content": "^2.7.0", "@nuxtjs/color-mode": "^3.3.0", "@nuxtjs/tailwindcss": "^6.8.0", "nuxt-icon": "^0.4.2" },
Content Windテーマが提供しているcomponentsやlayoutsなど
$ tree content-wind-theme/ --dirsfirst -I node_modules content-wind-theme/ ├── components │ ├── content │ │ └── MarkdownBlock.vue │ ├── AppLayout.vue │ ├── AppLoadingBar.vue │ ├── AppNavbar.vue │ └── ColorModeSwitch.vue ├── layouts │ ├── default.vue │ └── full-width.vue ├── app.vue ├── app.config.ts ... テーマの設定のデフォルト ├── nuxt.schema.ts ... テーマの設定の型定義 ├── tokens.config.ts ... デザイントークンのデフォルト ├── tailwind.config.ts ... Tailwindの設定 ├── nuxt.config.ts ├── package.json └── tsconfig.json
併用されているライブラリ
- file-base CMS: nuxt/content
- icon: nuxt-icon / Iconify
- styling: @nuxt-themes/typography / @nuxt-themes/tokens / pinceau
- color-mode: @nuxtjs/color-mode
@nuxt-themes/tokens
"dependencies": { "@nuxtjs/color-mode": "^3.3.0", "@vueuse/core": "^10.2.0", "pinceau": "^0.19.1" }, "devDependencies": { "style-value-types": "^5.1.2", "@nuxt-themes/typography": "^1.0.0", "@nuxt/content": "^2.7.0", "@vueuse/motion": "2.0.0", "nuxt-icon": "^0.4.1", },
@nuxt-themes/typography
"dependencies": { "@nuxtjs/color-mode": "^3.2.0", "@vueuse/core": "^10.2.1", "nuxt-config-schema": "^0.4.6", "nuxt-icon": "^0.4.1", "pinceau": "^0.19.0", "ufo": "^1.1.2" }, "devDependencies": { "@nuxt-themes/tokens": "^2.0.0", "@nuxt/content": "2.6.0", },
@nuxt-themes/elements
リポジトリは見つけられなかったので、
node_modules/@nuxt-themes/elements
配下をのぞいてみた。
$ tree "node_modules/@nuxt-themes/elements" --dirsfirst node_modules/@nuxt-themes/elements/ ├── components │ ├── globals │ │ ├── Alert.vue │ │ ├── Badge.vue │ │ ├── ButtonLink.vue │ │ ├── Callout.vue │ │ ├── CodeBlock.vue │ │ ├── CodeGroup.vue │ │ ├── Container.vue │ │ ├── CopyButton.vue │ │ ├── Ellipsis.vue │ │ ├── List.vue │ │ ├── NuxtImg.vue │ │ ├── Props.vue │ │ ├── Sandbox.vue │ │ ├── SourceLink.vue │ │ ├── TabsHeader.vue │ │ ├── Terminal.vue │ │ └── VideoPlayer.vue │ ├── icons │ │ ├── IconCodeSandBox.vue │ │ ├── IconDocus.vue │ │ ├── IconNuxt.vue │ │ ├── IconNuxtContent.vue │ │ ├── IconNuxtLabs.vue │ │ ├── IconNuxtStudio.vue │ │ ├── IconStackBlitz.vue │ │ └── IconVueTelescope.vue │ ├── landing │ │ ├── BlockHero.vue │ │ ├── Card.vue │ │ └── CardGrid.vue │ ├── meta │ │ ├── ComponentPlayground.vue │ │ ├── ComponentPlaygroundData.vue │ │ ├── ComponentPlaygroundProps.vue │ │ ├── ComponentPlaygroundSlots.vue │ │ ├── ComponentPlaygroundTokens.vue │ │ ├── PreviewLayout.vue │ │ └── TokensPlayground.vue │ └── volta │ └── VoltaBoard.vue ├── app.config.ts ├── nuxt.config.ts ├── package.json └── tokens.config.ts
Nuxt Studio Theme Starter
テーマのStarterもあるっぽい?
Create a compatible Nuxt Studio theme with this GitHub template.
$ tree nuxt-themes-starter/ --dirsfirst
nuxt-themes-starter/
├── components
│ ├── content
│ │ └── HelloWorld.vue
│ └── AppLayout.vue
├── layouts
│ └── default.vue
├── app.vue
├── app.config.ts ... テーマの設定のデフォルト
├── nuxt.schema.ts ... テーマの設定の型定義
├── tokens.config.ts ... デザイントークンのデフォルト
├── nuxt.config.ts
├── package.json
└── tsconfig.json
"dependencies": { "@nuxt/content": "^2.6.0", "pinceau": "^0.18.9", "@nuxthq/studio": "^0.13.2" }, "devDependencies": { "@nuxt/eslint-config": "^0.1.1", "eslint": "^8.42.0", "nuxt": "^3.5.2", "typescript": "^5.1.3" }
よく使いそうなモジュール
使われてないけど、これらもよく使いそう。
NuxtのModulesにあるものからpickup
- 画像最適化: nuxt/image: Plug-and-play image optimization for Nuxt applications.
- i18n: nuxt-modules/i18n: I18n module for Nuxt
- Google Analytics: johannschopplich/nuxt-gtag: 🔸 Google Analytics integration for Nuxt 3
- Google Tag Manage: zadigetvoltaire/nuxt-gtm: Nuxt 3 module for Google Tag Manager
- Google AdSense: nuxt-modules/google-adsense: Google AdSense module for Nuxt.js
- Google Unlighthouse: harlan-zw/unlighthouse: Scan your entire site with Google Lighthouse in 2 minutes (on average). Open source, fully configurable with minimal setup.
- Google Font: nuxt-modules/google-fonts: Google Fonts module for NuxtJS
- robots.txt: nuxt-modules/robots: NuxtJS module for robots.txt
- sitemap: harlan-zw/nuxt-simple-sitemap: Powerfully flexible XML Sitemaps that integrate seamlessly, for Nuxt.
- Google Rich Results: harlan-zw/unhead-schema-org: Simple, universal Schema.org. Powered by △ Unhead.
- @vueuse/schema-orgから移動したっぽい。@unhead傘下?
- RSS feed: tresko/nuxt-module-feed: Feed module - Everyone deserves RSS, Atom and JSON
- Cookie-Control: dargmuesli/nuxt-cookie-control: A highly configurable cookie banner for Nuxt.
ほかにも気になるやつ
- SVG最適化: cpsoinos/nuxt-svgo: SVGO loader for Nuxt
- Google Singin: wavezync/nuxt-vue3-google-signin: Nuxt Module for vue3-google-signin
- Validation: logaretm/vee-validate: ✅ Painless Vue forms
- Type safe routing: victorgarciaesgi/nuxt-typed-router: 🚦Provide autocompletion for routes paths, names and params in Nuxt apps
- OGP生成: harlan-zw/nuxt-og-image: Enlightened runtime images generated with Vue templates.
- VercelのSatoriを利用。Tailwind、Google fonts、emojiをサポート
- Twemoji: Yizack/nuxt-twemoji: Twemoji module for Nuxt. Render emojis as SVG elements or PNG images.
以上!! Docusが一番リッチで汎用性がある感じ(*´ω`*)