Notaku supports hosting a docs site under your own domain and make it available on the
/docs
path.This is an alternative to using a subdomain of your website like
docs.site.com
, you can instead show the Notaku docs at site.com/docs
.To support this feature you will need to reroute all traffic beginning with
/docs
path to a Notaku special url ending with docs-base-path.notaku.site/docs
.Examples
Next.js
Add the following config to your Next.js project to reroute traffic from /docs to Notaku servers.
The
rewrites()
function will route traffic from the /docs paths to the Notaku siteThe Notaku url is available in the site dashboard in the settings tab, it should end with
.docs-base-path.notaku.site
javascript// next.config.js /** @type {import('next').NextConfig} */ const config = { rewrites() { const notakuDocsUrlWithBasePath = new URL( // TODO replace this with your own url found in dashboard `https://{{your-site-uid}}.docs-base-path.notaku.site`, ).origin return [ { source: '/docs', destination: `${notakuDocsUrlWithBasePath}/docs`, }, { source: '/docs/:path*', destination: `${notakuDocsUrlWithBasePath}/docs/:path*`, }, ] }, } module.exports = config
If you also want to host the blog site under a /blog path you can do the same with your blog site url.
Cloudflare workers
Use the following code in your cloudflare worker to reroute traffic from `/docs` to our servers.
javascriptaddEventListener('fetch', (event) => { var url = new URL(event.request.url) if (url.pathname.startsWith('/docs/') || url.pathname === '/docs') { const rewriteTo = new URL( // TODO replace this url with your own, found on site dashboard `https://{{your-site-uid}}.docs-base-path.notaku.site`, ) event.passThroughOnException() event.respondWith( fetch(`${rewriteTo.origin}${url.pathname}`, event.request), ) } else { event.respondWith(fetch(event.request)) } })