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

Frontmatter camelcase entry #2

Open
stebrech opened this issue Apr 1, 2023 · 2 comments
Open

Frontmatter camelcase entry #2

stebrech opened this issue Apr 1, 2023 · 2 comments

Comments

@stebrech
Copy link
Contributor

stebrech commented Apr 1, 2023

I use eleventyNavigation on some pages which has indented key and order. Kirby overwrites the camelcase written eleventyNavigation and adds a pipe.

Before saving:

eleventyNavigation: 
  key: some key
  order: 3

After saving the page in Kirby:

eleventynavigation: |
  key: some key
  order: 3

Although I currently have this added manually to the markdown files and not integrated into the Kirby Config, CamelCase written objects do not seem to be accepted. I wouldn't know how to manage this indentation either.

@stebrech
Copy link
Contributor Author

stebrech commented Apr 1, 2023

With the structure field type it can be configured in Kirby, but still the issue with camelcase and the pipe. Additionally it adds a hyphen:

    fields:
      eleventyNavigation:
        label: Link in Hauptmenü
        type: structure
        fields:
          key:
            label: Linktext
            type: text
          order:
            label: Nr. Reihenfolge
            type: number

Result:

eleventynavigation: |
  -
  key: some key
  order: 9

@lukasbestle
Copy link
Member

The frontmatter fields are mapped to Kirby fields internally. Kirby treats field names as case-insensitive, which is why the name gets changed to lowercase. Kirby fields are also always strings, so the nested YAML structure gets parsed as a string and converted back to an indented YAML string instead of the actual dictionary structure that was there before.

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

No branches or pull requests

2 participants