Skip to content

Commit

Permalink
Add more detail to the Image Links test case
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushalmodi committed Aug 7, 2018
1 parent a2f83d9 commit c5bccd5
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 3 deletions.
31 changes: 31 additions & 0 deletions test/site/content-org/all-posts.org
Expand Up @@ -52,6 +52,16 @@ Export this *second* post only by bringing point here and doing =M-x org-hugo-ex
:END:
This is some text before the first heading of this post.
*** Unclickable image (works!)

#+begin_src org
# Org source
,#+name: fig__unclickable_image
,#+caption: Don't click this image -- It's not a hyperlink
[[/images/org-mode-unicorn-logo.png]]
#+end_src

#+name: fig__unclickable_image
#+caption: Don't click this image -- It's not a hyperlink
[[/images/org-mode-unicorn-logo.png]]

-----
Expand All @@ -74,9 +84,30 @@ 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!)
[[/images/org-mode-unicorn-logo.png][Click here to see the unicorn]]

Do *not* use ~file:~ prefix in the Description if you want the image
link to show up as-is i.e. not be replaced by the image-at-link like
in [[fig__clickable_image_that_opens_the_image]]:

#+begin_src org
# Org source
[[/images/org-mode-unicorn-logo.png][/images/org-mode-unicorn-logo.png]]
#+end_src

[[/images/org-mode-unicorn-logo.png][/images/org-mode-unicorn-logo.png]]

*** Clickable image that opens the image (works!)
Click below image to jump to the unicorn image.

#+begin_src org
# Org source
,#+name: fig__clickable_image_that_opens_the_image
,#+caption: Click this image -- It's a hyperlink
[[/images/org-mode-unicorn-logo.png][file:/images/org-mode-unicorn-logo.png]]
#+end_src

#+name: fig__clickable_image_that_opens_the_image
#+caption: Click this image -- It's a hyperlink
[[/images/org-mode-unicorn-logo.png][file:/images/org-mode-unicorn-logo.png]]

- NOTE :: =file:= has to be used in the *Description component* of the
Expand Down
35 changes: 32 additions & 3 deletions test/site/content/posts/image-links.md
Expand Up @@ -10,7 +10,16 @@ This is some text before the first heading of this post.

## Unclickable image (works!) {#unclickable-image--works}

{{< figure src="/images/org-mode-unicorn-logo.png" >}}
```org
# Org source
#+name: fig__unclickable_image
#+caption: Don't click this image -- It's not a hyperlink
[[/images/org-mode-unicorn-logo.png]]
```

<a id="orga3633e1"></a>

{{< figure src="/images/org-mode-unicorn-logo.png" caption="Figure 1: Don't click this image -- It's not a hyperlink" >}}

---

Expand Down Expand Up @@ -41,12 +50,32 @@ tag and look the same size.

[Click here to see the unicorn](/images/org-mode-unicorn-logo.png)

Do **not** use `file:` prefix in the Description if you want the image
link to show up as-is i.e. not be replaced by the image-at-link like
in [2](#org54fce47):

```org
# Org source
[[/images/org-mode-unicorn-logo.png][/images/org-mode-unicorn-logo.png]]
```

[/images/org-mode-unicorn-logo.png](/images/org-mode-unicorn-logo.png)


## Clickable image that opens the image (works!) {#clickable-image-that-opens-the-image--works}

Click below image to jump to the unicorn image.

{{< figure src="/images/org-mode-unicorn-logo.png" link="/images/org-mode-unicorn-logo.png" >}}
```org
# Org source
#+name: fig__clickable_image_that_opens_the_image
#+caption: Click this image -- It's a hyperlink
[[/images/org-mode-unicorn-logo.png][file:/images/org-mode-unicorn-logo.png]]
```

<a id="org54fce47"></a>

{{< figure src="/images/org-mode-unicorn-logo.png" caption="Figure 2: Click this image -- It's a hyperlink" link="/images/org-mode-unicorn-logo.png" >}}

NOTE
: `file:` has to be used in the **Description component** of the
Expand All @@ -58,7 +87,7 @@ NOTE
Here's the same link with `#+name` specified.. which should also be
clickable.

<a id="org55ede7e"></a>
<a id="orgd697346"></a>

{{< figure src="/images/org-mode-unicorn-logo.png" link="/images/org-mode-unicorn-logo.png" >}}

Expand Down

0 comments on commit c5bccd5

Please sign in to comment.