docsy icon indicating copy to clipboard operation
docsy copied to clipboard

Navigation Bar Logo and Title - Duplicate Site Name

Open gmichaelides opened this issue 3 years ago • 5 comments

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>

gmichaelides avatar May 25 '22 18:05 gmichaelides

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!)

LisaFC avatar May 27 '22 10:05 LisaFC

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 avatar Aug 18 '22 15:08 chalin

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

chalin avatar Aug 18 '22 15:08 chalin

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....

LisaFC avatar Aug 18 '22 16:08 LisaFC

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?

chalin avatar Aug 18 '22 19:08 chalin