> Fetch the complete documentation index at: https://sphinxawesome.xyz/llms.txt
> Use this file to discover available pages before exploring further.

# Configure the theme

Configure the Awesome Theme.

## Syntax highlighting

You can use any Pygments color scheme for syntax highlighting in code blocks. To use the same color scheme in both modes, set [`pygments_style`](https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-pygments_style):

```python
pygments_style = "xcode"
```

To use different color schemes for light mode and dark mode, set `pygments_style` and `pygments_style_dark`. For example, this documentation uses `xcode` in light mode and `github-dark` in dark mode:

```python
pygments_style = "xcode"
pygments_style_dark = "github-dark"
```

Both schemes use muted colors. These colors suit the neutral palette of the theme. You can also try these Pygments color schemes:

- Light mode: `default`, `friendly`, `vs`
- Dark mode: `one-dark`, `nord`, `night-owl`

After you select the color schemes, check code blocks in light mode and dark mode. Make sure that text, highlighted tokens, and line numbers have enough contrast. A color scheme designed for one mode might not work in the other mode.

To change the background of code blocks, [add custom CSS](../customize/css/index.html.md#sec-custom-css). For example, this CSS makes the background transparent in both modes:

```css
:root:not(.dark) .highlight,
:root.dark .highlight {
   background-color: transparent;
}
```

You can replace `transparent` with another CSS color. Check the contrast again after you change the background.

## Permalinks icons

By default, Sphinx adds a link with a ¶ icon to each heading. You can use these links to link to each section of a page.

To use the default icon, put it in a `<span>` element:

```python
html_permalinks_icon = "<span>¶</span>"
```

With this change, the icon shows only when you hover over the heading or move focus to it.

To use the same icon as the documentation for the Awesome Theme, add this code to your Sphinx configuration:

```python
from sphinxawesome_theme.postprocess import Icons

html_permalinks_icon = Icons.permalinks_icon
```

## Logos

Set the path to your logo with the [`html_logo`](https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_logo) option. If your logo works well in dark mode, you need only one logo.

To use different logos for *light* and *dark* mode, add them to your theme options:

```python
html_theme_options = {
    "logo_light": "path/to/light/logo",
    "logo_dark": "path/to/dark/logo"
}
```

## Sidebars

The Awesome Theme uses the [`html_sidebars`](https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_sidebars) setting for the sidebar.

The default setting is:

```python
html_sidebars = {
  "**": ["sidebar_main_nav_links.html", "sidebar_toc.html"]
}
```

This setting shows a sidebar on every page. The sidebar contains the links to your documentation pages. On small screens, it also contains the main navigation links from the header.

You can change the sidebar for each page. For example, to hide the sidebar on large screens but show the header navigation links on an `about` page:

```python
html_sidebars = {
  "about": ["sidebar_main_nav_links.html"]
}
```

To hide the sidebar fully, use `html_sidebars = {"**": []}`.

<a id="module-sphinxawesome_theme"></a>

<a id="sec-theme-options"></a>

## Theme options

Use the [`html_theme_options`](https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_theme_options) dictionary to configure the Awesome Theme. For code completion and documentation in your editor, use the [`ThemeOptions`](#sphinxawesome_theme.ThemeOptions) class:

```python
from dataclasses import asdict
from sphinxawesome_theme import ThemeOptions

theme_options = ThemeOptions(
   # Add your theme options. For example:
   show_breadcrumbs=True,
   main_nav_links={"About": "/about"},
)

html_theme_options = asdict(theme_options)
```

You can also use a regular dictionary:

```python
html_theme_options = {
   # Add your theme options. For example:
   "show_breadcrumbs": True,
   "main_nav_links": {
      "About": "/about",
   }
}
```

### *class* ThemeOptions

Helper class for configuring the Awesome Theme.

Each attribute becomes a key in the [`html_theme_options`](https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_theme_options) dictionary.

#### awesome_external_links *: bool* *= False*

If true, the theme includes an icon after external links and adds `rel="nofollow noopener"` to the links’ attributes.

#### awesome_headerlinks *: bool* *= True*

If true, clicking a headerlink copies its URL to the clipboard.

#### breadcrumbs_separator *: str* *= '/'*

The separator for the breadcrumbs links.

#### extra_header_link_icons *: dict[str, [LinkIcon](#sphinxawesome_theme.LinkIcon)]*

A dictionary with extra icons to include on the right of the search bar.

The keys are labels for the link’s `title` attribute. The values are themselves [`LinkIcon`](#sphinxawesome_theme.LinkIcon).

#### globaltoc_includehidden *: bool* *= True*

If true, the theme includes entries from *hidden* [toctree](https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-toctree) directives in the sidebar.

The `toctree` directive generates a list of links on the page where you include it, unless you set the `:hidden:` option.

This option is inherited from the `basic` theme.

#### logo_dark *: str | None* *= None*

A path to a logo for the dark mode. If you’re using separate logos for light and dark mode, you **must** provide both logos.

#### logo_light *: str | None* *= None*

A path to a logo for the light mode. If you’re using separate logos for light and dark mode, you **must** provide both logos.

#### main_nav_links *: dict[str, str]*

A dictionary with links to include in the site header.

The keys of this dictionary are the labels for the links. The values are absolute or relative URLs.

#### show_breadcrumbs *: bool* *= True*

If true, the theme includes [breadcrumbs](https://en.wikipedia.org/wiki/Breadcrumb_navigation) links on every page except the root page.

#### show_prev_next *: bool* *= False*

If true, the theme includes links to the previous and next pages in the hierarchy.

#### show_scrolltop *: bool* *= False*

If true, the theme shows a button that scrolls to the top of the page when clicked.

### `LinkIcon` reference

### *class* LinkIcon

A link to an external resource, represented by an icon.

#### icon *: str*

An SVG icon as a string.

#### link *: str*

The absolute URL to an external resource.

<a id="sec-docsearch"></a>

## Algolia DocSearch

To replace the built-in search of Sphinx with DocSearch, use the [sphinx-docsearch](https://github.com/algolia/sphinx-docsearch) extension.
