Skip to content
Commit 4bc20fcf authored by Scott Whittaker's avatar Scott Whittaker
Browse files

Generate full paths for images in guides

Suppose we're using JSDuck to generate guides from the following directory
structure:

somedir/
  guides.json
  guides/
    getting_started/
      README.md
      some-image.png
    nested/
      first_guide/
        README.md
        one.png
      second_guide/
        README.md
        one.png

In JSDuck's generated HTML, image tags in the Getting Started guide will point
to the correct path relative to the page (e.g.
'guides/guide_getting_started/some-image.png'). However, the nested guides will
specify the wrong paths to images: JSDuck will write
'guides/first_guide/one.png' instead of the correct
'guides/guide_nested_first_guide/one.png'.

This patch fixes the issue by generating the image's path based on the full
name of the guide, instead of using 'File.basename' to incorrectly crop the
path.
parent 67aad127
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment