Open navClose nav

Number Field

Text input that only accepts numeric values.


  • 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.
  • 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.
  • Required – prevent changes from being saved if this field is empty.

Field UI,dpr_auto,f_auto,q_80,w_640/


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]
  min: [Number]
  max: [Number]
  step: [Number]


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

Last updated on December 31, 2017