# Trailheads: moving from another generator

Everything migrates eventually. The trailheads map another generator's config, front matter and templates onto ssqch's, and `ssqch docs --from <generator>` prints the one you need: [from Zola](https://sitesquatch.dev/docs/trailheads/from-zola/index.md), [from Hugo](https://sitesquatch.dev/docs/trailheads/from-hugo/index.md), [from Eleventy](https://sitesquatch.dev/docs/trailheads/from-eleventy/index.md), [from Docusaurus](https://sitesquatch.dev/docs/trailheads/from-docusaurus/index.md), [from MkDocs](https://sitesquatch.dev/docs/trailheads/from-mkdocs/index.md), [from Hexo](https://sitesquatch.dev/docs/trailheads/from-hexo/index.md), [from Jekyll](https://sitesquatch.dev/docs/trailheads/from-jekyll/index.md), [from VitePress](https://sitesquatch.dev/docs/trailheads/from-vitepress/index.md) and [from component frameworks](https://sitesquatch.dev/docs/trailheads/from-component-frameworks/index.md) (Astro, Next.js, Gatsby). [`examples/sites/`](https://github.com/reverentgeek/sitesquatch/tree/main/examples/sites/) has small, complete sites to start from or copy parts of, each built in CI: `blog-tags`, `blog-categories`, `docs-sidebar`, `glossary-docs`, `versioned-docs`, `component-docs`, `reference-pages`, `islands`, `jekyll-guides`, `searchable-directory` and `multilingual`.

## Scouting a site

`ssqch scout` tells you what moving a site to ssqch takes, before you start and at any point during the move. Run it in the old site's folder (or name the folder: `ssqch scout ../old-site`). It finds the generator from its files (`_config.yml`, `hugo.toml`, `mkdocs.yml`, an Eleventy config; `--from <generator>` chooses when it can't tell or guesses wrong) and prints:

- **Reference build:** the `ssqch baseline` command that builds the site with its own generator to compare with, from the site's own build command (`netlify.toml`, a `build` script, or another script that runs the generator and isn't a watcher), and what that build needs (`PAGES_REPO_NWO` for a GitHub Pages site, an `npm install` for Tailwind, the old Node a site pins in `.nvmrc`). For Eleventy it's the config's output folder (`--from dist`), and a tool the script runs beside the generator comes along after it (`eleventy & gulp` becomes `"eleventy && gulp"`, so baseline doesn't copy the output while gulp is still writing it), as does a `gulpfile.js` no script runs. Mid-move, a script scout's patch changed to `ssqch build` stands for the generator's command again.
- **A summary first:** how many things there are to do, across how many pages, and how many of them ssqch does as it is, an option does (the draft turns it on), are not in ssqch yet, or are the site's own code to port. It's the first answer to "how big is this move?".
- **To do:** what the site uses that needs doing in ssqch, each with its file and line, ssqch's way to do it, or "not in ssqch yet", the most files first. A thing used many times is one line, with a count and the first place it's used. Each line is marked `[option]` (an option does it, in the draft), `[not yet]` or `[port]` (the site's own code: templates, plugins, hooks); a line without a mark is something ssqch does.
- **Draft:** the new files a move starts with: a first `ssqch.config.js` from the old config, directory data for posts and collections, includes and render hooks for the old generator's plugins. `--write-draft` writes the ones that aren't there, and never overwrites a file.
- **Edits:** the changes to the site's own files that are mechanical and clearly right (a data file's name, an image attribute, `{% seo %}` to an include, a `package.json` script). `--patch move.patch` writes them as a patch to read and apply with `git apply move.patch`; scout never applies it. It doesn't rewrite templates: where a template would need a rewrite, ssqch has the compatibility instead (`fromJekyll()` and the other trailheads' modules, Eleventy's front matter keys as aliases), or the list says so.

It changes nothing unless it's asked, so it's safe to run again during a move: the draft files you've written show as there already, applied edits are gone from the list, an `[option]` the site's `ssqch.config.js` sets already is done (scout loads the config and checks each value the option names: `3 done already: ssqch.config.js has fromMkdocs, ...`), and so is an Eleventy to-do the config does under the same name: a filter, shortcode or tag in `filters`, a collection in `collections`, a transform in `transforms`, a plugin's work by ssqch's plugin (`rssPlugin()` for the RSS plugin and its filters, `minifyPlugin()` for an `htmlmin` transform), a library by `engines: { md }` or the `markdown` options, or the old package itself, imported in `ssqch.config.js` for an identical first build. The config's own imports of Eleventy's packages aren't to-dos, and only data in the input folder is Eleventy's data (a JSON file elsewhere, such as a saved scout report, is left alone). What's left is what still needs doing. An option that's a plugin call or a list stays on the list for you to check, and a config that doesn't load says why and counts nothing as done. `--compare` also builds the site with ssqch and compares the output with the reference build (`ssqch baseline`'s `ref-common`, or `ref-1`; `--reference <dir>` names another), and adds the result to the report: how many files differ, and the biggest groups of differences, the most files first, with the first file and the change. It builds with the clock `ssqch baseline` pins (`TZ=UTC`, and `SOURCE_DATE_EPOCH` at the HEAD commit's time, or 2026-01-01 outside git; one you set wins), so a sitemap's dates aren't a difference of their own. The comparison is the normalized one `ssqch diff` makes; `ssqch diff --exact` checks byte for byte. Fix the top group, and run `ssqch scout --compare` again: it's the move's loop in one command.

`--format json` prints the same report for agents and scripts: `generator` (and its `name`, `"Jekyll"`), `detectedBy`, `underWay` (an `ssqch.config.js` is there), `configError` (why it couldn't be read, or `null`), `summary` (`pages`, how many to-dos are `ssqch`, `option`, `notYet` and `site`, and how many are `done`), `build` (`command`, `output`, `baseline`, `needs`), `todo` (`at`, `what`, a stable `code` such as `hugo-shortcode` or `mkdocs-admonitions`, `status`: `ssqch`, `option`, `not-yet` or `site`, `count` and `files` when it's counted, `option` for the config that does it, and `docs` for an `ssqch docs` query), `done` (the to-dos the config does already: `at`, `what`, `code`, `option`), `draft` (`path`, `from`, `there`), `edits` (`path`, `to` for a rename, `changes`), `wroteDraft`, `patch`, `trailhead`, and with `--compare`, `compare` (`reference`, `output`, `built`, `errors`, `same`, `summary`, `groups` with `files`, `kind`, `first`, `removed` and `added`, `files` with the paths `changed`, `added` and `removed`, the first 20 of each, and `problem` when there was nothing to compare). When scout can't scout (no generator it knows, a folder that isn't one), it prints `{ "ok": false, "error": "..." }` instead, with the same message on standard error, and exits with 1.

```sh
ssqch scout                                   # what moving this site takes
ssqch scout --write-draft --patch move.patch  # write the draft and the patch
git apply move.patch                          # after reading it
ssqch scout                                   # later: what's left
```

What it reads in depth: Eleventy (the config and the modules it loads, filters and shortcodes, plugins, data files, `package.json`), Jekyll (`_config.yml`, the Gemfile's plugins, collections, `_plugins/*.rb`, templates that read Jekyll's `page` and `site`), Zola (`config.toml`, sections, Tera templates and shortcodes), Hugo (shortcodes and their calls, sections and `cascade`, render hooks, Go templates and Hugo Pipes; the draft turns on `fromHugo()` and has a container template to port for each of the site's shortcodes) and MkDocs (`mkdocs.yml`'s nav, theme, plugins and Markdown extensions, and the MkDocs syntax the pages use: admonitions, tabs, `.md` links, icons; the draft turns on the options that read them as they are, and writes the nav as `_data/nav.yml`) and VitePress (`.vitepress/config.ts`'s `srcDir`, `srcExclude`, `cleanUrls`, sitemap, `head` and markdown-it plugins, and what the pages use: Vue's `<script setup>`, containers and Prettier's indented `:::`, every component by name with its `.vue` file and whether it has state, the front matter the theme reads, data loaders and dynamic routes; the draft turns on `fromVitepress()`, `urls`, `ignore` for the loaders and the sitemap, and a component counts as done once it has a template). For Docusaurus (MDX and its imports, `<Tabs>`, admonitions, the sidebar, versions, plugins), Astro (`.astro` and framework components, content collections, integrations) and Hexo (tag plugins, the theme, scaffolds, plugins) it lists what the pages use, without a draft yet. If it finds no generator's files, or two generators', it says so and asks for `--from`.

## Words you bring with you

Habits come along too. Where another generator's word means the same thing in ssqch, it works, and says ssqch's name once (`--quiet` hides it):

```text
$ ssqch dev
note: dev works; ssqch calls it serve (ssqch docs serve)
```

The words that work: the commands `dev`, `start`, `server` and `watch` (for `ssqch serve`), `preview` (`ssqch serve --built`) and `generate` (`ssqch build`); the flags `--watch` and `--serve` (`ssqch serve`), `-d` and `--destination` (`--output`) and `--pathprefix` (`--base`); the config options `pathPrefix` (`base`), `dir` (`dirs`), `publishDir` and `outDir` (`dirs.output`), and `markdownTemplateEngine` and `htmlTemplateEngine` (`markdownEngine` and `htmlEngine`); the front-matter keys `eleventyComputed` (`computed`), `eleventyExcludeFromCollections` (`excludeFromCollections`), `redirect_from` (`aliases`) and `templateEngineOverride` (`render`, its `"njk,md"` string included); and the filters `url` and `relative_url` (they give the URL back as it is, since the build adds `base` itself) and `markdownify` (`markdown`), in every template language (in Edge as calls, `{{ url("/about/") }}`, since `{{ url }}` there is the page's data). An alias and ssqch's name for the same thing together are an error (`pathPrefix and base are two names for one option`). The docs, starters and messages use ssqch's names, and `ssqch build --format json` lists the aliases a site used in `aliases` rather than in `warnings`.

A word that would mean something else in ssqch is refused, with ssqch's name for it and where to read more:

```text
$ ssqch check
error: unrecognized subcommand 'check'

  `ssqch build` checks as it builds: content schemas on every build, and internal links with `linksPlugin()`. `ssqch patrol` checks a build for what agents and crawlers read.
  More: ssqch docs "Content schemas"
```

Hugo's `baseURL` (a full URL, where `base` is a path), `--drafts` and `-D` (ssqch builds drafts in development, not with a flag), `addPassthroughCopy` and the other `add*` calls (an ssqch config is an object), `{{ eleventy.generator }}`, Jekyll's `site.posts` and `published: false`, and `eleventyNavigation` (ssqch's own navigation reads `nav`; templates that call eleventy-navigation's filter still read it) get ssqch's name and where to read more too: the flags and config options are refused (every unknown config option is listed in one go), and the front matter and template data are warned about, since the page still builds. `ssqch build --format json` carries the answer as data, in a `hint` with `use` (ssqch's name) and `more`. A folder that has another generator's config and no ssqch config builds with ssqch's defaults, with a warning that says so and names `ssqch scout` (which drafts a config) and `ssqch docs --from`. `ssqch docs --from eleventy` (or `hugo`, `jekyll`, `zola`, ...) lists that generator's words with ssqch's for each, marking the ones that work, then prints its trailhead, and `ssqch docs pathPrefix` answers for one word.

Whichever generator you're leaving, build the site with it and with ssqch and run [`ssqch diff`](https://sitesquatch.dev/docs/comparing-builds/index.md) on the two output folders: it shows which pages differ and how, so you know when the move is done.
