Content

Find where an element repeats before sharing it

Reads the element from the page's stored HTML and looks it up in the site's section index: the pages with an exact copy, the pages with a similar copy (same structure, different words), whether it can go on every page, and a free name. With selectors, the same for a run of elements next to each other (no similar copies). Writes nothing. One stored-page read; the counts come from the index.

post/api/v1/sites/{slug}/shared-sections/analyze

Request

  • Base URL: https://api.dotsy.ai
  • URL: https://api.dotsy.ai/api/v1/sites/{slug}/shared-sections/analyze
  • Auth: one of:
    • HTTP bearer
    • HTTP bearer

Path parameters

slugstring required
Example:acme-studio

Site slug or site id (UUID). An old slug answers 301/308 and a site id 307 to the canonical slug path.

Request body

sourceKeystring required

Content key of the page the element is on, e.g. 'about.html'.

selectorstring

CSS selector of the element in the page's stored HTML (the editor's selector, or one checked with get_content?selector=). It must match exactly one element.

ifMatchstring

The page's content hash (analyze's sourceEtag). If the page changed since, nothing is written.

selectorsstring[]

A run of elements that sit next to each other in one parent (only whitespace or comments between), in page order — instead of selector. Each must match exactly one element. The section is the run inside one wrapper (wrapTag); the pages that hold the same run (the same elements, in the same order, next to each other) take it.

wrapTag'div' | 'section' | 'footer' | 'header' | 'article' | 'aside'

With selectors: the wrapper element. Default footer when the run is the last of the page content, else section.

keepLayoutboolean

With selectors: give the wrapper style="display:contents" so a flex or grid parent still lays out the run's elements as before. Default true.

Response

Where it repeats.

sourceKeystring required
sourceEtagstring required

The page's content hash. Send it back as ifMatch to share.

proposedNamestring required

A free section name made from its heading or text.

indexWarmingboolean required

The index is still being built: counts may be low, and sharing is refused until it is done.

Example response

{
  "block": {
    "tag": "section"
  },
  "proposedName": "booking-banner",
  "placement": {
    "layout": "layouts/default.html"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.