Configuration
The Starlight Recipes plugin can be configured inside the astro.config.mjs configuration file of your project:
import starlight from '@astrojs/starlight'import { defineConfig } from 'astro/config'import starlightRecipes from 'starlight-recipes'
export default defineConfig({ integrations: [ starlight({ plugins: [ starlightRecipes({ // Configuration options go here. }), ], title: 'My Recipes', }), ],})Plugin configuration
Section titled “Plugin configuration”The Starlight Recipes plugin accepts the following configuration options:
recipeCount
Section titled “recipeCount”Type: number
Default: 5
The number of recipes to display per page in the recipe list.
popularRecipeCount
Section titled “popularRecipeCount”Type: number
Default: 3
The number of popular recipes to display in the sidebar.
Popularity is determined by sorting by the average rating value. See the rating system for details.
authors
Section titled “authors”Type: StarlightRecipesAuthorsConfig
A list of global authors for all recipes or regular authors that can be referenced in individual recipes. Check the “Authors” guide for more information.
prefix
Section titled “prefix”Type: string
Default: 'recipes'
The base prefix for all recipe routes.
By default, an overview of all recipes will be available at /recipes and individual recipes at e.g. /recipes/virgin-colada.
Setting this option to 'cookbook' will make an overview of all recipes available at /cookbook and individual recipes at e.g. /cookbook/virgin-colada.
cookingMode
Section titled “cookingMode”Type: CookingModeConfig
Configuration for the interactive cooking experience.
CookingModeConfig
Section titled “CookingModeConfig”| Field | Type | Default | Description |
|---|---|---|---|
stepTimer | boolean | true | Enables countdown timers for instructions. Requires a time field in the instruction step frontmatter. |
stepCheckbox | boolean | true | Toggles interactive checkboxes on step numbers to track progress for instructions. |
Author configuration
Section titled “Author configuration”Global authors for all recipes or regular authors that can be referenced in individual recipes can be defined using the authors configuration option.
When a recipe frontmatter does not define an author, the global authors from the configuration will be used instead.
Check the “Authors” guide for more information.
starlightRecipes({ authors: { alice: { // Author configuration for the `alice` author goes here. }, bob: { // Author configuration for the `bob` author goes here. }, },})An author can be configured using the following options:
Required
Type: string
The name of the author.
Type: string
A title to display below the author’s name.
Type: string
A URL to link the author’s name to.
picture
Section titled “picture”Type: string
A URL or path to an image to display as the author’s picture.
- For local images in
src/, provide the relative path to the image, e.g../src/assets/author.png. - For local images in
public/, provide an absolute path starting with a/, e.g./images/author.png. - For remote images, provide the URL to the image. When using remote images, check out the “Authorizing remote images” guide to enable image optimization.