From 5d708919b6609ad3921429effe03878dc9579df5 Mon Sep 17 00:00:00 2001 From: cupcakearmy Date: Sat, 5 Oct 2019 18:37:54 +0200 Subject: [PATCH] swup ignore anchor links --- liquet/style.css | 2 +- src/js/index.js | 2 +- src/js/swup.js | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/liquet/style.css b/liquet/style.css index d411bbe..d189770 100644 --- a/liquet/style.css +++ b/liquet/style.css @@ -2,7 +2,7 @@ Theme Name: Liquet Author: Niccolo Borgioli Description: Minimalistic clean theme -Version: 0.11 +Version: 0.12 License: MIT Tags: minimal, simple, typography, clean Author URI: https://nicco.io diff --git a/src/js/index.js b/src/js/index.js index 1c0ade8..44e7594 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -5,7 +5,7 @@ import swup from './swup' document.addEventListener('DOMContentLoaded', () => { lights() lazy() - swup(()=> { + swup(() => { lazy() }) }) \ No newline at end of file diff --git a/src/js/swup.js b/src/js/swup.js index 85e30e9..829d3ad 100644 --- a/src/js/swup.js +++ b/src/js/swup.js @@ -1,8 +1,9 @@ import Swup from 'swup' -import SwupPreloadPlugin from '@swup/preload-plugin'; +import SwupPreloadPlugin from '@swup/preload-plugin' export default (fn) => { const swup = new Swup({ + linkSelector: `a[href^="${window.location.origin}"]:not([data-no-swup]), a[href^="/"]:not([data-no-swup])`, plugins: [new SwupPreloadPlugin()], containers: ['#app'] })