Skip to content

Using local image in "cards" shortcode #49

Answered by imfing
allocgator asked this question in Q&A
Discussion options

You must be logged in to vote

Putting your images under static/myfile.svg, and then you can use them by /myfile.svg. If it's put under static/images/myfile.svg then it can be referenced by /images/myfile.svg.

The static folder is special because it serves as the root directory for unprocessed files in your Hugo or static site. In other words, any files you place in the static folder will be copied directly to the root of the generated public folder, without undergoing any further transformation or processing by Hugo.

The thing is, the leading slash in /myfile.svg is essential because it tells the browser to look for the file starting from the base URL of your site, ensuring it's picked up correctly no matter where it'…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@imfing
Comment options

Answer selected by allocgator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants