{
  "type": "module",
  "source": "doc/api/publishing.md",
  "modules": [
    {
      "textRaw": "Publishing your docs",
      "name": "publishing_your_docs",
      "type": "module",
      "desc": "<p><code>doc-kit generate</code> writes a fully static site, so publishing\nis as simple as hosting the output directory.</p>\n<pre><code class=\"language-bash\">npx @doc-kit/cli generate\n</code></pre>\n<p>Everything lands in your configured <code>output</code> directory (<code>out/</code> by\nconvention). Two things to know about the result:</p>\n<ul>\n<li>\n<p><strong>The <code>html</code> site must be served over HTTP.</strong> Its pages use import maps\nand client-side hydration, so opening the files with <code>file://</code> may show\nunstyled or inert pages. Preview a production build the same way you'd\nhost it:</p>\n<pre><code class=\"language-bash\">npx serve out\n</code></pre>\n</li>\n<li>\n<p><strong>Search requires its index.</strong> If your site uses search, generate the\nindex alongside the pages by targeting both generators — <code>target: ['html', 'orama-db']</code>, so the search box has data to query.</p>\n</li>\n</ul>",
      "modules": [
        {
          "textRaw": "Cache the assets",
          "name": "cache_the_assets",
          "type": "module",
          "desc": "<p>Every file the <code>html</code> generator writes to <code>assets/</code> (scripts, stylesheets,\nfonts) is named after a hash of its content, so a changed file always gets a\nnew name. Serve that directory with a long-lived, immutable cache, and let\neverything else (the pages, the search index) revalidate:</p>\n<pre><code>/assets/*   Cache-Control: public, max-age=31536000, immutable\n</code></pre>\n<p>Most hosts default to revalidating every file on every load instead, which\ncosts a request per asset each time a new tab opens the site. On Vercel:</p>\n<pre><code class=\"language-json\">{\n  \"headers\": [\n    {\n      \"source\": \"/assets/(.*)\",\n      \"headers\": [\n        {\n          \"key\": \"Cache-Control\",\n          \"value\": \"public, max-age=31536000, immutable\"\n        }\n      ]\n    }\n  ]\n}\n</code></pre>\n<p>Within a visit, moving between pages loads no assets at all: the site\nnavigates client-side, swapping in the next page's content.</p>",
          "displayName": "Cache the assets"
        },
        {
          "textRaw": "Compress the pages",
          "name": "compress_the_pages",
          "type": "module",
          "desc": "<p>doc-kit doesn't minify its output by default: compressed (gzip or brotli), as\nhosts serve it, it is far smaller than minifying would make it.</p>\n<p>Cloudflare, Vercel, Netlify, and GitHub Pages compress on their own, and so\ndoes <code>npx serve out</code>. If you serve the output yourself, turn compression on:</p>\n<ul>\n<li><strong>nginx:</strong> <code>gzip on;</code> compresses HTML; add the other types with\n<code>gzip_types text/css application/javascript application/json;</code>.</li>\n<li><strong>Caddy:</strong> <code>encode zstd gzip</code>.</li>\n<li><strong>Apache:</strong> with <code>mod_deflate</code>,\n<code>AddOutputFilterByType DEFLATE text/html text/css application/javascript application/json</code>.</li>\n<li><strong>Amazon S3:</strong> serve the bucket through CloudFront, with <strong>Compress objects\nautomatically</strong> on.</li>\n</ul>",
          "displayName": "Compress the pages"
        },
        {
          "textRaw": "Tell doc-kit its public URL",
          "name": "tell_doc-kit_its_public_url",
          "type": "module",
          "desc": "<p>Set <code>baseURL</code> to where the site will live. Generators that emit absolute\nURLs (e.g., <code>sitemap</code>, <code>llms-txt</code>) will need it in order to generate their\noutput.</p>\n<pre><code class=\"language-mjs\">export default {\n  global: {\n    baseURL: 'https://example.com/docs',\n  },\n\n  html: {\n    // Where a page's canonical URL lives; {path} is filled per page\n    pageURL: 'https://example.com/docs{path}.html',\n  },\n};\n</code></pre>",
          "displayName": "Tell doc-kit its public URL"
        },
        {
          "textRaw": "Machine-readable companions",
          "name": "machine-readable_companions",
          "type": "module",
          "desc": "<p>Search engines and language models each get their own artifact — add the\ngenerators and they share the same parse:</p>\n<pre><code class=\"language-mjs\">target: ['html', 'orama-db', 'sitemap', 'llms-txt'],\n</code></pre>\n<p><code>sitemap</code> emits <code>sitemap.xml</code>; <code>llms-txt</code> emits an\n<a href=\"https://llmstxt.org/\"><code>llms.txt</code></a> index of your pages.</p>",
          "displayName": "Machine-readable companions"
        },
        {
          "textRaw": "Versioned docs",
          "name": "versioned_docs",
          "type": "module",
          "desc": "<p>The version selector in the sidebar is built from your <code>changelog</code> — a\nrelease history the generators parse into selectable versions. Point\n<code>global.changelog</code> at a <code>CHANGELOG.md</code> (URL or path) that lists your\nreleases, and each build renders its <code>version</code> with links to the others. A\nproject without release history simply gets no selector. See the\n<a href=\"./configuration.html\">configuration reference</a> for the accepted formats.</p>",
          "displayName": "Versioned docs"
        }
      ],
      "displayName": "Publishing your docs"
    }
  ]
}