Static sites

Export the site. Keep the modals.

Opening, showing and closing a modal never asks WordPress for anything, so a Simply Static export behaves like the live site. This page lists every feature, free and Pro, and what it does when there’s no WordPress behind the page.

0

Requests to WordPress

To open, show or close a modal, on the live site or an export.

0

Simply Static settings

Modal Kit adds its own files to the export.

8 of 8

Free features work

Two are decided when you export.

17

Tests on every change

Run against an exported site, with no WordPress behind it.

What works

Feature by feature

Works: the same as on the live site. Set at export: decided when the page is exported, so export again after changing it. Live WordPress: needs your WordPress site to answer, so it doesn’t run on a static copy.

Feature

On an export

What happens

Links to a modal

Works

Links to #modal-{slug} or ?modal={slug} open the modal from the exported page. Tested.

Without JavaScript

Works

A #modal-{slug} link still shows the modal with CSS alone, if scripts are blocked or haven’t loaded yet. Tested.

Triggers

Works

Load, scroll, leaving the page, time on site, inactivity, URL and element in view. Each trigger is its own file, and Modal Kit adds them all to the export. Tested.

Page targeting

Set at export

Which pages show a modal is decided as each page is exported, so a modal is only in the pages it targets. Export again after changing it. Tested.

Frequency, devices, browsers, schedule and page views

Works

These rules run in the browser, and what a visitor has seen, including how many times a modal opened by itself, is kept in localStorage, so it’s remembered across pages and visits. Tested.

Hide for logged-in visitors

Set at export

Pages are exported as a logged-out visitor sees them, and nobody logs in to a static site, so this rule never hides a modal there.

Fixed styles and their fonts

Works

Fieldnote, Harbor and Night load their bundled fonts from the export, never from Google Fonts. Tested.

Video

Works

The video player is a separate file, added to the export with the triggers.

Exporting

Nothing to set in Simply Static

Export the way you already do. Modal Kit takes care of the parts an exporter can’t see.

01

Export as usual

Simply Static copies the files each page links to. Modal Kit adds the trigger and video files it loads on demand, which no page links to directly.

02

Results stay out of it

Pro doesn’t send counts from the pages Simply Static exports, since there’s no site behind them to count on. Analytics services still work.

03

Decide on Strict mode

If you use the bot check, turn Strict off in Settings → Integrations for protected forms to work on the export, with the honeypot only.

04

Export again after changes

Page targeting, country rules and reviews are decided when a page is built, so a fresh export picks up changes to them.

Using another exporter?

Include the folder wp-content/plugins/modal-kit/build/runtime in the export. It holds the triggers and the video player, which pages import only when needed.

With Pro, turn off counting during the export with the modal_kit_pro_results_count filter. It’s automatic for Simply Static.

How we test

Every change is tested on an export

Each change to Modal Kit exports a test site with Simply Static, serves the files on their own and runs 17 browser tests against them. A test fails if a page asks WordPress for anything.

The script modules and import map are in the export

A link opens the modal, and the Close action closes it

Lazily loaded triggers load from the export

A fixed style loads its bundled fonts from the export

Page targeting was decided at export time

Frequency is remembered in localStorage across reloads

Without JavaScript, a link still shows the modal

Pro: with Strict off, a protected form posts directly

Pro: a fixed-code wheel plays and remembers the prize

Pro: the age gate asks and remembers the answer

Pro: the teaser reopens the modal

Pro: analytics fire, and the site is never called

Static files. Working modals.