-
-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(template): better output with liquid v4 whitespace control
- Loading branch information
Showing
33 changed files
with
358 additions
and
358 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{% comment %} | ||
This file is deprecated since v1.1.6, please include `amsf/core` instead | ||
{% endcomment %} | ||
{% include amsf/core %} | ||
{%- include amsf/core -%} |
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{% comment %} | ||
{%- comment -%} | ||
Page/post author meta | ||
{% endcomment %} | ||
{% include amsf/type type=include.type %} | ||
{% if type.author %} | ||
{% assign author = site.data.authors[type.author] %} | ||
{% else %} | ||
{% assign author = site.data.authors["default"] %} | ||
{% endif %} | ||
{%- endcomment -%} | ||
{%- include amsf/type type=include.type -%} | ||
{%- if type.author -%} | ||
{%- assign author = site.data.authors[type.author] -%} | ||
{%- else -%} | ||
{%- assign author = site.data.authors["default"] -%} | ||
{%- endif -%} |
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 |
---|---|---|
@@ -1,20 +1,20 @@ | ||
{% comment %} | ||
Almace Scaffolding core helpers | ||
{% endcomment %} | ||
{% include amsf/type type=include.type %} | ||
{% include amsf/author %} | ||
{% include amsf/hostname %} | ||
{% include amsf/title %} | ||
{% include amsf/desc %} | ||
{% include amsf/urls %} | ||
{% include amsf/dates %} | ||
{% include amsf/lang %} | ||
{% include amsf/css %} | ||
{% include amsf/open_graph %} | ||
{% include amsf/theme_color %} | ||
{% include amsf/favicons %} | ||
{% include amsf/word_counter %} | ||
{% include amsf/thumbnail %} | ||
{% include amsf/heading %} | ||
{% include amsf/service_worker %} | ||
{% include amsf/google_analytics %} | ||
{%- include amsf/type type=include.type -%} | ||
{%- include amsf/author -%} | ||
{%- include amsf/hostname -%} | ||
{%- include amsf/title -%} | ||
{%- include amsf/desc -%} | ||
{%- include amsf/urls -%} | ||
{%- include amsf/dates -%} | ||
{%- include amsf/lang -%} | ||
{%- include amsf/css -%} | ||
{%- include amsf/open_graph -%} | ||
{%- include amsf/theme_color -%} | ||
{%- include amsf/favicons -%} | ||
{%- include amsf/word_counter -%} | ||
{%- include amsf/thumbnail -%} | ||
{%- include amsf/heading -%} | ||
{%- include amsf/service_worker -%} | ||
{%- include amsf/google_analytics -%} |
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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
{% comment %} | ||
{%- comment -%} | ||
Page custom CSS | ||
{% endcomment %} | ||
{% capture amsf_page_css %} | ||
{% if page.css %} | ||
{%- endcomment -%} | ||
{%- capture amsf_page_css -%} | ||
{%- if page.css -%} | ||
<style> | ||
{{ page.css }} | ||
</style> | ||
{% endif %} | ||
{% endcapture %} | ||
{%- endif -%} | ||
{%- endcapture -%} |
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 |
---|---|---|
@@ -1,20 +1,20 @@ | ||
{% include amsf/type type=include.type %} | ||
{%- include amsf/type type=include.type -%} | ||
|
||
{% comment %} | ||
{%- comment -%} | ||
Page publish date | ||
{% endcomment %} | ||
{% capture amsf_page_pubdate %}{{ type.date }}{% endcapture %} | ||
{%- endcomment -%} | ||
{%- capture amsf_page_pubdate %}{{ type.date }}{% endcapture -%} | ||
|
||
{% comment %} | ||
{%- comment -%} | ||
Page update date | ||
{% endcomment %} | ||
{% capture amsf_page_update %} | ||
{% assign date_publish = type.date | date: "%b %-d, %Y" %} | ||
{% assign date_update = type.last_modified_at | date: "%b %-d, %Y" %} | ||
{%- endcomment -%} | ||
{%- capture amsf_page_update -%} | ||
{%- assign date_publish = type.date | date: "%b %-d, %Y" -%} | ||
{%- assign date_update = type.last_modified_at | date: "%b %-d, %Y" -%} | ||
|
||
{% if date_publish != date_update %} | ||
{%- if date_publish != date_update -%} | ||
{{ type.last_modified_at }} | ||
{% else %} | ||
{%- else -%} | ||
{{ type.date }} | ||
{% endif %} | ||
{% endcapture %} | ||
{%- endif -%} | ||
{%- endcapture -%} |
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 |
---|---|---|
@@ -1,31 +1,31 @@ | ||
{% comment %} | ||
{%- comment -%} | ||
Favicons | ||
|
||
Check `static_file` and output favicon markup | ||
|
||
@since 1.1.0 | ||
{% endcomment %} | ||
{% capture amsf_favicon_png %}{{ "/favicon.png" | relative_url }}{% endcapture %} | ||
{% capture amsf_favicon_svg %}{{ "/favicon.svg?assets-inline-assets-keep" | relative_url }}{% endcapture %} | ||
{% capture amsf_mask_icon %}{{ "/mask-icon.svg" | relative_url }}{% endcapture %} | ||
{% capture amsf_apple_touch_icon %}{{ "/apple-touch-icon.png" | relative_url }}{% endcapture %} | ||
{%- endcomment -%} | ||
{%- capture amsf_favicon_png %}{{ "/favicon.png" | relative_url }}{% endcapture -%} | ||
{%- capture amsf_favicon_svg %}{{ "/favicon.svg?assets-inline-assets-keep" | relative_url }}{% endcapture -%} | ||
{%- capture amsf_mask_icon %}{{ "/mask-icon.svg" | relative_url }}{% endcapture -%} | ||
{%- capture amsf_apple_touch_icon %}{{ "/apple-touch-icon.png" | relative_url }}{% endcapture -%} | ||
|
||
{% capture amsf_favicons %} | ||
{% for static_file in site.static_files %} | ||
{% if static_file.path == "/favicon.png" %} | ||
{%- capture amsf_favicons -%} | ||
{%- for static_file in site.static_files -%} | ||
{%- if static_file.path == "/favicon.png" -%} | ||
<link rel="icon" href="{{ amsf_favicon_png }}" type="image/png"> | ||
{% endif %} | ||
{%- endif -%} | ||
|
||
{% if static_file.path == "/favicon.svg" %} | ||
{%- if static_file.path == "/favicon.svg" -%} | ||
<link rel="icon" href="{{ amsf_favicon_svg }}" sizes="any" type="image/svg+xml"> | ||
{% endif %} | ||
{%- endif -%} | ||
|
||
{% if static_file.path == "/mask-icon.svg" %} | ||
{%- if static_file.path == "/mask-icon.svg" -%} | ||
<link rel="mask-icon" href="{{ amsf_mask_icon }}" color="{{ amsf_page_theme_color_with_fallback | strip }}"> | ||
{% endif %} | ||
{%- endif -%} | ||
|
||
{% if static_file.path == "/apple-touch-icon.png" %} | ||
{%- if static_file.path == "/apple-touch-icon.png" -%} | ||
<link rel="apple-touch-icon" href="{{ amsf_apple_touch_icon }}"> | ||
{% endif %} | ||
{% endfor %} | ||
{% endcapture %} | ||
{%- endif -%} | ||
{%- endfor -%} | ||
{%- endcapture -%} |
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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
{% comment %} | ||
{%- comment -%} | ||
Google Analytics tracking code | ||
{% endcomment %} | ||
{% capture amsf_google_analytics %} | ||
{% if site.google_analytics.enabled %} | ||
{%- endcomment -%} | ||
{%- capture amsf_google_analytics -%} | ||
{%- if site.google_analytics.enabled -%} | ||
<script async src="{{ site.google_analytics.url }}?id={{ site.google_analytics.id }}"></script> | ||
<script> | ||
window.dataLayer = window.dataLayer || []; | ||
function gtag(){dataLayer.push(arguments);} | ||
gtag('js', new Date()); | ||
gtag('config', '{{ site.google_analytics.id }}'); | ||
</script> | ||
{% endif %} | ||
{% endcapture %} | ||
{%- endif -%} | ||
{%- endcapture -%} |
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
{% comment %} | ||
{%- comment -%} | ||
Has Protocol | ||
|
||
Check if given string has protocol (aka. external link) | ||
|
||
{% include amsf/has_protocol url=my_url %} | ||
{%- include amsf/has_protocol url=my_url -%} | ||
{{ amsf_has_protocol }} | ||
|
||
@since 1.1.6 | ||
{% endcomment %} | ||
{% assign url = include.url | default: '' %} | ||
{% assign amsf_has_protocol = url | match_regex: '^((?:https?:)?\/\/)' %} | ||
{%- endcomment -%} | ||
{%- assign url = include.url | default: '' -%} | ||
{%- assign amsf_has_protocol = url | match_regex: '^((?:https?:)?\/\/)' -%} |
Oops, something went wrong.