-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code to use a colored header on the product pages
I'm not sure I like it. For now, leave it there but disabled. At some point, maybe give people a screenshot and ask if they like it better than the "default" presentation.
- Loading branch information
Showing
2 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{% comment %} | ||
CHANGES FROM DEFAULT PAGE__HERO.HTML | ||
* change page.title --> page.name | ||
* change page.excerpt -- > page.description | ||
{% endcomment %} | ||
{% capture overlay_img_path %}{{ page.header.overlay_image | relative_url }}{% endcapture %} | ||
|
||
{% if page.header.overlay_filter contains "gradient" %} | ||
{% capture overlay_filter %}{{ page.header.overlay_filter }}{% endcapture %} | ||
{% elsif page.header.overlay_filter contains "rgba" %} | ||
{% capture overlay_filter %}{{ page.header.overlay_filter }}{% endcapture %} | ||
{% capture overlay_filter %}linear-gradient({{ overlay_filter }}, {{ overlay_filter }}){% endcapture %} | ||
{% elsif page.header.overlay_filter %} | ||
{% capture overlay_filter %}rgba(0, 0, 0, {{ page.header.overlay_filter }}){% endcapture %} | ||
{% capture overlay_filter %}linear-gradient({{ overlay_filter }}, {{ overlay_filter }}){% endcapture %} | ||
{% endif %} | ||
|
||
{% if page.header.image_description %} | ||
{% assign image_description = page.header.image_description %} | ||
{% else %} | ||
{% assign image_description = page.name %} | ||
{% endif %} | ||
|
||
{% assign image_description = image_description | markdownify | strip_html | strip_newlines | escape_once %} | ||
|
||
<div class="page__hero{% if page.header.overlay_color or page.header.overlay_image %}--overlay{% endif %}" | ||
style="{% if page.header.overlay_color %}background-color: {{ page.header.overlay_color | default: 'transparent' }};{% endif %} {% if overlay_img_path %}background-image: {% if overlay_filter %}{{ overlay_filter }}, {% endif %}url('{{ overlay_img_path }}');{% endif %}" | ||
> | ||
{% if page.header.overlay_color or page.header.overlay_image %} | ||
<div class="wrapper"> | ||
<h1 id="page-title" class="page__title" itemprop="headline"> | ||
{% if paginator and site.paginate_show_page_num %} | ||
{{ site.title }}{% unless paginator.page == 1 %} {{ site.data.ui-text[site.locale].page | default: "Page" }} {{ paginator.page }}{% endunless %} | ||
{% else %} | ||
{{ page.name | default: site.title | markdownify | remove: "<p>" | remove: "</p>" }} | ||
{% endif %} | ||
</h1> | ||
{% if page.tagline %} | ||
<p class="page__lead">{{ page.tagline | markdownify | remove: "<p>" | remove: "</p>" }}</p> | ||
{% elsif page.description %} | ||
<p class="page__lead">{{ page.description | markdownify | remove: "<p>" | remove: "</p>" }}</p> | ||
{% endif %} | ||
{% include page__meta.html %} | ||
{% if page.header.actions %} | ||
<p> | ||
{% for action in page.header.actions %} | ||
<a href="{{ action.url | relative_url }}" class="btn btn--light-outline btn--large">{{ action.label | default: site.data.ui-text[site.locale].more_label | default: "Learn More" }}</a> | ||
{% endfor %} | ||
</p> | ||
{% endif %} | ||
</div> | ||
{% else %} | ||
<img src="{{ page.header.image | relative_url }}" alt="{{ image_description }}" class="page__hero-image"> | ||
{% endif %} | ||
{% if page.header.caption %} | ||
<span class="page__hero-caption">{{ page.header.caption | markdownify | remove: "<p>" | remove: "</p>" }}</span> | ||
{% endif %} | ||
</div> |