The Deflect 451 Tools package simplifies the process of integrating 451 Tools into Deflect. Follow the steps below to get started:
- Clone this repository:
git clone https://github.com/ZamanehMedia/deflect-451-tools.git
- Install dependencies:
npm install
Generate the required files by running the following command:
npm run build --mirrors='"https://example.com/"'
The --mirrors argument can accept multiple items, separated by a comma without spaces. For example:
--mirrors='"https://example.com/","https://example.two.com/"'
If the --mirrors argument is not passed, a __MIRRORS__ placeholder value will be inserted instead in dist/451-tools-configuration.json. This placeholder can be used to dynamically replace the mirrors after build time. You must replace this placeholder with the actual mirror URLs at a later moment, using a value like this: "https://example.com/", "https://example.two.com/".
This command will generate the following files:
dist/451-tools.jsdist/451-tools-registration.jsdist/451-tools-configuration.json
Make sure to serve all files in the website's root. Import 451-tools-registration.js in every page, either inline it or use a script tag.