zjedi / hugo-scroll

Clean, responsive, single-page Hugo website theme.
https://themes.gohugo.io/hugo-scroll/
MIT License
256 stars 187 forks source link

Internal links on site head #158

Closed spi43984 closed 8 months ago

spi43984 commented 9 months ago

I needed some links on the cover page to link to internal sites and not showing the leading fork awesome icon. For some of these pages I also wanted to get the content still rendered on the homepage - for others not.

With these changes two parameters are introduced in the markdown files: internal = the URL to link to internal_hide = if true then do not render this markdown file (as a side-effect this works on all homepage markdown files to show or hide them)

netlify[bot] commented 9 months ago
Comment has been resolved **spi left a comment:** Try to join the review on Netlify regarding issue #158 Cheers spi
Browser metadata ``` Path: /#github Browser: Chrome 117.0.0.0 on Linux x86_64 Viewport: 1720 x 1267 @1x Language: de-DE Cookies: Enabled ``` [Open in BrowserStack](https://www.browserstack.com/user/try-live?url=https%3A%2F%2Fdeploy-preview-158--hugo-scroll.netlify.app%2F%23github&os=OS%20X&os_version=Big%20Sur&browser=Chrome&browser_version=117.0&resolution=1720x1267&speed=1&start=true&ref=netlify-source)
[Open Deploy Preview](https://deploy-preview-158--hugo-scroll.netlify.app/#github) · [Mark as Unresolved](https://app.netlify.com/cdp/resolve?deployID=651d868548e46d00071a5a29&commentID=651e8bb51547de03499fe652&resolution=unresolved)
spi43984 commented 9 months ago

Something seems wrong with the demo page, see deployed demo, at the very bottom. https://deploy-preview-158--hugo-scroll.netlify.app/#github image

Added leading '---' to internal.md.

Seems to work now - just the contacts button on the cover page leads to nowhere as the destination is missing. Will create a demo page...

zjedi commented 9 months ago

@spi43984 If you go check the demo now, there are some outstanding issues

spi43984 commented 9 months ago

@spi43984 If you go check the demo now, there are some outstanding issues

  • two sections Contact + Contacts, sounds illogical to have two of them

fair point - as there is already a contact section, will prepare another example, maybe legal or something

  • try navigating from landing page, from left "sticky menu", play around, I managed to run into an error.

What was the error? Can you please give some more context? Or is it GITHUB to show up in the nav menu? Which should not as it is an external link, found a bug in index.html - am trying to solve that:

{{ $content := where $sections "Params.external" "==" nil }}
{{ $content := where $sections "Params.internal_hide" "ne" true }}

The second line circumvents the first one and renders homepage content even it is an external link.

Is there a combination possible like

{{ $content := where $sections and ("Params.internal_hide" "ne" true) ("Params.internal_hide" "ne" true) }}

Edit:

{{ $content := where (where $sections "Params.external" "==" nil) "Params.internal_hide" "ne" true }}

seems to do the trick...

spi43984 commented 9 months ago

@spi43984 If you go check the demo now, there are some outstanding issues

  • two sections Contact + Contacts, sounds illogical to have two of them
  • try navigating from landing page, from left "sticky menu", play around, I managed to run into an error.

please review

zjedi commented 9 months ago

two sections Contact + Contacts, sounds illogical to have two of them

Looks good now, thanks!

try navigating from landing page, from left "sticky menu", play around, I managed to run into an error.

Unable to reproduce the error, looks ok now.