Skip to content

Commit 2ed934c

Browse files
authored
[764] fix/Link to prod should not contain http://www. (#218)
1 parent e29679a commit 2ed934c

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

  • website/modules/case-studies-page/views

website/modules/case-studies-page/views/show.html

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,18 +168,23 @@ <h2 class="portfolio-title">{{ data.piece.portfolioTitle }}</h2>
168168
<div class="links-area">
169169
{% if data.piece.fullStoryUrl %}
170170
<a
171-
href="{{ data.piece.fullStoryUrl }}"
172-
target="_blank"
173-
rel="noopener noreferrer"
174-
class="full-story_btn"
175-
>Read The Full Story</a
171+
href="{{ data.piece.fullStoryUrl }}"
172+
target="_blank"
173+
rel="noopener noreferrer"
174+
class="full-story_btn"
175+
>Read The Full Story</a
176176
>
177177
{% endif %} {% if data.piece.prodLink %}
178+
{# Remove path/query/fragment #}
179+
{% set urlWithoutProtocol = data.piece.prodLink | replace('https://', '') | replace('http://', '') %}
180+
{% set domainWithOrWithoutWww = urlWithoutProtocol.split('/')[0] %}
181+
{% set cleanDomain = domainWithOrWithoutWww | trim | replace('www.', '') %}
178182
<a
179183
href="{{ data.piece.prodLink }}"
180184
target="_blank"
181185
class="prod-link"
182-
>{{ data.piece.prodLink }}</a
186+
rel="noopener noreferrer"
187+
>{{ cleanDomain }}</a
183188
>
184189
{% endif %}
185190
</div>

0 commit comments

Comments
 (0)