mirror of https://github.com/vuejs/vitepress
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
812 B
30 lines
812 B
---
|
|
description: Integrate Carbon Ads into your VitePress site using the default theme's built-in support.
|
|
---
|
|
|
|
# Carbon Ads
|
|
|
|
VitePress has built in native support for [Carbon Ads](https://www.carbonads.net/). By defining the Carbon Ads credentials in config, VitePress will display ads on the page.
|
|
|
|
```js
|
|
export default {
|
|
themeConfig: {
|
|
carbonAds: {
|
|
code: 'your-carbon-code',
|
|
placement: 'your-carbon-placement',
|
|
format: 'classic'
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
These values are used to call carbon CDN script as shown below.
|
|
|
|
The `format` option supports `classic`, `responsive`, and `cover`.
|
|
|
|
```js
|
|
`//cdn.carbonads.com/carbon.js?serve=${code}&placement=${placement}&format=${format}`
|
|
```
|
|
|
|
To learn more about Carbon Ads configuration, please visit [Carbon Ads website](https://www.carbonads.net/).
|