Skip to content
This repository has been archived by the owner on Nov 24, 2020. It is now read-only.

Link to asset files navigated directly #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/js/theme/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,10 @@ function handleNavigation(relativeUrl, push) {
// Is it an absolute url
var isAbsolute = Boolean(uriParsed.hostname);

if (!usePushState || isAbsolute) {
// Is it a HTML file rather than an asset file (image, etc.)
var isHtml = /\.html$/.test(uriParsed.pathname);

if (!usePushState || isAbsolute || !isHtml) {
// Refresh the page to the new URL if pushState not supported
location.href = relativeUrl;
return;
Expand Down