Open navClose nav

Number Field,dpr_auto,f_auto,q_80,w_640/

Text input that only accepts numeric values.


  • 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
    • Required — prevent changes from being saved if this field is empty.
    • Minimum — the lowest number that may be entered in the field.
    • Maximum — the highest number that may be entered in the field.
    • Step — limits the field to only allow certain increments to be entered into the field.
  • Default — supply a default number.


You can access this field in your templates using the field’s name:


<p>The page's weight is: {{ .Params.weight }}</p>


<p>The page's weight is: {{ page.weight }}</p>

Use number fields to sort pages in a loop:


{{ range sort .Data.Pages ".Params.weight" "desc" }}
  <h2>{{ .Title }}</h2>
  <p>{{ .Description }}</p>
{{ end }}


{% for post in site.posts | sort:"weight" %}
  <h2>{{ page.title }}</h2>
  <p>{{ page.description }}</p>
{% endif %}

Config Files

You can configure this field in Front Matter Template Config Files as follows:

type: number
name: [String]
label: [String]
description: [String]
hidden: [true|false]
default: [Number]
  required: [true|false]
  min: [Number]
  max: [Number]
  step: [Number]


- name: weight
  type: number
  label: Weight
  description: Set the page's sort order
  default: -99
    required: true
    min: 0
    max: 99
    step: 1

Last updated on June 11, 2020