Image Upload Field
Options
- General
- Label — the human-friendly label shown above the input field in the editor.
- Name — the key stored in your content’s front matter, used to access it in your templates.
- Description — a human friendly description of what the field does and/or instructions for your editors.
- Hidden — hides the field in the editor, but allows developers to set default values or maintain the field for legacy purposes.
- Validation
- Max File Size — prevent files larger than this value from being uploaded. Value is in MB (Megabytes).
- Default — supply a default image.
Templating
If you have a text field in your template, you can access it in your templates using the field’s name
:
Hugo
<img src="{{ .Params.banner | relURL }}">
Use the
relURL
filter to automatically append your site’s baseURL
Jekyll
<img src="{{ page.banner | relative_url }}">
Use the
relative_url
filter to automatically append your site’s baseURL
Config Files
You can configure this field in Front Matter Template Config Files as follows:
type: file
name: [String]
label: [String]
description: [String]
hidden: [true|false]
default: [String]
config:
maxSize: [Number]
Example
type: file
name: banner
label: Banner
description: Provide a banner image for this post
hidden: false
default "/uploads/2017/12/31/placeholder.jpg"
config:
maxSize: 2
April 27, 2020
Caught a mistake or want to contribute to the docs? Edit this page on Github!