link fixes

This commit is contained in:
timurgordon
2022-08-25 10:31:43 +03:00
parent bdc8ae9a0f
commit 4b952b38f3
3 changed files with 19 additions and 11 deletions

View File

@@ -39,7 +39,7 @@ render_emoji = false
# Whether external links are to be opened in a new tab
# If this is true, a `rel="noopener"` will always automatically be added for security reasons
external_links_target_blank = true
external_links_target_blank = false
# Whether to set rel="nofollow" for all external links
external_links_no_follow = true

View File

@@ -35,9 +35,11 @@
{% set link_label = header_label | striptags %}
{% set link_path = header_label | split(pat="%22") | safe%}
{% if header_label is containing("http") %}
{% if header_label is not containing("threefold") %}
<a href="{{link_path[1]}}" target="_blank" class="text-lg leading-6 font-medium text-gray-900 hover:text-gray-500 focus:outline-none focus:text-gray-900 transition ease-in-out duration-150 mt-0">
{{link_label}}
</a>
{% endif %}
{% else %}
<a href="{{ get_url(path=link_path[1])}}" class="text-lg leading-6 font-medium text-gray-900 hover:text-gray-500 focus:outline-none focus:text-gray-900 transition ease-in-out duration-150 mt-0">
{{link_label}}
@@ -163,9 +165,11 @@
{% set link_label = header_label | striptags %}
{% set link_path = header_label | split(pat="%22") | safe%}
{% if header_label is containing("http") %}
{% if header_label is not containing("threefold") %}
<a href="{{link_path[1]}}" target="_blank" class="text-lg px-8 py-3 leading-6 font-normal text-gray-900 hover:text-gray-900 focus:outline-none focus:text-gray-900 transition ease-in-out duration-150">
{{link_label}}
</a>
{% endif %}
{% else %}
<a href="{{ get_url(path=link_path[1])}}" class="text-lg px-8 py-3 leading-6 font-normal text-gray-900 hover:text-gray-900 focus:outline-none focus:text-gray-900 transition ease-in-out duration-150">
{{link_label}}

View File

@@ -2,10 +2,14 @@
| trim_end_matches(pat='"') %}
{% if 'https' in url %}
<button onclick="window.open('{{url}}', '_blank');"
{% if url is not containing("threefold") %}
{% if url is not containing("localhost") %}
<button onclick="window.open('{{url}}', '_blank');"
class="leading-6 border-transparent flex flex-col border-2 w-full items-start rounded transition hover:first:text-gray-500 hover:border-stone-200 hover:bg-stone-100 p-2 text-left">
{{ body | trim_start_matches(pat="<p>") | safe}}
</button>
</button>
{% endif %}
{% endif %}
{% else %}
<button onclick="window.location='{{get_url(path=url)}}'"