Zum Inhalt springen

Configuration

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

The Starlight Recipes 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 starlightRecipes from 'starlight-recipes'
export default defineConfig({
integrations: [
starlight({
plugins: [
starlightRecipes({
// Configuration options go here.
}),
],
title: 'My Recipes',
}),
],
})

The Starlight Recipes plugin accepts the following configuration options:

Type: number
Default: 5

The number of recipes to display per page in the recipe list.

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.

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.

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.

Type: CookingModeConfig

Configuration for the interactive cooking experience.

FieldTypeDefaultDescription
stepTimerbooleantrueEnables countdown timers for instructions. Requires a time field in the instruction step frontmatter.
stepCheckboxbooleantrueToggles interactive checkboxes on step numbers to track progress for instructions.

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.

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.