Skip to content

Crawl a website

The crawler indexes content that lives on your site as pages: documentation, a help centre, a blog. Give it a start URL and it reads your pages, splits each one into sections by heading and indexes every section. A result then links to the exact heading that matched. Paired with the docs widget, it needs nothing mapped by hand.

  1. In the setup wizard, pick your docs platform’s card, or Website for any other site. For an existing collection, open its Data page and click Change source type. Switching deletes the documents the collection holds.

  2. In Website URL, paste the root of what you want indexed, such as https://example.com/docs.

  3. Fill in the other settings you need (see the table below), and pick a Schedule.

  4. Click Continue, or Open dashboard when you add a collection later. The first crawl starts right away.

Data → Configure on a crawled blog: Website URL, Sitemap URL, Schedule set to Daily, the Only include and Skip pages pattern fields, the Content and Exclude selector fields, and Preview a page
The crawl settings under Configure

Later, under Configure on the Data page, the line under Website URL shows what the crawl covers: Crawls example.com/docs/ — 412 pages in the sitemap. If it names one page, you pasted a page instead of the root.

SettingWhat it does
Website URLWhere the crawl starts and what it covers: pages on the same host, under the same path, taken from where the URL lands after redirects. /docs covers /docs and below, never /blog. A root URL covers the whole host.
Sitemap URLOptional. Without it, Typemo finds a sitemap in the usual places, such as /sitemap.xml or your robots.txt. With no sitemap, the crawler follows links.
ScheduleManual only (default), Every 6 hours, Daily or Weekly.
Only include pages matchingPaths to crawl instead of the start URL’s path, one glob pattern per line.
Skip pages matchingPaths to leave out even when they’re in scope, one glob pattern per line.
Content selectorsCSS selectors, one per line. Only text inside them is indexed. See Choose what the crawler reads.
Exclude selectorsCSS selectors, one per line. Matching elements are never indexed.

Tag pages, paginated archives and filtered listings are the usual pages to skip. They repeat content the real pages already carry:

Skip pages matching
/blog/tag/**
/docs/archive/**

On the collection’s Data page, click Recrawl now. After a failed crawl, the notice on the same page offers Crawl again.

To change a setting, click Configure, edit it and click Save settings. The next crawl reads every page again under the new settings.

A re-crawl reads only the pages that changed, and an unchanged page keeps its results, boosts included. For that, give your pages a <lastmod> in the sitemap, or have your server send ETag or Last-Modified. Without either, every page is read in full each time.

Terminal window
curl -s -X POST "https://api.typemo.com/v1/collections/{collectionId}/source/sync" \
-H "X-API-Key: sq_your_write_key"

The call needs a Write & Read key from API keys. It answers 202 with { "status": "queued" }, and the run appears in the sync log. While a crawl is queued or running, it answers 409: call again once it finishes. Rate limits are in Formats and limits.

Every heading starts a result that carries all the text under it. A long section is split into several results, so no text is lost. A result links to its heading when the heading has an anchor on your page, and to the page otherwise.

The crawler reads the page’s main content. It takes the first of these that the page has:

  1. Your Content selectors.
  2. Elements marked data-pagefind-body.
  3. <main>, then an element with role="main", then <article>.
  4. The whole <body>, with headers and sidebars outside an article left out.

Navigation, footers, buttons, forms, dialogs, screen-reader-only text, a header outside an article that holds no <h1>, a heading’s # or link and anything marked data-pagefind-ignore are always left out. So is a block of nothing but links next to the page title (a breadcrumb before it, previous and next links after the content), and a heading in the header that holds the <h1>, such as an author’s name, reads as text rather than starting a section. Text in tabs, collapsed blocks and callouts inside the content stays in.

Use selectors when a page has no <main> or <article>, or when its theme puts a sidebar inside the content.

  1. On the collection’s Data page, click Configure.

  2. In Content selectors, list the elements that hold your content. In Exclude selectors, list the parts to drop inside them, such as a table of contents or a feedback box:

    Content selectors
    .docs-content
    Exclude selectors
    .table-of-contents
    .feedback
  3. Under Preview a page, paste any address on your site and click Preview. You see the results a crawl would index there with the selectors as typed, saved or not. Not indexed lists every block left out and why.

    Preview a page on a blog: the last results with their heading trails, and the open Not indexed list naming each left-out block and the rule that excluded it
    Preview a page, with Not indexed open
  4. Click Save settings, then Recrawl now to apply the change to every page.

  • Pages in another language. A page whose <html lang> names another language than the collection’s is skipped. An English collection keeps en and en-US pages; a page without lang is kept. To index another language, create a collection in that language and start it at that language’s root.
  • Older docs versions. Docusaurus marks pages of older and unreleased versions with a version banner. Those pages are skipped, so results point at the current docs.
  • Pages that are gone. A page that answers 404 or 410 leaves the index.

Each skip reason shows as one warning in the sync log, for example Skipped 312 page(s) in another language. The page and depth limits of one crawl are in Formats and limits.

The crawler obeys your robots.txt, only follows links on the host you gave it, and always sends this User-Agent:

User-Agent
TypemoCrawler/1.0 (+https://typemo.com/bot)

typemo.com/bot tells the owner of a crawled site the same, with the robots.txt lines that allow or block the crawler.

A crawl that finishes with 0 pages, or says the site blocked it, means your site or the firewall in front of it turned the crawler away. Search keeps the documents it had.

  1. Check robots.txt. Make sure the pages you want indexed aren’t disallowed for * or for TypemoCrawler. A pre-launch site often has User-agent: * with Disallow: /, which blocks every crawl.

  2. Allow the User-Agent. In your firewall or bot-protection rules, let requests whose User-Agent contains TypemoCrawler through.

  3. Crawl again. On the Data page, click Recrawl now, then check the Sync log.

Next: Set up the docs widget, or read How syncs work.