mirror of
https://github.com/gohugoio/hugo.git
synced 2025-05-12 05:36:55 +03:00
Merge commit 'efa74c5c6e
'
This commit is contained in:
commit
0a9172672a
74 changed files with 112 additions and 156 deletions
|
@ -38,8 +38,6 @@ The function takes multiple indices as arguments, and this can be used to get ne
|
|||
{{ index $map "c" "e" }} => 20
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Example: Load Data from a Path Based on Front Matter Params
|
||||
|
||||
Assume you want to add a `location = ""` field to your front matter for every article written in `content/vacations/`. You want to use this field to populate information about the location at the bottom of the article in your `single.html` template. You also have a directory in `data/locations/` that looks like the following:
|
||||
|
@ -93,4 +91,3 @@ Now the call will return the specific file according to the location specified i
|
|||
{{ (index .Site.Data.locations .Params.location).pop_city }}
|
||||
=> 658390
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue