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

Unify baseof vs single/section lookup order #3154

Closed
rdwatters opened this issue Mar 9, 2017 · 6 comments
Closed

Unify baseof vs single/section lookup order #3154

rdwatters opened this issue Mar 9, 2017 · 6 comments
Labels

Comments

@rdwatters
Copy link
Contributor

rdwatters commented Mar 9, 2017

See #3116

Current docs show the following forbaseof.html templates using a posts section as an example:

  1. /layouts/section/post-baseof.html
  2. /themes/<THEME>/layouts/section/post-baseof.html
  3. /layouts/section/baseof.html
  4. /themes/<THEME>/layouts/section/baseof.html
  5. /layouts/_default/post-baseof.html
  6. /themes/<THEME>/layouts/_default/post-baseof.html
  7. /layouts/_default/baseof.html
  8. /themes/<THEME>/layouts/_default/baseof.html

<TYPE>-baseof deviates from other lookups:

  1. Templates do not prepend values (e.g. post-baseof.html)
  2. Section-specific templates are not kept in _default/.

Proposed change (using the above post example):

  1. /layouts/post/baseof.html
  2. /themes/<THEME>/layouts/post/baseof.html
  3. /layouts/section/baseof.html
  4. /themes/<THEME>/layouts/section/baseof.html
  5. /layouts/_default/baseof.html
  6. /themes/<THEME>/layouts/_default/baseof.html

Unlike #3116, however, this is a more drastic change than adding an item to the lookup, so I hesitate in the light of breaking changes, obviously.

Further consideration include the other list templates (e.g., taxonomies), which according to documentation only inherit from the _default/baseof.html layout?

@bep
Copy link
Member

bep commented Mar 9, 2017

The current docs probably not up to date re. the latest changes to the section:

f4779b2

So, given your example above it would be:

/layouts/section/post-baseof.html
/themes/exampletheme/layouts/section/post-baseof.html
/layouts/post/baseof.html
/themes/exampletheme/layouts/post/baseof.html
/layouts/section/baseof.html
/themes/exampletheme/layouts/section/baseof.html
/layouts/_default/post-baseof.html
/themes/exampletheme/layouts/_default/post-baseof.html
/layouts/_default/baseof.html
/themes/exampletheme/layouts/_default/baseof.html

Now, there is an open issue from a user claiming the above doesn't work perfectly for themes, but that is another story.

And I don't understand the "TYPE-baseof is counterintuitive since this is the only template that takes this approach to the lookup".

The TYPE.html is pretty much Hugo standard, and since a base template must live in a pair relationship with another template, some kind of naming scheme had to be invented. And we already "voted on this" on the forum.

So, unless you come up with some much better reasons, we're not making breaking changes like this that will, to quote the American president, "CREATE TREMENDOUS AMOUNT OF WORK!!". :-)

@bep
Copy link
Member

bep commented Mar 9, 2017

That said; even if we HAVE lots of options, we don't have to document every variant (we have some other legacy variants floating around in the code).

This will be even more obvious when output types come into the mix ...

@rdwatters
Copy link
Contributor Author

we're not making breaking changes...even if we HAVE lots of options, we don't have to document every variant

Agreed. I will do my best to make this clearer in the docs. I wonder how many sites are implementing multiple baseof* since this was only introduced a few versions back.

And just to clarify, your example above is the most up-to-date, correct?

/layouts/section/post-baseof.html
/themes/exampletheme/layouts/section/post-baseof.html
/layouts/post/baseof.html
/themes/exampletheme/layouts/post/baseof.html
/layouts/section/baseof.html
/themes/exampletheme/layouts/section/baseof.html
/layouts/_default/post-baseof.html
/themes/exampletheme/layouts/_default/post-baseof.html
/layouts/_default/baseof.html
/themes/exampletheme/layouts/_default/baseof.html

...to quote the American president, "CREATE TREMENDOUS AMOUNT OF WORK!!". :-)

A visual representation of my thoughts:

statemap512

@bep
Copy link
Member

bep commented Mar 9, 2017

And just to clarify, your example above is the most up-to-date, correct?

Yes, but it is not in the real doc.

@rdwatters
Copy link
Contributor Author

Yes, but it is not in the real doc.

@bep Let me know how I can help facilitate this in the new docs. Closing. Cheers.

@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 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants