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

Reimplement archetypes #9045

Merged
merged 1 commit into from
Oct 16, 2021
Merged

Reimplement archetypes #9045

merged 1 commit into from
Oct 16, 2021

Conversation

bep
Copy link
Member

@bep bep commented Oct 15, 2021

The old implementation had some issues, mostly related to the context (e.g. name, file paths) passed to the template.

This new implementation is using the exact same code path for evaluating the pages as in a regular build.

This also makes it more robust and easier to reason about in a multilingual setup.

Now, if you are explicit about the target path, Hugo will now always pick the correct mount and language:

hugo new content/en/posts/my-first-post.md

Fixes #9032
Fixes #7589
Fixes #9043
Fixes #9046

@bep bep force-pushed the fix/archetype-index branch 5 times, most recently from e726894 to 67344f4 Compare October 16, 2021 10:17
The old implementation had some issues, mostly related to the context (e.g. name, file paths) passed to the template.

This new implementation is using the exact same code path for evaluating the pages as in a regular build.

This also makes it more robust and easier to reason about in a multilingual setup.

Now, if you are explicit about the target path, Hugo will now always pick the correct mount and language:

```bash
hugo new content/en/posts/my-first-post.md
```

Fixes gohugoio#9032
Fixes gohugoio#7589
Fixes gohugoio#9043
Fixes gohugoio#9046
Fixes gohugoio#9047
@bep bep merged commit 9185e11 into gohugoio:master Oct 16, 2021
@jmooring
Copy link
Member

Took it for a spin. Very nice. Thanks.

@bep
Copy link
Member Author

bep commented Oct 16, 2021

@jmooring Yea, I merged it boldly as I need some of the code for some other stuff I'm woring on. Let me know if I ... messed up something. But I suspect it should in most cases be an improvement.

regisphilibert pushed a commit to theNewDynamic/gohugo-theme-ananke that referenced this pull request Dec 2, 2021
With Hugo v0.88.1 and earlier, ContentBaseName and TranslationBaseName
both returned "index" when creating a leaf bundle with hugo new. This is
a known bug, addressed with gohugoio/hugo#9045.

With this PR:

  hugo new post/my-first-post/index.md

will produce:

  title: "My First Post"

instead of:

  title: "Index"
Remicck pushed a commit to Remicck/gohugo-theme-ananke that referenced this pull request Mar 7, 2022
With Hugo v0.88.1 and earlier, ContentBaseName and TranslationBaseName
both returned "index" when creating a leaf bundle with hugo new. This is
a known bug, addressed with gohugoio/hugo#9045.

With this PR:

  hugo new post/my-first-post/index.md

will produce:

  title: "My First Post"

instead of:

  title: "Index"
@github-actions
Copy link

This pull request 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 Oct 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants