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

Internal links on site head #158

Merged
merged 12 commits into from
Oct 14, 2023
Merged

Conversation

spi43984
Copy link
Contributor

@spi43984 spi43984 commented Oct 4, 2023

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)

Copy link
Owner

@zjedi zjedi left a comment

Choose a reason for hiding this comment

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

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

@netlify
Copy link

netlify bot commented Oct 5, 2023

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

Open Deploy Preview · Mark as Unresolved

@spi43984
Copy link
Contributor Author

spi43984 commented Oct 5, 2023

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
zjedi previously approved these changes Oct 6, 2023
@zjedi zjedi dismissed their stale review October 6, 2023 23:24

checked the demo, found issues

@zjedi
Copy link
Owner

zjedi commented Oct 6, 2023

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

@spi43984
Copy link
Contributor Author

spi43984 commented Oct 8, 2023

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

added nested where clause to render content only if:

- external == nil
and
- internal_hide ne true
@spi43984
Copy link
Contributor Author

spi43984 commented Oct 8, 2023

@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
Copy link
Owner

zjedi commented Oct 8, 2023

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.

Copy link
Owner

@zjedi zjedi left a comment

Choose a reason for hiding this comment

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

Looks good, just a couple suggestions regarding configuration property names to make them more obvious :)

exampleSite/content/homepage/internal.md Outdated Show resolved Hide resolved
exampleSite/content/homepage/internal.md Outdated Show resolved Hide resolved
@spi43984 spi43984 requested a review from zjedi October 14, 2023 10:05
@zjedi zjedi merged commit 5b4c79e into zjedi:master Oct 14, 2023
7 checks passed
@spi43984 spi43984 deleted the InternalLinksOnSiteHead branch October 14, 2023 13:24
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