# pages-theme-esa

Vitepress theme for ESA branded pages.

## Usage

```
npm install -D @eox/pages-theme-esa
npm install @eox/esa-ui

// .vitepress/theme/index.js
import ESA from "@eox/pages-theme-esa"

export default {
  extends: ESA
};
```

See also the [Vitepress Docs](https://vitepress.dev/guide/custom-theme#consuming-a-custom-theme).

### Feedback Form

**Feedback Form** for collecting user feedback can be enabled by configuring the theme:

```javascript
// themeConfig
{
  feedback: {
    endpoint: "https://example.com/create-issue?repo=github.com/org/repo" // or repo can be passed in request body by being included in schema such as a hidden field with default value
    schema: {
  "type": "object",
  "title": "Feedback contains URL of current page automatically. Let us know your feedback or issue type.",
  "options": {
    "remove_empty_properties": true,
    "remove_additional_properties": true
  },
  "oneOf": [
    {
      "title": "Feature Request",
      "properties": {
        "type_feature": {
          "type": "string",
          "default": "feature",
          "options": {
            "hidden": true
          }
        },
        "title": {
          "type": "string",
          "title": "Title"
        },
        "Expected behavior": {
          "type": "string",
          "format": "textarea",
          "minLength": 1,
          "options": {
            "inputAttributes": {
              "placeholder": "Describe the new functionality and how it would help you."
            }
          }
        },
        "Contact information or additional comments (optional)": {
          "type": "string"
        }
      },
      "required": [
        "type_feature"
      ],
      "additionalProperties": false
    },
    {
      "title": "Issue or Question",
      "properties": {
        "type_catalog": {
          "type": "string",
          "default": "catalog",
          "options": {
            "hidden": true
          }
        },
        "title": {
          "type": "string",
          "title": "Title"
        },
        "Steps to reproduce": {
          "type": "string",
          "format": "textarea",
          "minLength": 1,
          "options": {
            "inputAttributes": {
              "placeholder": "Describe what you tried to do."
            }
          }
        },
        "Expected content": {
          "type": "string",
          "format": "textarea",
          "minLength": 1,
          "options": {
            "inputAttributes": {
              "placeholder": "What would you like to see?"
            }
          }
        }
      },
      "required": [
        "type_catalog"
      ],
      "additionalProperties": false
    },
  ]
}, // optional - feedback has a default single text field
    position: "bottom-right", // can be any of bottom-left, top-left, bottom-right, top-right
  }
}
```

feedback form can be disabled on individual pages via frontmatter configuration

```yaml
---
feedback: false
---
```
