diff --git a/package.json b/package.json index 69218ff..11d84ae 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "eslint-config-next": "14.0.1", "postcss": "^8", "remark-cli": "^12.0.0", + "remark-frontmatter": "^5.0.0", "remark-lint-fenced-code-flag": "^3.1.2", "remark-lint-first-heading-level": "^3.1.2", "remark-lint-heading-increment": "^3.1.2", @@ -46,6 +47,7 @@ "rule": "-" }, "plugins": [ + "remark-frontmatter", "remark-preset-lint-consistent", "remark-preset-lint-recommended", "remark-lint-fenced-code-flag", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 512d449..eae82be 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -49,6 +49,9 @@ devDependencies: remark-cli: specifier: ^12.0.0 version: 12.0.0 + remark-frontmatter: + specifier: ^5.0.0 + version: 5.0.0 remark-lint-fenced-code-flag: specifier: ^3.1.2 version: 3.1.2 @@ -1792,7 +1795,6 @@ packages: /escape-string-regexp@5.0.0: resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} engines: {node: '>=12'} - dev: false /eslint-config-next@14.0.1(eslint@8.52.0)(typescript@5.2.2): resolution: {integrity: sha512-QfIFK2WD39H4WOespjgf6PLv9Bpsd7KGGelCtmq4l67nGvnlsGpuvj0hIT+aIy6p5gKH+lAChYILsyDlxP52yg==} @@ -2173,6 +2175,12 @@ packages: reusify: 1.0.4 dev: true + /fault@2.0.1: + resolution: {integrity: sha512-WtySTkS4OKev5JtpHXnib4Gxiurzh5NCGvWrFaZ34m6JehfTUhKZvn9njTfw48t6JumVQOmrKqpmGcdwxnhqBQ==} + dependencies: + format: 0.2.2 + dev: true + /file-entry-cache@6.0.1: resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} engines: {node: ^10.12.0 || >=12.0.0} @@ -2230,6 +2238,11 @@ packages: signal-exit: 4.1.0 dev: true + /format@0.2.2: + resolution: {integrity: sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww==} + engines: {node: '>=0.4.x'} + dev: true + /fraction.js@4.3.7: resolution: {integrity: sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==} dev: true @@ -3230,6 +3243,19 @@ packages: - supports-color dev: true + /mdast-util-frontmatter@2.0.1: + resolution: {integrity: sha512-LRqI9+wdgC25P0URIJY9vwocIzCcksduHQ9OF2joxQoyTNVduwLAFUzjoopuRJbJAReaKrNQKAZKL3uCMugWJA==} + dependencies: + '@types/mdast': 4.0.3 + devlop: 1.1.0 + escape-string-regexp: 5.0.0 + mdast-util-from-markdown: 2.0.0 + mdast-util-to-markdown: 2.1.0 + micromark-extension-frontmatter: 2.0.0 + transitivePeerDependencies: + - supports-color + dev: true + /mdast-util-gfm-autolink-literal@1.0.3: resolution: {integrity: sha512-My8KJ57FYEy2W2LyNom4n3E7hKTuQk/0SES0u16tjA9Z3oFkF4RrC/hPAPgjlSpezsOvI8ObcXcElo92wn5IGA==} dependencies: @@ -3502,6 +3528,15 @@ packages: micromark-util-types: 2.0.0 dev: true + /micromark-extension-frontmatter@2.0.0: + resolution: {integrity: sha512-C4AkuM3dA58cgZha7zVnuVxBhDsbttIMiytjgsM2XbHAB2faRVaHRle40558FBN+DJcrLNCoqG5mlrpdU4cRtg==} + dependencies: + fault: 2.0.1 + micromark-util-character: 2.0.1 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + dev: true + /micromark-extension-gfm-autolink-literal@1.0.5: resolution: {integrity: sha512-z3wJSLrDf8kRDOh2qBtoTRD53vJ+CWIyo7uyZuxf/JAbNJjiHsOpG1y5wxk8drtv3ETAHutCu6N3thkOOgueWg==} dependencies: @@ -4665,6 +4700,17 @@ packages: - supports-color dev: true + /remark-frontmatter@5.0.0: + resolution: {integrity: sha512-XTFYvNASMe5iPN0719nPrdItC9aU0ssC4v14mH1BCi1u0n1gAocqcujWUrByftZTbLhRtiKRyjYTSIOcr69UVQ==} + dependencies: + '@types/mdast': 4.0.3 + mdast-util-frontmatter: 2.0.1 + micromark-extension-frontmatter: 2.0.0 + unified: 11.0.4 + transitivePeerDependencies: + - supports-color + dev: true + /remark-gfm@3.0.1: resolution: {integrity: sha512-lEFDoi2PICJyNrACFOfDD3JlLkuSbOa5Wd8EPt06HUdptv8Gn0bxYTdbU/XXQ3swAPkEaGxxPN9cbnMHvVu1Ig==} dependencies: diff --git a/src/pages/docs/index.mdx b/src/pages/docs/index.mdx index 9e68a17..12cba96 100644 --- a/src/pages/docs/index.mdx +++ b/src/pages/docs/index.mdx @@ -1,3 +1,7 @@ +--- +title: docs +--- + import { Cards, Card } from 'nextra/components' **Under the hood** web3.storage uses [UCANs](https://github.com/ucan-wg/spec) for trustless, local-first authorization, and is backed by the provable storage of [IPFS](https://docs.ipfs.tech/) and [Filecoin](https://docs.filecoin.io/basics/what-is-filecoin). diff --git a/src/theme.config.jsx b/src/theme.config.jsx index a825dea..a127914 100644 --- a/src/theme.config.jsx +++ b/src/theme.config.jsx @@ -1,28 +1,77 @@ +import { useConfig } from 'nextra-theme-docs' import { DocsLogo } from './components/brand' -const config = { +/** + * @type {import('nextra-theme-docs').DocsThemeConfig} + */ +export default { logo: web3.storage/docs, + primaryHue: { + dark: 192, + light: 200 + }, + primarySaturation: 100, project: { link: 'https://github.com/web3-storage/w3up' }, docsRepositoryBase: 'https://github.com/web3-storage/www/tree/main', + footer: { + component: + }, + head: <>, useNextSeoProps() { + const { frontMatter } = useConfig() return { - titleTemplate: '%s ⁂ web3.storage' + titleTemplate: '%s ⁂ web3.storage', + description: frontMatter.description || 'Learn how to use web3.storage to decentralize your data storage', + additionalMetaTags: [ + { content: 'en', httpEquiv: 'Content-Language' }, + { name: 'apple-mobile-web-app-title', content: 'web3.storage/docs' }, + { name: 'msapplication-TileColor', content: '#fff' }, + { name: 'msapplication-TileImage', content: '/app-icon.svg' } + ], + openGraph: { + // set when we have a nice preview image. No image more chill tho, so dont rush./ + // images: [ + // { url: frontMatter.image || 'https://web3.storage/social-card-web3storage.jpg' } + // ] + }, + twitter: { + cardType: 'summary', + site: '@web3_storage' + }, + additionalLinkTags: [ + { + href: '/apple-touch-icon.png', + rel: 'apple-touch-icon', + sizes: '180x180' + }, + { + href: '/android-chrome-192x192.png', + rel: 'icon', + sizes: '192x192', + type: 'image/png' + }, + { + href: '/android-chrome-512x512.png', + rel: 'icon', + sizes: '512x512', + type: 'image/png' + }, + { + href: '/favicon-32x32.png', + rel: 'icon', + sizes: '32x32', + type: 'image/png' + }, + { + href: '/favicon-16x16.png', + rel: 'icon', + sizes: '16x16', + type: 'image/png' + } + ], } - }, - footer: { - component: ( - - ) - }, - primaryHue: { - dark: 192, - light: 200 - }, - primarySaturation: 100, + } } -export default config