Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Front matter maps and order #7535

Closed
pavelstoev-lci opened this issue Aug 5, 2020 · 2 comments
Closed

Front matter maps and order #7535

pavelstoev-lci opened this issue Aug 5, 2020 · 2 comments

Comments

@pavelstoev-lci
Copy link

What version of Hugo are you using (hugo version)?

$ hugo version
v0.74.3-DA0437B4

Does this issue reproduce with the latest release?

Yes.

Consider the following YAML front matter:

steps:
  bbb:
    - item11
    - item12
    - item13
  AAA:
    - item21
    - item22
    - item23

Issue 1: Using the following Hugo code always prints aaa and bbb lowercase (text casing is lost):

{{- range $ii, $ee := steps -}}
{{ $ii }} {{ $ee }}
{{- range $i, $e := $ee -}}
{{ $i }} {{ $e }}
{{- end -}}
{{- end -}}

Issue 2: It may be by design based on my research - the order is lost and AAA comes first.

Both issues are not obvious based on how one reads the front matter and some (reasonable I think) expectations and difficult to work around - for issue #1 I had to force the use of title case function, and for issue #2 I had to invent a prefix which is then sorted by before being removed from the output.

@stale
Copy link

stale bot commented Dec 19, 2020

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant