Skip to content

Instantly share code, notes, and snippets.

@mikemorris
Last active December 17, 2015 05:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikemorris/5557699 to your computer and use it in GitHub Desktop.
Save mikemorris/5557699 to your computer and use it in GitHub Desktop.

Sample _prose.yml metadata configuration

prose:
  metadata:
    _posts:
      - name: "layout"
        field:
          element: "text"
          label: "Layout"
          value: "default"
      - name: "item"
        field:
          element: "select"
          label: "Item"
          placeholder: "Select an Item"
          options:
            - name: "Item 1"
              value: "item1"
            - name: "Item 2"
              value: "item2"
          selected: "item2"

directory

Define default metadata editor fields for a given directory, subdirectories will inherit these default fields.

name

String representing the YAML frontmatter key to be added.

field

Form element for entering or selecting a YAML frontmatter value matching name key.

element
Metadata Editor Element Value HTML
button boolean
checkbox boolean <input type="checkbox" checked="checked" />
text string <input type="text" name="name" value="value" />
select string <select name="name">
<option value="item1">Item 1</option>
<option value="item2">Item 2</option>
</input>
multiselect [string, string] <select name="name" multiple>
<option value="item1">Item 1</option>
<option value="item2">Item 2</option>
</input>
label

<label for="name">label</label>

placeholder

Placeholder text for select dropdowns.

options

<option value="value">name</option> elements for select dropdowns.

- name: "Item 1"
  value: "item1"
- name: "Item 2"
  value: "item2"
selected
  • pre-selected value from options for select dropdowns.
value
  • true/false for button and checkbox form elements
  • default value for text fields

key: value

Key/value pairs will show up as raw YAML in the metadata editor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment