1
0
Fork 0
mirror of https://github.com/gohugoio/hugo.git synced 2025-03-07 02:34:48 +00:00
Commit graph

12 commits

Author SHA1 Message Date
Bjørn Erik Pedersen
32508045d3
navigation: Check Page first in URL()
In Hugo  we added `pageRef`, a way to connect menu items in site config to pages.

This means that you now can have both a Page and a configured URL.

Having the configured URL as a fallback if the Page isn't found is obviously more useful, especially in multilingual sites.

See 
2021-07-21 11:36:15 +02:00
Bjørn Erik Pedersen
d831d2fce8 Simplify "active menu" logic for section menus
Fixes 
2021-07-20 17:50:59 +02:00
Bjørn Erik Pedersen
634481ba8c Fix Params case handling for menu items defined in site config
Fixes 
2021-07-20 17:50:59 +02:00
satotake
785a31b5b8
navigation: Cache and copy Menu for sorting
.Site.Menus is mutated when it is sorted for now and this causes concurrency problem ()
In this patch, each related sort function copies Menu before sorting to prevent
race condition.

Pages already have such a sort and cache logic and this patch is identical to it.

Closes 
2021-05-23 10:42:01 +02:00
Bjørn Erik Pedersen
d90e37e0c6 all: Format code with gofumpt
See https://github.com/mvdan/gofumpt
2020-12-03 13:12:58 +01:00
David Jones
8f5c9a747f
Add menu params
Fixes 
2020-11-22 22:09:59 +01:00
Bjørn Erik Pedersen
a3fe5e5e35
Fix Params case handling in the index, sort and where func
This means that you can now do:

```
{{ range where .Site.Pages "Params.MYPARAM" "foo" }}
```
2019-11-22 18:41:50 +01:00
Bjørn Erik Pedersen
53077b0da5
Merge pull request from bep/sort-caseinsensitive
Implement lexicographically string sorting
2019-08-01 10:19:19 +02:00
Kaushal Modi
90b0127f63 Fix typo s/Meny/Menu/ 2019-07-09 17:28:53 +02:00
Bjørn Erik Pedersen
ea529c847e Fix menu URL when multiple permalinkable output formats
In Hugo `0.55` we introduced the `permalinkable` config attribute on Output Format, default enabled for `AMP` and `HTML`.

This meant that a Page could have different `RelPermalink` and `Permalink` depending on the rendering format.

The menu `URL` did not reflect that fact.

Fixes 
2019-04-19 10:29:52 +02:00
Bjørn Erik Pedersen
9e9a1f92ba
hugolib: Fix simple menu config
This stopped working in Hugo 0.55:

```bash
---
menu: "main"
---
```

This was also the case for using a slice of menu entries.

This still worked:

---
menu:
  main:
    weight: 30
---
2019-04-12 10:04:17 +02:00
Bjørn Erik Pedersen
597e418cb0
Make Page an interface
The main motivation of this commit is to add a `page.Page` interface to replace the very file-oriented `hugolib.Page` struct.
This is all a preparation step for issue  , "pages from other data sources".

But this also fixes a set of annoying limitations, especially related to custom output formats, and shortcodes.

Most notable changes:

* The inner content of shortcodes using the `{{%` as the outer-most delimiter will now be sent to the content renderer, e.g. Blackfriday.
  This means that any markdown will partake in the global ToC and footnote context etc.
* The Custom Output formats are now "fully virtualized". This removes many of the current limitations.
* The taxonomy list type now has a reference to the `Page` object.
  This improves the taxonomy template `.Title` situation and make common template constructs much simpler.

See 
Fixes 
Fixes 
Fixes 
Fixes 
Fixes 
Fixes 
Fixes 
Fixes 
Fixes 
Fixes 
Fixes 
Fixes 
Fixes 
Fixes 
Fixes 
Fixes 
Fixes 
Fixes 
Fixes 
2019-03-23 18:51:22 +01:00