Skip to content

Configuration

The Starlight Giscus plugin can be configured inside the astro.config.mjs configuration file of your project:

astro.config.mjs
import starlight from '@astrojs/starlight'
import { defineConfig } from 'astro/config'
import starlightGiscus from 'starlight-giscus'
export default defineConfig({
integrations: [
starlight({
plugins: [
starlightGiscus({
// Configuration options
}),
],
title: 'My Docs',
}),
],
})

Just create a Giscus App, and then copy the relevant settings from there.

Options

The Starlight Giscus plugin accepts the following configuration options:

repo (required)

Type: string

A public GitHub repository. This repo is where the discussions will be linked to.

repoId (required)

Type: string

Set the repository ID. Copy it from the Giscus app settings.

category (required)

Type: string

Choose the discussion category where new discussions will be created.

categoryId (required)

Type: string

Set the discussion category ID. Copy it from the Giscus app settings.

mapping

Type: string

Default: pathname

Choose the mapping between the embedding page and the embedded discussion.

  • pathname - giscus will search for a discussion whose title contains the page’s pathname URL component.

  • URL - giscus will search for a discussion whose title contains the page’s URL.

  • <title> - giscus will search for a discussion whose title contains the page’s <title> HTML tag.

  • og:title - giscus will search for a discussion whose title contains the page’s <meta property="og:title"> HTML tag.

reactions

Type: boolean

Default: true

Show reactions block above the reply form.

inputPosition

Type: string (top | bottom)

Default: bottom

Place the reply form above or below the comments.

theme

Type: string | { light: string; dark: string; auto: string }

Default: preferred_color_scheme | { light: 'light', dark: 'dark', auto: 'preferred_color_scheme' }

Choose a theme that matches your website.

Possible values:

ValueName
preferred_color_schemeSystem (default)
lightGitHub Light
light_high_contrastGitHub Light High Contrast
light_protanopiaGitHub Light Protanopia & Deuteranopia
light_tritanopiaGitHub Light Tritanopia
darkGitHub Dark
dark_high_contrastGitHub Dark High Contrast
dark_protanopiaGitHub Dark Protanopia & Deuteranopia
dark_tritanopiaGitHub Dark Tritanopia
dark_dimmedGitHub Dark Dimmed
transparent_darkTransparent Dark
noborder_lightNoBorder Light
noborder_darkNoBorder Dark
noborder_grayNoBorder Gray
cobaltRStudio Cobalt
purple_darkPurple Dark
gruvboxGruvbox
gruvbox_darkGruvbox Dark
gruvbox_lightGruvbox Light
catppuccin_latteCatppuccin Latte
catppuccin_frappeCatppuccin Frappé
catppuccin_macchiatoCatppuccin Macchiato
catppuccin_mochaCatppuccin Mocha
froFro
https://giscus.app/themes/custom_example.cssCustom Theme CSS Url

lazy

Type: boolean

Default: false

Loading of the comments will be deferred until the user scrolls near the comments container.