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

Navigation Bar Logo and Title - Duplicate Site Name #1025

Closed
gmichaelides opened this issue May 25, 2022 · 5 comments · Fixed by #1190
Closed

Navigation Bar Logo and Title - Duplicate Site Name #1025

gmichaelides opened this issue May 25, 2022 · 5 comments · Fixed by #1190
Assignees
Labels
design/style Front-end site design / styling e0-minutes Effort < 60 min

Comments

@gmichaelides
Copy link

gmichaelides commented May 25, 2022

It seems that if you add a logo that includes a name in addition to a graphic, as per https://www.docsy.dev/docs/adding-content/iconsimages/, you will get the name duplicated in the navigation bar.

So your logo would look like: graphic, example.com, example.com

Although there is an option to hide the logo in the config file, there is no option to hide the text.
navbar_logo = true

Maybe if something like this gets introduced:

 navbar_title = true

Then something like this can be introduced in navbar.html

{{ if .Site.Params.ui.navbar_title }}......... can be used.

For the time-being, I have cloned navbar.html and removed the following section from the end of line 4:
<span class="text-uppercase font-weight-bold">{{ .Site.Title }}</span>

@LisaFC
Copy link
Collaborator

LisaFC commented May 27, 2022

That's a good idea - the title is built into the navbar. Do you want to try a PR with your fix? As long as navbar_title=true is the default it won't break any existing sites (including ours!)

@chalin chalin added the design/style Front-end site design / styling label Aug 18, 2022
@chalin
Copy link
Collaborator

chalin commented Aug 18, 2022

IMHO, the best way to approach this is to hide the name using styling (this is what we've done over on the grpc.io site), using something like this:

.td-navbar .navbar-brand span:last-child {
  display: none;
}

This is a bit brittle (because of the span:last-child), but it works. @LisaFC WDYT? If you agree I can open an issue to associate a class name with the span:last-child element.

@chalin
Copy link
Collaborator

chalin commented Aug 18, 2022

Sorry for being late to notice this issue until you (@gitautas) had already submitted a PR.

@LisaFC
Copy link
Collaborator

LisaFC commented Aug 18, 2022

So is the idea that the user would add this custom styling to their site? We'd need to document it to make sure it's an obvious tweak that users-with-their-project-name-in-their-logo can do, as I can see this problem coming up again.

Agree we probably have too many config params....

@chalin
Copy link
Collaborator

chalin commented Aug 18, 2022

So is the idea that the user would add this custom styling to their site?

Yes, to https://github.com/google/docsy/blob/main/assets/scss/_styles_project.scss

We'd need to document it to make sure it's an obvious tweak that users-with-their-project-name-in-their-logo can do, as I can see this problem coming up again.

Yes. I'll be submitting the code change. Might you be up to documenting this? Or would you prefer that I update the docs too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design/style Front-end site design / styling e0-minutes Effort < 60 min
Projects
None yet
3 participants