Using local image in "cards" shortcode #49
-
How can I use a local image in the cards shortcode? I have an SVG file in
but unable to see the image. Do I need to store it somewhere else like |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Putting your images under The The thing is, the leading slash in |
Beta Was this translation helpful? Give feedback.
Putting your images under
static/myfile.svg
, and then you can use them by/myfile.svg
. If it's put understatic/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'…