Skip to content

feat: Open external links in new tab - #589

Merged
fghaas merged 1 commit into
cleura:mainfrom
fghaas:open-in-new-tab
Nov 30, 2026
Merged

fghaas merged 1 commit into
cleura:mainfrom
fghaas:open-in-new-tab

Conversation

@fghaas

@fghaas fghaas commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Ensure that only internal links are opened in the same tab, and a new
tab opens for any link pointing to a different hostname.

Mkdocs has a plugin for this, which however isn't compatible with
Zensical. Thus, to ensure a smooth Zensical transition, include the
Javascript from that plugin directly (as recommended in the Zensical
docs).

References:
https://zensical.org/docs/compatibility/mkdocs/plugins/#open-in-new-tab
https://github.com/JakubAndrysek/mkdocs-open-in-new-tab/blob/main/open_in_new_tab/js/open_in_new_tab.js

Ensure that only internal links are opened in the same tab, and a new
tab opens for any link pointing to a different hostname.

Mkdocs has a plugin for this, which however isn't compatible with
Zensical. Thus, to ensure a smooth Zensical transition, include the
Javascript from that plugin directly (as recommended in the Zensical
docs).

References:
https://zensical.org/docs/compatibility/mkdocs/plugins/#open-in-new-tab
https://github.com/JakubAndrysek/mkdocs-open-in-new-tab/blob/main/open_in_new_tab/js/open_in_new_tab.js

@colder-is-better colder-is-better left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Interesting: JavaScript can be very readable.

@fghaas
fghaas merged commit bcc01db into cleura:main Nov 30, 2026
2 checks passed
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