Skip to content

Conversation

@stormmaster42
Copy link

With this change, it is possible to use linkTitle in the front matter to define shorter titles shown in the page menu.

Example:

title: "My super extra very long title"
linkTitle "Long Title ..."

linkTitle defaults to title if it is not set.

@TheGroundZero
Copy link

Wouldn't it be better to do the following for backwards compatibility?

{{ with .LinkTitle }}{{ . }}{{ else }}{{ .Title }}{{ end }}

@stormmaster42
Copy link
Author

Wouldn't it be better to do the following for backwards compatibility?

{{ with .LinkTitle }}{{ . }}{{ else }}{{ .Title }}{{ end }}

I don't think that's necessary, as LinkTitle falls back to Title if not set already.
Reference: https://gohugo.io/methods/page/linktitle/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants