Fix btn path

This commit is contained in:
samaradel
2022-07-21 15:16:33 +02:00
parent ebae23bd08
commit b4914f8150
3 changed files with 11 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
# The URL the site will be built for # The URL the site will be built for
base_url = "https://threefoldfoundation.github.io/www_threefold_io/" base_url = "https://threefoldfoundation.github.io/www_threefold_io"
# Change this to your own URL! Please note this variable **must** be uncommented. # Change this to your own URL! Please note this variable **must** be uncommented.
title = "ThreeFold" title = "ThreeFold"

View File

@@ -39,8 +39,8 @@
<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"> <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}} {{link_label}}
</a> </a>
{% elif base is containing("/www_threefold_io/") %} {% elif base is containing("/www_threefold_io") %}
<a href="/www_threefold_io/{{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"> <a href="/www_threefold_io/{{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}} {{link_label}}
</a> </a>
{% else %} {% else %}

View File

@@ -1,10 +1,18 @@
{% set path = body | split(pat="href=") | slice(start=1) | first | split(pat=">") | first | trim_start_matches(pat='"') {% set path = body | split(pat="href=") | slice(start=1) | first | split(pat=">") | first | trim_start_matches(pat='"')
| trim_end_matches(pat='"') %} | trim_end_matches(pat='"') %}
{% set base = config.base_url %}
{% if 'https' in path %} {% if 'https' in path %}
<button onclick="window.open('{{path}}', '_blank');" <button onclick="window.open('{{path}}', '_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"> 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}} {{ body | trim_start_matches(pat="<p>") | safe}}
</button> </button>
{% elif '/www_threefold_io' in base %}
<button onclick="window.location='{{base}}/{{path}}'"
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>
{% else %} {% else %}
<button onclick="window.location='{{path}}'" <button onclick="window.location='{{path}}'"
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"> 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">