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

Support disabling of navbar translucency over cover blocks #702

Merged
merged 1 commit into from
Sep 22, 2021

Conversation

chalin
Copy link
Collaborator

@chalin chalin commented Sep 22, 2021

Docsy has special formatting and code in support of translucent navbars when over a block/cover. This sometimes causes problems, e.g., see grpc/grpc.io#866.

This PR introduces the navbar_translucent_over_cover_disable configuration option, allowing site devs to disable this special behavior.

@@ -24,7 +24,7 @@
}
</style>
{{ end }}
<section id="{{ $blockID }}" class="row td-cover-block td-cover-block--height-{{ $height }} js-td-cover td-overlay td-overlay--dark -bg-{{ $col_id }}">
<section id="{{ $blockID }}" class="row td-cover-block td-cover-block--height-{{ $height }}{{ if not .Site.Params.ui.navbar_translucent_over_cover_disable }} js-td-cover{{ end }} td-overlay td-overlay--dark -bg-{{ $col_id }}">
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While not strictly necessary, this change prevents the navbar-style-fiddling JS code from being triggered when translucency is disabled:

docsy/assets/js/base.js

Lines 35 to 40 in db8f7a7

// Bootstrap Fixed Header
$(function() {
var promo = $(".js-td-cover");
if (!promo.length) {
return
}

@LisaFC
Copy link
Collaborator

LisaFC commented Sep 22, 2021

Ah this is great! I can see the problem on the grpc site. Is there a good place to document this parameter so other users can find it?

(I worked on the earliest iteration of the grpc website, back before Docsy existed. :) )

@chalin
Copy link
Collaborator Author

chalin commented Sep 22, 2021

Is there a good place to document this parameter so other users can find it?

There are a few options, but I was hoping that we could get this merged first. I promise to: (1) add the config option to the example site config file, (2) submit a followup PR with some added documentation -- possible under the https://www.docsy.dev/docs/adding-content/lookandfeel/ section.

WDYT?

I worked on the earliest iteration of the grpc website, back before Docsy existed. :)

Oh cool! Right, come to think of it, I do remember seeing your name in some commits from way back! 😄

@LisaFC
Copy link
Collaborator

LisaFC commented Sep 22, 2021

Works for me! I'll merge this now.

@LisaFC LisaFC merged commit 170cdd9 into google:master Sep 22, 2021
@chalin chalin deleted the chalin-navbar-cover-config-2021-09-22 branch September 22, 2021 16:46
@chalin
Copy link
Collaborator Author

chalin commented Sep 22, 2021

(1) add the config option to the example site config file,

Done, but for some reason the build(s) are failing. I tried to "fix" them, but I believe that the cache might need to be reset. Here's the main PR I submitted: google/docsy-example#130

@LisaFC
Copy link
Collaborator

LisaFC commented Sep 22, 2021

Yeah, Netlify preview builds sometimes go weird like that, I'll manually clear the cache and rerun it.

@LisaFC
Copy link
Collaborator

LisaFC commented Sep 23, 2021

So even more weirdly (and I may have to seek Netlify help on this), there are TWO sets of preview deploys coming from the docsy-example repo, one of which always fails. I have no idea where the other one came from, unless it's an artefact of a site name/Netlify settings change.

Behold (if you can see these):
Success! https://app.netlify.com/sites/goldydocs/deploys/614c7fd8cd0a68ebf63be5b1
Fail! https://app.netlify.com/sites/docsy-example/deploys/614b64ce1c53810009bd07b0

Your PRs are absolutely fine and the previews are building with no issues.

@chalin
Copy link
Collaborator Author

chalin commented Sep 23, 2021

It seems like you have your own "LisaFC's team/goldydocs" Netlify account in addition to the "Docsy/docsy-example" account. I suspect that the config settings of the latter are out-of-date. That's why I usually like to put as many of the Netlify config settings as possible in the project's netlify.toml file.

@LisaFC
Copy link
Collaborator

LisaFC commented Sep 23, 2021

Yeah, the Docsy/docsy-example account is from ... somewhen. I'll see if I can track it down with some of the other Docsy-ites and/or dig into with Netlify. The goldydocs version is the one that actually works.

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.

2 participants