make external links open in new tab
This commit is contained in:
@@ -39,7 +39,7 @@ render_emoji = false
|
|||||||
|
|
||||||
# Whether external links are to be opened in a new tab
|
# 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
|
# If this is true, a `rel="noopener"` will always automatically be added for security reasons
|
||||||
external_links_target_blank = false
|
# external_links_target_blank = false
|
||||||
|
|
||||||
# Whether to set rel="nofollow" for all external links
|
# Whether to set rel="nofollow" for all external links
|
||||||
external_links_no_follow = true
|
external_links_no_follow = true
|
||||||
|
|||||||
4352
static/css/index.css
4352
static/css/index.css
File diff suppressed because one or more lines are too long
@@ -22,6 +22,19 @@
|
|||||||
// Insert Twitter Pixel ID and Standard Event data below
|
// Insert Twitter Pixel ID and Standard Event data below
|
||||||
twq('init', 'o745b');
|
twq('init', 'o745b');
|
||||||
twq('track', 'PageView');
|
twq('track', 'PageView');
|
||||||
|
|
||||||
|
|
||||||
|
// makes all links outside of hostname open in new tab
|
||||||
|
// from: https://stackoverflow.com/a/4425214
|
||||||
|
var links = document.links;
|
||||||
|
console.log(links)
|
||||||
|
for (var i = 0, linksLength = links.length; i < linksLength; i++) {
|
||||||
|
|
||||||
|
if (links[i].hostname != window.location.hostname) {
|
||||||
|
links[i].target = '_blank';
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<!-- End Twitter universal website tag code -->
|
<!-- End Twitter universal website tag code -->
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,10 @@ Parameters:
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- This fixes link paths in prod -->
|
<!-- This fixes link paths in prod -->
|
||||||
|
|
||||||
{% if page %}
|
{% if page %}
|
||||||
{% if "](" in body %}
|
{% if "](" in body %}
|
||||||
|
|
||||||
{% set body_arr = body | split(pat="](") %}
|
{% set body_arr = body | split(pat="](") %}
|
||||||
{% set body = body_arr[0] %}
|
{% set body = body_arr[0] %}
|
||||||
{% for i in body_arr %}
|
{% for i in body_arr %}
|
||||||
@@ -33,10 +35,12 @@ Parameters:
|
|||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<!-- This fixes image paths in local -->
|
<!-- makes external links in row open in new tabs-->
|
||||||
|
{% set body = body | markdown | replace(from='href="', to='target="_blank" href="') | safe %}
|
||||||
|
{% set base_url = get_url(path="")%}
|
||||||
|
{% set body = body | markdown | replace(from='target="_blank" href="' ~ base_url , to='href="' ~ base_url) | safe %}
|
||||||
|
|
||||||
|
<!-- Splits body to columns -->
|
||||||
{% set columns = body | safe | markdown | split(pat="|||") %}
|
{% set columns = body | safe | markdown | split(pat="|||") %}
|
||||||
{% set row_class = "relative pt-6 p-4 flex flex-col sm:grid sm:grid-cols-2 sm:gap-10 xl:flex xl:flex-row"%}
|
{% set row_class = "relative pt-6 p-4 flex flex-col sm:grid sm:grid-cols-2 sm:gap-10 xl:flex xl:flex-row"%}
|
||||||
|
|
||||||
@@ -109,9 +113,11 @@ Parameters:
|
|||||||
{% set row_class = row_class ~ "w-screen -mx-8 sm:-mx-12 md:-mx-16 lg:-mx-20" %}
|
{% set row_class = row_class ~ "w-screen -mx-8 sm:-mx-12 md:-mx-16 lg:-mx-20" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% set url = body | split(pat="href=") | slice(start=1) | first | split(pat=">") | first | trim_start_matches(pat='"') %}
|
||||||
|
|
||||||
<div class="{{row_class}}" style="{{styles}}" id="{{row_id}}">
|
<div class="{{row_class}}" style="{{styles}}" id="{{row_id}}">
|
||||||
|
|
||||||
{% for column in columns%}
|
{% for column in columns %}
|
||||||
|
|
||||||
<!-- Hides empty columns if displayed vertically in small screen -->
|
<!-- Hides empty columns if displayed vertically in small screen -->
|
||||||
{% if column | as_str | length < 10 %}
|
{% if column | as_str | length < 10 %}
|
||||||
|
|||||||
Reference in New Issue
Block a user