Insight
Optimize Your Ghost CMS Site’s Navigation: Make External Links Open in New Tabs
A small Ghost navigation improvement that can make the site experience cleaner and less disruptive.
A small Ghost navigation improvement that can make the site experience cleaner and less disruptive.
Linking to external resources adds context and credibility, but it can also pull visitors away from your Ghost site. A small JavaScript snippet can keep their place intact by opening external links in a new tab.
External links are useful, but they can interrupt the reading flow and make it less likely that visitors return to your original page. The goal is to let readers explore references without losing their place on your site.
This script automatically detects external links and opens them in a new tab:
document.addEventListener('DOMContentLoaded', function() {
const links = document.querySelectorAll('a');
const currentDomain = window.location.hostname;
links.forEach(link => {
if (link.hostname !== currentDomain) {
link.target = '_blank';
link.rel = 'noopener';
}
});
});script tags in the Site Footer area.If you want help implementing this or need deeper Ghost navigation customization, contact Inoryum.
Insight
A small Ghost navigation improvement that can make the site experience cleaner and less disruptive.
Insight
How to improve code presentation inside Ghost blogs with cleaner syntax highlighting.
Insight
A cleaner way to handle footnotes and references in Ghost-powered publishing.
Insight
A practical guide to using Ghost webhooks for automation and connected workflows.
Thanks. We received your message and will get back to you soon.