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

Add archetype per language #5233

Open
bep opened this issue Sep 20, 2018 · 9 comments
Open

Add archetype per language #5233

bep opened this issue Sep 20, 2018 · 9 comments

Comments

@bep
Copy link
Member

bep commented Sep 20, 2018

Working with #4535 I noticed an issue with archetypes with multiple languages with each its own content directory. I will improve that "what site/language does this content belong to" logic, but to make it non-ambiguous, I will also add a (optional) --lang flag:

hugo new --lang=jp post/my-post.md

Doing that, it would also be good if each language could have its own set of archetype templates.

Since #4535 introduces a directory-based approach, we should probably prefix these to make them non-ambigous. My suggestion:

archetypes
├── _languages
│   └── jp
│       └── default.md
├── default.md
└── my-bundle
    ├── featured.png
    └── index.md

/cc @RickCogley @kaushalmodi @regisphilibert @spf13 @anthonyfok and gang.

Note that I plan to wrap this up fairly quickly and include this in a "Revival of The Archetypes #2" release on Monday. There is also the new slice related template funcs that, with Go 1.11, I think we should get out there sooner rather than later. So Monday it is.

@bep bep added this to the v0.49 milestone Sep 20, 2018
@bep bep self-assigned this Sep 20, 2018
@regisphilibert
Copy link
Member

regisphilibert commented Sep 20, 2018

Do we need the lang flag? Can't the language be guessed by filename/location?

Do we need an archetype _language directory? This prefixed directory introduces something rather unusual in Hugo. I wonder if we could do without. Couldn't we use the same file system as content files?

archetypes
├── default.md
└── default.jp.md
└── my-bundle
    ├── featured.png
    ├── index.md
    └── index.jp.md

@bep
Copy link
Member Author

bep commented Sep 20, 2018

@regisphilibert I think you need to look at #4535 and #5233 and #5234 in full.

Do we need the lang flag? Can't the language be guessed by filename/location?

How would your examples look with a content directory per language? (which I think is a more common setup for sites that really need something like this).

@bep
Copy link
Member Author

bep commented Sep 20, 2018

OK, thinking a little about this, this isn't as obvious as I first thought. I think I will get #4535 working properly and see if I get some clarity from that.

@bep bep modified the milestones: v0.49, v0.50 Sep 24, 2018
@bep bep modified the milestones: v0.50, v0.51 Oct 6, 2018
@bep bep modified the milestones: v0.51, v0.53 Nov 8, 2018
@bep bep modified the milestones: v0.53, v0.54 Dec 6, 2018
@bep bep modified the milestones: v0.54, v0.55 Dec 26, 2018
@bep bep modified the milestones: v0.55, v0.56 Feb 1, 2019
@stale
Copy link

stale bot commented Jun 1, 2019

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.

@stale stale bot added the Stale label Jun 1, 2019
@bep bep added the Keep label Jun 1, 2019
@stale stale bot removed the Stale label Jun 1, 2019
@bep bep modified the milestones: v0.56, v0.57 Jun 14, 2019
@bep bep modified the milestones: v0.57, v0.58 Jul 31, 2019
@bep bep modified the milestones: v0.58, v0.59 Aug 13, 2019
@bep bep removed this from the v0.59 milestone Sep 6, 2019
@bep bep modified the milestones: v0.116.0, v0.117.0 Aug 1, 2023
@bep bep modified the milestones: v0.117.0, v0.118.0 Aug 30, 2023
@bep bep modified the milestones: v0.118.0, v0.119.0 Sep 15, 2023
@bep bep modified the milestones: v0.119.0, v0.120.0 Oct 4, 2023
@bep bep modified the milestones: v0.120.0, v0.121.0 Oct 31, 2023
@bep bep modified the milestones: v0.121.0, v0.122.0 Dec 6, 2023
@bep bep modified the milestones: v0.122.0, v0.123.0, v0.124.0 Jan 27, 2024
@bep bep modified the milestones: v0.124.0, v0.125.0 Mar 4, 2024
@bep bep modified the milestones: v0.125.0, v0.126.0 Apr 23, 2024
@bep bep modified the milestones: v0.126.0, v0.127.0 May 15, 2024
@bep bep modified the milestones: v0.127.0, v0.128.0 Jun 8, 2024
@bep bep modified the milestones: v0.128.0, v0.129.0 Jun 21, 2024
@bep bep modified the milestones: v0.129.0, v0.131.0 Jul 22, 2024
@bep bep modified the milestones: v0.131.0, v0.133.0 Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants