Site Search

Site Search Feature (search)

Settings that control the site’s search feature.

JSON Schema

Definition
{
  "$id": "https://platen.io/schemas/platen/site/features/search/schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Settings that control the site's search feature.\n\nhttps://platen.io/schemas/platen/site/features/search/",
  "properties": {
    "enabled": {
      "default": true,
      "description": "Choose whether site search is turned on.\n\nhttps://platen.io/schemas/platen/site/features/search/#enabled",
      "title": "Enable Site Search",
      "type": "boolean"
    },
    "partials": {
      "description": "Define a map of partials for Platen to inject as needed.\n\nhttps://platen.io/schemas/platen/site/features/search/#partials",
      "properties": {
        "header": {
          "default": "platen/features/search/header",
          "description": "Injects a partial into the HTML header.\n\nhttps://platen.io/schemas/platen/site/features/search/#header",
          "title": "Header Partial",
          "type": "string"
        }
      },
      "title": "Feature Partials",
      "type": "object"
    }
  },
  "title": "Site Search Feature",
  "type": "object"
}

Enable Site Search (enabled)

Choose whether the site search feature is turned on. The default is true.

Feature Partials (partials)

Define a map of partials for Platen to inject as needed. These partials are only injected when enabled is set to true.

JSON Schema

Definition
{
  "description": "Define a map of partials for Platen to inject as needed.\n\nhttps://platen.io/schemas/platen/site/features/search/",
  "properties": {
    "header": {
      "default": "platen/features/search/header",
      "description": "Injects a partial into the HTML header.\n\nhttps://platen.io/schemas/platen/site/features/search/#header",
      "title": "Header Partial",
      "type": "string"
    }
  },
  "title": "Feature Partials",
  "type": "object"
}

Header Partial (header)

If specified, this partial is processed in the HTML header with the current page’s context. The default value is platen/features/search/header. You can overwrite this value, replacing it with another partial entirely, or you can add the same file to your own theme or site, effectively replacing it.

The default partial creates a per-language javascript file for searching the site and executes scripts/features/search/index.js as a templated resource. It adds a link to the search scripts into the HTML header, allowing a user to search the site from the menu.

Edit this page