Carbon Ads

Run ads at the bottom of the TOC section.

shadcn-docs-nuxt has built-in support for Carbon Ads. Add your Carbon Ads credentials to app.config.ts and ads will be displayed at the bottom of the toc section.

app.config.ts
export default defineAppConfig({
  shadcnDocs: {
    toc: {
      enable: true,
      carbonAds: {
        enable: true,
        disableInDev: false,
        code: 'your-carbon-code',
        placement: 'your-carbon-placement',
        format: 'your-carbon-format', // defaults to 'cover'
      },
    }
  },
});

These values are used to call carbon CDN script as shown below.

`//cdn.carbonads.com/carbon.js?serve=${code}&placement=${placement}&format=${format}`;

Disabling on certain pages

---
title: Page Title
toc:
  carbonAds:
    enable: false
---

<!-- Page Content -->

Parameters

enableboolean
false
Whether to turn on Carbon Ads.
disableInDevboolean
false
Whether to disable Carbon Ads in dev environment.
codestring
Carbon Ads code.
placementstring
Carbon Ads placement.
format'cover' | 'responsive'
cover
Carbon Ads format.