riptano / docs-ui

The UI and theme for DataStax Docs.
https://riptano.github.io/docs-ui/
Mozilla Public License 2.0
2 stars 0 forks source link

Modify svg helper so it references path correctly in preview and build #17

Closed mlr closed 11 months ago

mlr commented 11 months ago

This updates the svg handlerbars helper so the svg is rendered with an img tag rather than attempting to read the content of the svg file and return that to the rendered page.

The reason this is necessary is because at build time, the path to the UI bundle isn't the same as when running a UI preview build. By using an image tag we can simply refer to the uiRootPath so the image knows where to look when the page is compiled to its static HTML

To test:

  1. Pull down and checkout this branch
  2. Run gulp bundle
  3. In the datastax docs site repo, refer to the UI bundle path given with the output of the above command
  4. run npm run build:develop for the datastax docs site
  5. Navigate to the tutorial template and see that the collab svg is rendering for the Run this on Colab button

image