Skip to content

Issue: A single multilingual pageFolder is now getting replaced by one per language in frontmatter.json. #769

@tohagan

Description

@tohagan

Describe the bug

In frontmatter.json, it looks like the original simple model for i18n and pageFolder is getting transformed internally and then (perhaps unintentionally?) getting persisted to back to frontmatter.json.

IMHO, this complicates and duplicates information in the frontmatter.json model. Is that what you intended??
Perhaps you need to maintain a computed pageFolder model that maintains the original model as isomorphic in this aspect.

Example

frontmatter.json

...
  "frontMatter.content.i18n": [
    {
      "title": "English",
      "locale": "en",
      "path": "en"
    },
    {
      "title": "Hindi",
      "locale": "hi",
      "path": "hi"
    },
    {
      "title": "Bengali",
      "locale": "bn",
      "path": "bn"
    }
],
...
"frontMatter.content.pageFolders": [
    {
      "title": "posts",
      "path": "[[workspace]]/src/content/posts",
      "filePrefix": "",
      "defaultLocale": "en",
      "contentTypes": [
        "post"
      ]
    },
    {
      "title": "site",
      "path": "[[workspace]]/src/content/site",
      "filePrefix": "",
      "defaultLocale": "en",
      "contentTypes": [
        "site"
      ]
    }

  ],

... is getting converted into this that's saved in the ...

  "frontMatter.content.pageFolders": [
    {
      "title": "posts",
      "path": "[[workspace]]/src/content/posts/en",
      "filePrefix": "",
      "defaultLocale": "en",
      "contentTypes": [
        "post"
      ],
      "locale": "en",
      "localeTitle": "English",
      "localeSourcePath": "c:/Users/tony/Projects/JOI-Software/SGY_SITE/site/src/content/posts"
    },
    {
      "title": "posts",
      "path": "[[workspace]]/src/content/posts/hi",
      "filePrefix": "",
      "defaultLocale": "en",
      "contentTypes": [
        "post"
      ],
      "locale": "hi",
      "localeTitle": "Hindi",
      "localeSourcePath": "c:/Users/tony/Projects/JOI-Software/SGY_SITE/site/src/content/posts"
    },
    {
      "title": "posts",
      "path": "[[workspace]]/src/content/posts/bn",
      "filePrefix": "",
      "defaultLocale": "en",
      "contentTypes": [
        "post"
      ],
      "locale": "bn",
      "localeTitle": "Bengali",
      "localeSourcePath": "c:/Users/tony/Projects/JOI-Software/SGY_SITE/site/src/content/posts"
    },
    {
      "title": "site",
      "path": "[[workspace]]/src/content/site/en",
      "filePrefix": "",
      "defaultLocale": "en",
      "contentTypes": [
        "site"
      ],
      "locale": "en",
      "localeTitle": "English",
      "localeSourcePath": "c:/Users/tony/Projects/JOI-Software/SGY_SITE/site/src/content/site"
    },
    {
      "title": "site",
      "path": "[[workspace]]/src/content/site/hi",
      "filePrefix": "",
      "defaultLocale": "en",
      "contentTypes": [
        "site"
      ],
      "locale": "hi",
      "localeTitle": "Hindi",
      "localeSourcePath": "c:/Users/tony/Projects/JOI-Software/SGY_SITE/site/src/content/site"
    },
    {
      "title": "site",
      "path": "[[workspace]]/src/content/site/bn",
      "filePrefix": "",
      "defaultLocale": "en",
      "contentTypes": [
        "site"
      ],
      "locale": "bn",
      "localeTitle": "Bengali",
      "localeSourcePath": "c:/Users/tony/Projects/JOI-Software/SGY_SITE/site/src/content/site"
    },
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions