Improve URL handling for internally and externally linked pages
This commit is contained in:
parent
e2f06fbfc0
commit
84e85c0f14
2 changed files with 15 additions and 2 deletions
|
@ -9,6 +9,13 @@
|
|||
<div class="feature__wrapper">
|
||||
|
||||
{% for f in feature_row %}
|
||||
|
||||
{% if f.url contains "http" %}
|
||||
{% capture f_url %}{{ f.url }}{% endcapture %}
|
||||
{% else %}
|
||||
{% capture f_url %}{{ f.url | prepend: base_path }}{% endcapture %}
|
||||
{% endif %}
|
||||
|
||||
<div class="feature__item{% if include.type %}--{{ include.type }}{% endif %}">
|
||||
<div class="archive__item">
|
||||
{% if f.image_path %}
|
||||
|
@ -35,7 +42,7 @@
|
|||
{% endif %}
|
||||
|
||||
{% if f.url %}
|
||||
<p><a href="{{ f.url }}" class="btn {{ f.btn_class }}">{{ f.btn_label | default: site.data.ui-text[site.locale].more_label }}</a></p>
|
||||
<p><a href="{{ f_url }}" class="btn {{ f.btn_class }}">{{ f.btn_label | default: site.data.ui-text[site.locale].more_label }}</a></p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -4,6 +4,12 @@
|
|||
{% capture img_path %}{{ page.header.image | prepend: "/images/" | prepend: base_path }}{% endcapture %}
|
||||
{% endif %}
|
||||
|
||||
{% if page.header.cta_url contains "http" %}
|
||||
{% capture cta_path %}{{ page.header.cta_url }}{% endcapture %}
|
||||
{% else %}
|
||||
{% capture cta_path %}{{ page.header.cta_url | prepend: base_path }}{% endcapture %}
|
||||
{% endif %}
|
||||
|
||||
{% if page.header.overlay_image contains "http" %}
|
||||
{% capture overlay_img_path %}{{ page.header.overlay_image }}{% endcapture %}
|
||||
{% elsif page.header.overlay_image %}
|
||||
|
@ -29,7 +35,7 @@
|
|||
<p class="page__meta"><i class="fa fa-clock-o" aria-hidden="true"></i> {% include read-time.html %}</p>
|
||||
{% endif %}
|
||||
{% if page.header.cta_url %}
|
||||
<p><a href="{{ page.header.cta_url }}" class="btn btn--light-outline btn--large">{{ page.header.cta_label | default: site.data.ui-text[site.locale].more_label }}</a></p>
|
||||
<p><a href="{{ cta_path }}" class="btn btn--light-outline btn--large">{{ page.header.cta_label | default: site.data.ui-text[site.locale].more_label }}</a></p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
|
|
Loading…
Reference in a new issue