Weight
Returns the weight of the given page as defined in front matter.
- Syntax
- PAGE.Weight
- Returns
- int
The Weight method on a Page object returns the weight of the given page as defined in front matter.
---
title: How to make spicy tuna hand rolls
weight: 42
---+++
title = 'How to make spicy tuna hand rolls'
weight = 42
+++{
"title": "How to make spicy tuna hand rolls",
"weight": 42
}
Page weight controls the position of a page within a collection that is sorted by weight. Assign weights using non-zero integers. Lighter items float to the top, while heavier items sink to the bottom. Unweighted or zero-weighted elements are placed at the end of the collection.
Although rarely used within a template, you can access the value with:
{{ .Weight }} → 42Last updated:
November 8, 2026
:
content: Remove categories from front matter (1cc1dd83a)
Improve this page