Image links
tags: image
Description/Summary
This is some text before the first heading of this post. Unclickable image (works!) To be fixed (Now fixed): The sub-headings in a post get exported as Heading 1 instead of Heading 2. For example, this sub-section’s heading is exported as: # Unclickable image instead of ## Unclickable image Solution: Above is fixed by setting HUGO_OFFSET_LEVEL to 1. So the sub-heading title and the post title both get the Heading 1 tag and look the same size.
Content
This is some text before the first heading of this post.
Unclickable image (works!)
To be fixed (Now fixed): The sub-headings in a post get exported as Heading 1
instead of Heading 2.
For example, this sub-section’s heading is exported as:
# Unclickable image
instead of
## Unclickable image
Solution: Above is fixed by setting HUGO_OFFSET_LEVEL
to 1.
So the sub-heading title and the post title both get the Heading 1 tag and look the same size.
Clickable link that opens the image (works!)
Clickable image that opens the image (works!)
Click below image to jump to the unicorn image.
- NOTE:
file:
has to be used in both Link and Description components of the Org link.
Link to image outside of standard Hugo static
directory
If you link to files outside of the Hugo static
directory, ensure
that the path contains /static/
if you would like to preserve the
directory structure.
Example translations between outside static
directory paths to the
copied location inside static
:
Outside static |
Copied-to location inside static |
Explanation |
---|---|---|
~/temp/static/images/foo.png |
<HUGO_BASE_DIR>/static/images/foo.png |
If the outside path has /static/ in it, the directory structure after that is preserved when copied. |
~/temp/static/img/foo.png |
<HUGO_BASE_DIR>/static/img/foo.png |
(same as above) |
~/temp/static/foo.png |
<HUGO_BASE_DIR>/static/foo.png |
(same as above) |
~/temp/static/articles/zoo.pdf |
<HUGO_BASE_DIR>/static/articles/zoo.pdf |
(same as above) |
Source path does not contain /static/
Outside static |
Copied-to location inside static |
Explanation |
---|---|---|
~/temp/bar/baz/foo.png |
<HUGO_BASE_DIR>/static/ox-hugo/foo.png |
Here, as the outside path does not have /static/ , the file is copied to the ox-hugo/ dir in Hugo static/ dir. |
- Note: The
ox-hugo
sub-directory name is because of the default value oforg-hugo-default-static-subdirectory-for-externals
.
Page (Debug)
Page Variable | Value | |
---|---|---|
Name | "Image links" | |
Title | "Image links" | |
ResourceType | "page" | |
Kind | "page" | |
Section | "posts" | |
Draft | false | |
Type | "posts" | |
Layout | "" | |
Permalink | "https://hugo-sandbox.netlify.com/posts/image-links/" | |
RelPermalink | "/posts/image-links/" | |
Data |
| |
NextPage | Overriding menu properties completely | |
PrevPage | Source blocks with Hugo highlight shortcode | |
NextInSection | Overriding menu properties completely | |
PrevInSection | Source blocks with Hugo highlight shortcode |
Page Params (Debug)
maps.Params{"date":time.Date(2017, time.July, 15, 7, 49, 44, 0, time.Location("")), "draft":false, "iscjklanguage":false, "lastmod":time.Date(2017, time.November, 2, 10, 12, 52, 0, time.Location("")), "publishdate":time.Date(2017, time.July, 15, 7, 49, 44, 0, time.Location("")), "tags":[]string{"image"}, "title":"Image links"} (type:maps.Params) |
File Object (Debug)
FileInfo Variable | Value |
---|---|
UniqueID | "dff05f7db468d53d2ed36e22008cd3fa" |
BaseFileName | "image-links" |
TranslationBaseName | "image-links" |
Lang | "en" |
Section | "posts" |
LogicalName | "image-links.md" |
Dir | "posts/" |
Ext | "md" |
Path | "posts/image-links.md" |