Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where do images go? #33

Open
nloui opened this issue Jul 14, 2017 · 3 comments
Open

Where do images go? #33

nloui opened this issue Jul 14, 2017 · 3 comments

Comments

@nloui
Copy link

nloui commented Jul 14, 2017

Hi! I think this package is awesome. Thanks for making it. I'm trying to figure out where to start and how to best reference images?

@nloui nloui closed this as completed Jul 14, 2017
@uglow
Copy link
Contributor

uglow commented Jul 14, 2017

@nloui - did you find the solution? If so, would you mind briefly documenting it in this issue? Other people may find it helpful. Thanks!

@nloui
Copy link
Author

nloui commented Jul 14, 2017

Yes, totally!

Assuming your file structure is:
/content/page1/overview.md
/content/page1/assets/image.png

This is the file path I used:
(../../../../content/page1/assets/image.png)

@rodleviton
Copy link
Contributor

rodleviton commented Jul 15, 2017

thanks @nloui. You have highlighted something that needs to be documented as navigating the image path as you have commented is less than ideal. As an alternative swanky has been configured to resolve images from an assets folder inside your src directory e.g.

<my-root-swanky-directory>/<my-src-directory>/assets

This will allow you to resolve images in your content files by using the ~ character which will let webpack know you need to resolve this path from an alias. So in your case:

<img src="../../../../content/page1/assets/image.png" />

becomes:

<img src="~assets/image.png" />

Hope this helps and I will keep this issue open until I have updated the docs.

@rodleviton rodleviton reopened this Jul 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants