Skip to content

Conversation

@agriyakhetarpal
Copy link
Member

@agriyakhetarpal agriyakhetarpal commented Nov 19, 2025

#162 and #163 had previously added an external link indicator icon to the theme, which was later reverted in #269 due to discussion in ##233 (comment), where it was pointed out that it was broken for dark mode and there were some questions around how to style SVGs. Also, it was mentioned that this functionality was not being used in the websites that use the theme. However, we had enabled it downstream and it caught my eye on a routine visit recently. I've put forward in this PR a more correct implementation for external link indicators, drawing from how the PyData Sphinx Theme does it.

This also works with light and dark mode, the rationale being that the ::after pseudo-element doesn't explicitly set a color property and inherits it from the parent – wherein, in this case, we have --pst-color-text-base and --pst-color-link-hover that are defined with different values for light and dark mode already.

cc: @stefanv

Here are some screenshots for your reference:

Location Colour mode Screenshot
Navbar Light image
Navbar Dark image
Footer N/A image

@netlify
Copy link

netlify bot commented Nov 19, 2025

Deploy Preview for scientific-python-hugo-theme ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 438a154
🔍 Latest deploy log https://app.netlify.com/projects/scientific-python-hugo-theme/deploys/692f8ab7e91d2c0008533606
😎 Deploy Preview https://deploy-preview-678--scientific-python-hugo-theme.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 96
Accessibility: 100
Best Practices: 100
SEO: 91
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Member

@stefanv stefanv left a comment

Choose a reason for hiding this comment

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

LGTM, just one minor doc tweak. Thanks!


## External links

Links in the navbar and footer can be marked as external by adding `is_external: true`. This displays an external link indicator icon (↗)
Copy link
Member

Choose a reason for hiding this comment

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

We're using a different icon in this PR, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, we are using https://utf8-icons.com/utf-8-character-62301. This ↗ one is the closest I could find in Unicode at that time, but I can change it to the U+F35D icon (). Unfortunately, it looks like my computer doesn't support this icon at all (I see a glyph with a question mark inside it), so could you please check if you can see it? It looks roughly like this icon: https://fontawesome.com/v5/icons/external-link-alt?s=solid. I can see it in the CSS for some reason though; that's how I have the screenshots.

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, so it looks like my browser also can't understand this icon, because it's only available with the "Font Awesome 6 Free" font, but this paragraph in the documentation uses the default font. This explains why we can see it in the header and the footer.

Copy link
Member Author

Choose a reason for hiding this comment

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

I have an idea for a fix

Copy link
Member Author

@agriyakhetarpal agriyakhetarpal Dec 3, 2025

Choose a reason for hiding this comment

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

@agriyakhetarpal agriyakhetarpal marked this pull request as draft December 3, 2025 00:51
@agriyakhetarpal agriyakhetarpal marked this pull request as ready for review December 3, 2025 00:56
@stefanv stefanv added the type: Enhancement New feature or request label Dec 3, 2025
@stefanv
Copy link
Member

stefanv commented Dec 3, 2025

Haha, OK, fine that works.

@stefanv stefanv merged commit d7e7b76 into scientific-python:main Dec 3, 2025
6 of 7 checks passed
@agriyakhetarpal agriyakhetarpal deleted the is-external-link branch December 3, 2025 10:33
@stefanv stefanv added this to the 0.22 milestone Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants