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

Fix the 404 nav bar to use the site configurable logo #104

Merged
merged 1 commit into from
Oct 20, 2020

Conversation

alex-bezek
Copy link
Contributor

#103

I'm new to hugo, but from reading https://gohugo.io/variables/site/ it seems the . in a partial is the current context.
The main site navbar.html partial seems to work because the whole site is passed as context https://github.com/hossainemruz/toha/blob/master/layouts/index.html#L26 . However, the 404 nav bar partial doesn't seem to work because a dictionary partial is passed in https://github.com/hossainemruz/toha/blob/master/layouts/404.html#L6

Changing to use the global site function appears to fix it. Alternatively i could pass in either the full site object as context or add the .Site.Params.logo as a dictionary item to https://github.com/hossainemruz/toha/blob/master/layouts/404.html#L6

I've consumed this branch in my site to test
image
alex-bezek/blog#44
https://percy.io/alex-bezek/blog/builds/7343218
https://blog-git-demo-404-logo.alex-bezek.vercel.app/404.html

@alex-bezek alex-bezek mentioned this pull request Oct 19, 2020
Copy link
Member

@hossainemruz hossainemruz left a comment

Choose a reason for hiding this comment

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

Thank you @alex-bezek . Looks good.

@hossainemruz hossainemruz merged commit 2f4bfcd into hugo-toha:master Oct 20, 2020
@alex-bezek alex-bezek deleted the 404-logo branch October 20, 2020 13:52
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