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

Docs: remove unnecessary title test from single layout page #35622

Conversation

julien-deramond
Copy link
Member

@julien-deramond julien-deramond commented Dec 30, 2021

Description

layout: single seems to be used only for examples page so {{ if eq .Title "Examples" }} becomes unnecessary IMO.

Motivation & Context

This change would remove unused code and simplify this page.

Types of changes

  • Refactoring (non-breaking change)

Checklist

  • I have read the contributing guidelines
  • My code follows the code style of the project (using npm run lint)
  • My change introduces changes to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

Related issues

No related issues.

Live preview

@julien-deramond julien-deramond changed the title docs: remove unnecessary title test from single layout page Docs: remove unnecessary title test from single layout page Jan 4, 2022
@XhmikosR
Copy link
Member

XhmikosR commented Jan 29, 2022

This is a leftover from the Hugo switch. I remember I had some issues with the examples, but I don't remember more details.

Perhaps it was used in other pages too, which is good to have. But Hugo's template inheritance is still something I haven't been able to clean up for our docs, including our content organization, see #28479.

So, while it may be unused, it might be worth leaving it and try to fix our template hierarchy/content files organization?

EDIT: https://github.com/twbs/bootstrap/blob/v4-dev/site/content/docs/versions.md

@julien-deramond
Copy link
Member Author

I jumped back into the history of this file until d95d300 (Hugo switch) where layout: single was used only once (and it's still the case today).

But I agree that if {{ if eq .Title "Examples" }} is removed, we aren't sure that it won't be necessary to put it back in the future; actually in Boosted I kept it because we have another page using almost this same layout and we're doing the following:

{{ if eq .Title "Examples" }}
  <!-- Some HTML -->
{{ else if eq .Title "Orange Design System for web" }}
  <!-- Some HTML -->
{{ end }}

But Hugo's template inheritance is still something I haven't been able to clean up for our docs, including our content organization, see #28479.
So, while it may be unused, it might be worth leaving it and try to fix our template hierarchy/content files organization?

I wasn't aware of this issue and I agree that a real fix would rather be to use some kind of template inheritance.
I don't mind keeping this file as it is and closing this PR to concentrate our efforts on the real issue :)

(I'll try to look at this issue after having finished the other topics still in progress on my side on Bootstrap)

@mdo
Copy link
Member

mdo commented Apr 13, 2022

Do we still want to proceed on this or go with the template cleanup? :D

@julien-deramond
Copy link
Member Author

So, while it may be unused, it might be worth leaving it and try to fix our template hierarchy/content files organization?

Let's try to fix the template hierarchy/content files organization in another PR. I close this one.

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

Successfully merging this pull request may close these issues.

3 participants