OKAMca / swup-head-plugin

:dog: Plugin for replacing contents of head tag.

Home Page:https://swup.js.org/plugins/head-plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Swup Head Plugin

Plugin serves to replace the contents of head tag when the content of the page is replaced. Primary reason for this can be usage of different style files included with a link for different pages.

Note: This plugin is rather experimental and any improvements or comments are more than welcome.

Instalation

This plugin can be installed with npm

npm install @swup/head-plugin

and included with import

import SwupHeadPlugin from '@swup/head-plugin';

or included from the dist folder

<script src="./dist/SwupHeadPlugin.js"></script>

Usage

To run this plugin, include an instance in the swup options.

const swup = new Swup({
  plugins: [new SwupHeadPlugin()]
});

About

:dog: Plugin for replacing contents of head tag.

https://swup.js.org/plugins/head-plugin

License:MIT License


Languages

Language:JavaScript 100.0%