Commit ecf80851 authored by Kaushal Modi's avatar Kaushal Modi
Browse files
parent 2d8c81ca
......@@ -8,3 +8,37 @@
:END:
This is a test post.
* Post with links
:PROPERTIES:
:EXPORT_FILE_NAME: post-with-links
:EXPORT_HUGO_CUSTOM_FRONT_MATTER: :branch link-render-hook
:END:
Ref:
- https://discourse.gohugo.io/t/string-ending-stops-replacere-from-working/37343
- https://gohugo.io/getting-started/configuration-markup/#markdown-render-hooks
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque et
quam metus. Etiam in iaculis mi, sit amet pretium magna. Donec ut dui
mi. Maecenas pharetra sapien nunc, ut mollis enim aliquam quis. Nam at
ultricies metus. Nulla tempor augue in vestibulum tristique. Phasellus
volutpat pharetra metus quis suscipit. Morbi maximus sem dolor, id
accumsan ipsum commodo non. https://youtu.be/dQw4w9WgXcQ.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque et
quam metus. Etiam in iaculis mi, sit amet pretium magna. Donec ut dui
mi. Maecenas pharetra sapien https://youtu.be/dQw4w9WgXcQ nunc, ut
mollis enim aliquam quis. Nam at ultricies metus. Nulla tempor augue
in vestibulum tristique. Phasellus volutpat pharetra metus quis
suscipit. Morbi maximus sem dolor, id accumsan ipsum commodo non.
https://youtu.be/dQw4w9WgXcQ
[[https://youtu.be/dQw4w9WgXcQ][text]]
https://youtu.be/dQw4w9WgXcQ Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Quisque et quam metus. Etiam in iaculis mi, sit amet
pretium magna. Donec ut dui mi. Maecenas pharetra sapien nunc, ut
mollis enim aliquam quis. Nam at ultricies metus. Nulla tempor augue
in vestibulum tristique. Phasellus volutpat pharetra metus quis
suscipit. Morbi maximus sem dolor, id accumsan ipsum commodo
non. https://youtu.be/dQw4w9WgXcQ
+++
title = "Post with links"
draft = false
branch = "link-render-hook"
+++
Ref:
- <https://discourse.gohugo.io/t/string-ending-stops-replacere-from-working/37343>
- <https://gohugo.io/getting-started/configuration-markup/#markdown-render-hooks>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque et
quam metus. Etiam in iaculis mi, sit amet pretium magna. Donec ut dui
mi. Maecenas pharetra sapien nunc, ut mollis enim aliquam quis. Nam at
ultricies metus. Nulla tempor augue in vestibulum tristique. Phasellus
volutpat pharetra metus quis suscipit. Morbi maximus sem dolor, id
accumsan ipsum commodo non. <https://youtu.be/dQw4w9WgXcQ>.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque et
quam metus. Etiam in iaculis mi, sit amet pretium magna. Donec ut dui
mi. Maecenas pharetra sapien <https://youtu.be/dQw4w9WgXcQ> nunc, ut
mollis enim aliquam quis. Nam at ultricies metus. Nulla tempor augue
in vestibulum tristique. Phasellus volutpat pharetra metus quis
suscipit. Morbi maximus sem dolor, id accumsan ipsum commodo non.
<https://youtu.be/dQw4w9WgXcQ>
[text](https://youtu.be/dQw4w9WgXcQ)
<https://youtu.be/dQw4w9WgXcQ> Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Quisque et quam metus. Etiam in iaculis mi, sit amet
pretium magna. Donec ut dui mi. Maecenas pharetra sapien nunc, ut
mollis enim aliquam quis. Nam at ultricies metus. Nulla tempor augue
in vestibulum tristique. Phasellus volutpat pharetra metus quis
suscipit. Morbi maximus sem dolor, id accumsan ipsum commodo
non. <https://youtu.be/dQw4w9WgXcQ>
{{- $link := .Destination -}}
{{- $title := "" -}}
{{- with .Title -}}
{{- $title = (printf ` title=%s` .) -}}
{{ end }}
{{- $desc := .Text -}}
{{- $link = replaceRE `youtu\.be/` `invidious.osi.kr/watch?v=` $link -}}
{{- $desc = replaceRE `youtu\.be/` `invidious.osi.kr/watch?v=` $desc -}}
{{- (printf `<a href="%s"%s>%s</a>` ($link | safeURL) $title $desc) | safeHTML -}}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment