Shibuya Shibuya Shibuya
  • Examples
    • Admonitions Bring the attention of readers
    • Code Blocks Display code with highlights
    • Autodoc API documentation automatically
    • Jupyter Notebook Rendering .ipynb files
  • Branding
  • Sponsor me
  • Discussion

Getting started

  • Installation
  • Configuration
    • Logos
    • CSS Variables
    • Colors
    • Navbar links
    • Layouts
    • Announcement
    • Social network
    • Fonts
    • Sidebar
    • Languages
    • Advertisement
    • Icons
    • Markdown
  • Writing Guide
    • Markups
    • Block quotes
    • Lists
    • Tables
    • Admonitions
    • Code blocks
    • Math
    • Images and videos
    • API reference
    • Meta tags

Extensions

  • sphinx-copybutton
  • sphinx-design
  • sphinx-tabs
  • sphinx-togglebutton
  • jupyter-sphinx
  • nbsphinx
  • numpydoc
  • sphinxcontrib-mermaid
  • sphinx-docsearch
  • sphinx-click
  • sphinx-sqlalchemy
  • sphinx-contributors

Development

  • Contributing
    • Translations
    • Roadmap
  • Alternatives
  • Stability Policy
  • Changelog

On this page

  • Carbon Ads
  • Ethical Ads
  • BuySellAds
    • Templates
    • Context
lepture/shibuya 0 0
Edit this page
  1. Shibuya /
  2. Configuration /
  3. Advertisement

Advertisement¶

Shibuya theme integrates advertisements seamlessly into your documentation. The theme supports popular ad networks, including Carbon Ads, Ethical Ads, and BuySellAds, allowing you to monetize your content without compromising on design or user experience.

Carbon Ads¶

Shibuya theme offers built-in support for Carbon Ads, a popular ad network focused on displaying unobtrusive and highly relevant ads to your audience.

By defining the Carbon Ads credentials in conf.py, Shibuya theme will display ads on the right sidebar.

html_theme_options = {
    # ...
    "carbon_ads_code": "your-carbon-code",
    "carbon_ads_placement": "your-carbon-placement",
}

Ethical Ads¶

When using Read the Docs to host your documentation, Ethical Ads will be injected automatically. The default publisher for Ethical Ads is readthedocs, you can also use your own publisher:

html_theme_options = {
    # ...
    "ethical_ads_publisher": "your-publisher-id",
}

Shibuya theme will display the Ethical Ads on the right sidebar.

BuySellAds¶

For those looking to connect with a broader range of advertisers, BuySellAds provides a platform to display ads from a wide variety of advertisers. Instead of displaying it in the right sidebar, Shibuya theme offers a way to place the Ad with a CSS selector.

Templates¶

BuySellAds is not enabled by default, so you’ll need to include the template manually. For example, you can add it to the partials/page-bottom.html template.

docs/_templates/partials/page-bottom.html¶
{% include "extensions/buysellads.html" %}

Context¶

You’ll also need to add the BuySellAds configuration to the html_context configuration. Here is an example of this (Shibuya) documentation’s conf.py:

conf.py¶
html_context = {
    "buysellads_code": "CE7DKK3M",
    "buysellads_placement": "shibuya",
    "buysellads_container_selector": ".yue > section > section",
}
Previous
Languages
Next
Icons

Copyright © 2023, Hsiaoming Yang

Made with Sphinx and Shibuya theme.