From 3a871e7899e00d5b0b500d613e2bb34dc7bfecf9 Mon Sep 17 00:00:00 2001 From: Katy DeCorah Date: Thu, 21 Mar 2019 14:29:59 -0400 Subject: [PATCH] Set default thumbnail for examples page for development (#8025) * Set default thumbnail * Add a little guidance about creating example images * creates placeholder.png --- docs/README.md | 2 +- docs/img/src/placeholder.png | Bin 0 -> 168 bytes docs/pages/examples.js | 6 ++++-- 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 docs/img/src/placeholder.png diff --git a/docs/README.md b/docs/README.md index ea6d3fc3eef..a85f621ba58 100644 --- a/docs/README.md +++ b/docs/README.md @@ -33,7 +33,7 @@ In the `.html` file, write the HTML and JavaScript constituting the example. * Do **not** use custom styles from your personal account. Use only the default `mapbox` account styles. * When embedding literal JSON (GeoJSON or Mapbox style snippets) into script code, double-quote property names and string values. Elsewhere, use single-quoted strings. -Every example **must** have an accompanying image: +Every example **must** have an accompanying image. To get an image, run the site locally and take a screenshot of the rendered map in the example: 1. Run `npm run create-image `. The script will take a screenshot of the map in the example and save it to `docs/img/src/`. Commit the image. 2. Run `npm run start-docs` to verify that your example image is loading as expected. diff --git a/docs/img/src/placeholder.png b/docs/img/src/placeholder.png new file mode 100644 index 0000000000000000000000000000000000000000..ac53333b1f324eb0c3a23abc2171597cbde0f059 GIT binary patch literal 168 zcmeAS@N?(olHy`uVBq!ia0y~yVA;UH!1#rc87Lwy=N1U0m;-!5T%#+dSxQ>60J#aC wE{-7;jBgJz@&b8>6n-x^J8qu92xL example.tags.indexOf(topic) > -1) .map((example, index) => { const filename = example.pathname.split('/')[3]; + // set default if thumbnail doesn't exist yet + const imageId = imageConfig[filename] ? filename : 'placeholder'; return (