Replies: 2 comments 1 reply
-
|
The situation you describe sounds familiar to me. Please try to set the Does that cure the problem? |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
It makes a world of difference. Thank you so much! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I have been struggling withe the home page. Scrolling doesn't work on wide screen but only on phones, and the top of the page is hidden. Can someone help?
Environment:
Hugo Version: v0.145.0-666444f0... (extended, linux/amd64)
Docsy Version: v0.11.0 (Used via Hugo Modules)
Setup: Started from a clean clone of google/docsy-example repository (tag v0.11.0).
Goal:
To replace the default Docsy example homepage content (which uses blocks/* shortcodes) with a standard homepage driven by simple Markdown content in content/en/_index.md, rendered using the standard Hugo layout lookup (expecting layouts/_default/home.html).
Problem:
When content/en/_index.md contains simple Markdown content (e.g., just headings and paragraphs), the rendered homepage (/) exhibits the following issues:
The top portion of the content is hidden underneath the fixed Docsy navbar (nav.td-navbar).
Vertical scrolling is impossible or does not reveal the hidden top portion of the content.
Crucially: Inspecting the rendered HTML source shows that the expected
wrapper element (which should contain the page's main content via {{ block "main" . }} in baseof.html) is completely missing from the homepage's HTML structure. The content seems to be rendered directly without this standard wrapper.Contrast with Working Scenarios:
The original Docsy example homepage (using blocks/* shortcodes in its _index.md) renders correctly without the hidden top/scrolling issue.
Other pages on the site (e.g., blog posts, doc pages rendered using _default/single.html or _default/list.html) do appear to render correctly with the
main class="td-main"wrapper present in their HTML structure.Debugging Steps Taken & Findings:
Clean Base: Started from the official docsy-example repo clone to ensure a known-good baseline config/module setup.
Content Swap: Replaced content/en/_index.md from the example with a simple markdown file. The issue appeared immediately.
Layout File: Confirmed layouts/_default/home.html exists and correctly defines the main block with the
main class="td-main"wrapper inside it.CSS Fix Attempt: Tried adding CSS rules to assets/scss/custom.scss to force padding-top on main.td-main and overflow-y: auto on body#td-home (using the correct #td-home ID found on the body tag). These rules had no effect, likely because the target
main class="td-main"element is missing from the rendered HTML.Template Fallback Test: Renamed layouts/_default/home.html to force Hugo to fall back to layouts/_default/list.html for rendering the homepage. The
wrapper was still missing from the homepage's rendered HTML output.Front Matter: Confirmed no layout: or type: override in the content/en/_index.md front matter.
Logging: Unable to get explicit template selection information from hugo server --logLevel debug on Hugo v0.145.0.
Core Question:
Why does the Hugo/Docsy rendering process seem to omit the
wrapper (defined within the {{ define "main" }} block of _default/home.html or _default/list.html) specifically when rendering the homepage (Kind = home), even though other page kinds render it correctly? What in the Docsy v0.11.0 theme's base templates (baseof.html?) or configuration could be causing the {{ block "main" . }} output to be skipped or altered only for the homepage context when not using the example site's blocks/* shortcode structure?Beta Was this translation helpful? Give feedback.
All reactions