diff --git a/snapshots.js b/snapshots.js index bae4e363e3..20f6565102 100644 --- a/snapshots.js +++ b/snapshots.js @@ -21,7 +21,14 @@ PercyScript.run(async (page, percySnapshot) => { await page.waitFor('body'); // create percy snapshot with path as a name - const path = new URL(url).pathname.replace(/\/?$/, '/'); + let path = new URL(url).pathname.replace(/\/?$/, '/'); + + if (path.indexOf('/docs/') === -1) { + path = '/site' + path; + } else { + path = path.replace('/docs', ''); + } + await percySnapshot(path, {widths: [375, 1280]}); } });