package gallery
import (
"html/template"
"io/fs"
"regexp"
"sort"
"strings"
"testing"
"amadan.net/rastrillo/fiesta"
)
// The shell every page is drawn in: the sidebar shell Fiesta ships,
// with the rail and its filter, the pinned bar, the phone index and
// its way back, the display settings menu, and the scripts a gallery
// page loads. These read the rendered bytes; the drives in the
// browser-tagged files beside this one read what the scripts do to
// them. Where a gate below is Rastrillo's, its name is kept and its
// expectations are read off pageKinds() and the manifest, so a page
// kind or an example added later is covered the day it lands.
// railOf cuts the sidebar's nav out of a page. Everything below reads
// this slice rather than the whole document, so a stray anchor
// somewhere in a sample cannot make the rail look complete.
func railOf(t *testing.T, name, page string) string {
t.Helper()
_, after, ok := strings.Cut(page, `