mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-16 13:25:03 -04:00
Modified front matter metadata exemple. Added yaml version.
This commit is contained in:
parent
da5e4f4760
commit
253092335b
@ -61,32 +61,72 @@ GetMatch
|
|||||||
|
|
||||||
Resources metadata management is possible from the Front Matter's array `resources`. Batch assign is made possible using glob pattern matching.
|
Resources metadata management is possible from the Front Matter's array `resources`. Batch assign is made possible using glob pattern matching.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
~~~yaml
|
~~~yaml
|
||||||
title: "Sunflare 101"
|
title: Application
|
||||||
date: 2018-01-09T13:03:53-05:00
|
date : 2018-01-25
|
||||||
resources:
|
resources :
|
||||||
- src: "*/sunset.jpg"
|
- src : "images/header.*"
|
||||||
title: "Beautiful Sunset"
|
name : "header"
|
||||||
- src: "*/sunrise.jpg"
|
- src : "documents/photo_specs.pdf"
|
||||||
title: "Beautiful Sunrise"
|
title : "Photo Specifications"
|
||||||
name: "sunrise-1"
|
params:
|
||||||
- src: "*/*.jpg"
|
icon : "image"
|
||||||
params:
|
- src : "documents/*.pdf"
|
||||||
credits: Hugo Doe
|
params :
|
||||||
license:CC BY
|
icon : "pdf"
|
||||||
- src: "*/japan-sunset.jpg"
|
- src : "documents/*.docx"
|
||||||
params:
|
params :
|
||||||
credits: 森山大道
|
icon : "word"
|
||||||
|
- src : "documents/guide.pdf"
|
||||||
|
title : "Instruction Guide"
|
||||||
|
- src : "documents/checklist.pdf"
|
||||||
|
title : "Document Checklist"
|
||||||
|
- src : "documents/payment.docx"
|
||||||
|
title : "Proof of Payment"
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
|
~~~toml
|
||||||
|
title = Application
|
||||||
|
date : 2018-01-25
|
||||||
|
[[resources]]
|
||||||
|
src = "images/header.*"
|
||||||
|
name = "header"
|
||||||
|
[[resources]]
|
||||||
|
src = "documents/photo_specs.pdf"
|
||||||
|
title = "Photo Specifications"
|
||||||
|
[resources.params]
|
||||||
|
icon = "photo"
|
||||||
|
[[resources]]
|
||||||
|
src = "documents/*.pdf"
|
||||||
|
[resources.params]
|
||||||
|
icon = "pdf"
|
||||||
|
[[resources]]
|
||||||
|
src = "documents/*.docx"
|
||||||
|
[resources.params]
|
||||||
|
icon = "word"
|
||||||
|
[[resources]]
|
||||||
|
src = "documents/guide.pdf"
|
||||||
|
title = "Instruction Guide"
|
||||||
|
[[resources]]
|
||||||
|
src = "documents/checklist.pdf"
|
||||||
|
title = "Document Checklist"
|
||||||
|
[[resources]]
|
||||||
|
src = "documents/payment.docx"
|
||||||
|
title = "Proof of Payment"
|
||||||
|
~~~
|
||||||
|
|
||||||
In the example above:
|
In the example above:
|
||||||
|
In the above `TOML` example, `photo_specs.pdf` will get the `photo` icon, the other pdf files will get the default `pdf` icon.
|
||||||
|
|
||||||
- `sunset.jpg` will receive a distinct `Title`
|
- `header.jpg"` will receive a new `Name` and won't be retrieved by `.Match "*/header.jpg"` anymore but something like `.Match "header"`.
|
||||||
- `sunrise.jpg` will receive a distinct `Title` and `Name` and won't be retrieved by `.Match "*/sunrise.jpg"` anymore but something like `.Match "sunrise-*"`.
|
- Every pdf in the bundle will receive the same `pdf` icon
|
||||||
- Every jpg in the bundle will receive the same `credits` and `license` parameter.
|
- Except for `photo_specs.pdf` which will get the `image` icon
|
||||||
- `japan-sunset.jpg` will receive a distinct `credits`
|
|
||||||
|
|
||||||
The __order matters__, each rule overwriting the params assigned by the previous one on their shared target. The specific rule for `*/japan-sunset.jpg` has to be declared after the more generic `*/*.jpg`.
|
The __order matters__, the specific rule for `*/photo_specs.jpg` has to be declared before the more generic `documents/*.pdf`.
|
||||||
|
|
||||||
|
The __order matters__,.
|
||||||
|
|
||||||
## Available metadata
|
## Available metadata
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user