diff --git a/_app/_includes/_amsf.html b/_app/_includes/_amsf.html index 5c0430fa8..a12f4c33e 100644 --- a/_app/_includes/_amsf.html +++ b/_app/_includes/_amsf.html @@ -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 -%} diff --git a/_app/_includes/amsf/author b/_app/_includes/amsf/author index 32bbb950c..e3f959998 100644 --- a/_app/_includes/amsf/author +++ b/_app/_includes/amsf/author @@ -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 -%} diff --git a/_app/_includes/amsf/core b/_app/_includes/amsf/core index a19efcd65..0ee6a60d4 100644 --- a/_app/_includes/amsf/core +++ b/_app/_includes/amsf/core @@ -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 -%} diff --git a/_app/_includes/amsf/css b/_app/_includes/amsf/css index 05d7804c3..2024ebc82 100644 --- a/_app/_includes/amsf/css +++ b/_app/_includes/amsf/css @@ -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 -%} - {% endif %} -{% endcapture %} + {%- endif -%} +{%- endcapture -%} diff --git a/_app/_includes/amsf/dates b/_app/_includes/amsf/dates index 5a57cac02..3582a5b89 100644 --- a/_app/_includes/amsf/dates +++ b/_app/_includes/amsf/dates @@ -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 -%} diff --git a/_app/_includes/amsf/desc b/_app/_includes/amsf/desc index 083ceeca7..1a87f0e8a 100644 --- a/_app/_includes/amsf/desc +++ b/_app/_includes/amsf/desc @@ -1,6 +1,6 @@ -{% comment %} +{%- comment -%} Site description -{% endcomment %} +{%- endcomment -%} {%- capture amsf_site_desc -%} {%- if page.permalink != '/' -%} {%- if page.desc -%} diff --git a/_app/_includes/amsf/favicons b/_app/_includes/amsf/favicons index 71af7bfe1..4068a370b 100644 --- a/_app/_includes/amsf/favicons +++ b/_app/_includes/amsf/favicons @@ -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" -%} - {% endif %} + {%- endif -%} - {% if static_file.path == "/favicon.svg" %} + {%- if static_file.path == "/favicon.svg" -%} - {% endif %} + {%- endif -%} - {% if static_file.path == "/mask-icon.svg" %} + {%- if static_file.path == "/mask-icon.svg" -%} - {% endif %} + {%- endif -%} - {% if static_file.path == "/apple-touch-icon.png" %} + {%- if static_file.path == "/apple-touch-icon.png" -%} - {% endif %} - {% endfor %} -{% endcapture %} + {%- endif -%} + {%- endfor -%} +{%- endcapture -%} diff --git a/_app/_includes/amsf/google_analytics b/_app/_includes/amsf/google_analytics index edd2d895f..99628c813 100644 --- a/_app/_includes/amsf/google_analytics +++ b/_app/_includes/amsf/google_analytics @@ -1,8 +1,8 @@ -{% 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 -%} - {% endif %} -{% endcapture %} + {%- endif -%} +{%- endcapture -%} diff --git a/_app/_includes/amsf/has_protocol b/_app/_includes/amsf/has_protocol index fefa84ae9..075e84cb5 100644 --- a/_app/_includes/amsf/has_protocol +++ b/_app/_includes/amsf/has_protocol @@ -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?:)?\/\/)' -%} diff --git a/_app/_includes/amsf/heading b/_app/_includes/amsf/heading index b1ca29b2e..2584242fc 100644 --- a/_app/_includes/amsf/heading +++ b/_app/_includes/amsf/heading @@ -1,139 +1,139 @@ -{% comment %} +{%- comment -%} Heading image Check front-matter fileds and generate custom heading image styles @since 1.1.0 -{% endcomment %} -{% capture amsf_page_heading_img %} - {% include amsf/has_protocol url=page.heading-img %} - {% if amsf_has_protocol == null %} - {% if page.heading-img-local %} +{%- endcomment -%} +{%- capture amsf_page_heading_img -%} + {%- include amsf/has_protocol url=page.heading-img -%} + {%- if amsf_has_protocol == null -%} + {%- if page.heading-img-local -%} - {% else %} + {%- else -%} - {% endif %} - {% else %} + {%- endif -%} + {%- else -%} - {% endif %} -{% endcapture %} + {%- endif -%} +{%- endcapture -%} -{% capture amsf_page_heading_text %} - {% if page.heading-img %} +{%- capture amsf_page_heading_text -%} + {%- if page.heading-img -%} {{ amsf_page_title }} {{ amsf_page_heading_img }} - {% else %} + {%- else -%} {{ amsf_page_title }} - {% endif %} -{% endcapture %} + {%- endif -%} +{%- endcapture -%} -{% capture amsf_page_heading_class %} - {% if page.heading-img %} +{%- capture amsf_page_heading_class -%} + {%- if page.heading-img -%} image-title - {% endif %} -{% endcapture %} + {%- endif -%} +{%- endcapture -%} -{% capture amsf_page_heading_external %} - {% if page.link %} +{%- capture amsf_page_heading_external -%} + {%- if page.link -%} class=external - {% endif %} -{% endcapture %} + {%- endif -%} +{%- endcapture -%} -{% capture amsf_page_heading %} - {% if page.link %} +{%- capture amsf_page_heading -%} + {%- if page.link -%} {{ amsf_page_heading_text }} - {% else %} + {%- else -%} {{ amsf_page_heading_text }} - {% endif %} -{% endcapture %} + {%- endif -%} +{%- endcapture -%} -{% comment %} +{%- comment -%} Heading background Check front-matter fileds and generate custom heading background styles @since 1.1.0 -{% endcomment %} -{% capture amsf_page_heading_bg_image %} - {% if page.heading-bg %} - {% include amsf/has_protocol url=page.heading-bg %} - {% if amsf_has_protocol == null %} - {% if page.heading-bg-local %} +{%- endcomment -%} +{%- capture amsf_page_heading_bg_image -%} + {%- if page.heading-bg -%} + {%- include amsf/has_protocol url=page.heading-bg -%} + {%- if amsf_has_protocol == null -%} + {%- if page.heading-bg-local -%} background-image: url('{{ amsf_user_assets }}/{{ page.heading-bg }}'); - {% else %} + {%- else -%} background-image: url('{{ site.file }}/{{ page.heading-bg }}'); - {% endif %} - {% else %} + {%- endif -%} + {%- else -%} background-image: url('{{ page.heading-bg }}'); - {% endif %} - {% endif %} -{% endcapture %} + {%- endif -%} + {%- endif -%} +{%- endcapture -%} -{% capture amsf_page_heading_bg_color %} - {% if page.heading-bg-color %} +{%- capture amsf_page_heading_bg_color -%} + {%- if page.heading-bg-color -%} background-color: {{ page.heading-bg-color }}; - {% endif %} -{% endcapture %} + {%- endif -%} +{%- endcapture -%} -{% capture amsf_page_heading_bg_size %} - {% if page.heading-bg %} - {% if page.heading-bg-size %} +{%- capture amsf_page_heading_bg_size -%} + {%- if page.heading-bg -%} + {%- if page.heading-bg-size -%} background-size: {{ page.heading-bg-size }}; - {% else %} + {%- else -%} background-size: cover; - {% endif %} - {% endif %} -{% endcapture %} + {%- endif -%} + {%- endif -%} +{%- endcapture -%} -{% capture amsf_page_heading_bg_position %} - {% if page.heading-bg %} - {% if page.heading-bg-position %} +{%- capture amsf_page_heading_bg_position -%} + {%- if page.heading-bg -%} + {%- if page.heading-bg-position -%} background-position: {{ page.heading-bg-position }}; - {% else %} + {%- else -%} background-position: center center; - {% endif %} - {% endif %} -{% endcapture %} + {%- endif -%} + {%- endif -%} +{%- endcapture -%} -{% capture amsf_page_heading_bg_repeat %} - {% if page.heading-bg %} - {% if page.heading-bg-position %} +{%- capture amsf_page_heading_bg_repeat -%} + {%- if page.heading-bg -%} + {%- if page.heading-bg-position -%} background-repeat: {{ page.heading-bg-repeat }}; - {% else %} + {%- else -%} background-repeat: no-repeat; - {% endif %} - {% endif %} -{% endcapture %} + {%- endif -%} + {%- endif -%} +{%- endcapture -%} -{% capture amsf_page_heading_bg_text %} - {% if page.heading-bg-text %} +{%- capture amsf_page_heading_bg_text -%} + {%- if page.heading-bg-text -%} color: {{ page.heading-bg-text }}; - {% endif %} -{% endcapture %} + {%- endif -%} +{%- endcapture -%} -{% capture amsf_page_heading_bg %} +{%- capture amsf_page_heading_bg -%} style="{{ amsf_page_heading_bg_image | strip }} {{ amsf_page_heading_bg_color | strip }} {{ amsf_page_heading_bg_size | strip }} {{ amsf_page_heading_bg_position | strip }} {{ amsf_page_heading_bg_repeat | strip }} {{ amsf_page_heading_bg_text | strip }}" -{% endcapture %} +{%- endcapture -%} diff --git a/_app/_includes/amsf/hostname b/_app/_includes/amsf/hostname index 19c542292..28bdc0297 100644 --- a/_app/_includes/amsf/hostname +++ b/_app/_includes/amsf/hostname @@ -1,8 +1,8 @@ -{% comment %} +{%- comment -%} Site domain Get current site domain name defined by `site.url` Regex: - Match domain hostname (without port): https://regex101.com/r/VkNQ7Q/1 -{% endcomment %} -{% assign amsf_hostname = site.url | match_regex: '^(?:https?\:)?\/\/([^\/?#:]+)(?:[\/?#:]|$)' %} +{%- endcomment -%} +{%- assign amsf_hostname = site.url | match_regex: '^(?:https?\:)?\/\/([^\/?#:]+)(?:[\/?#:]|$)' -%} diff --git a/_app/_includes/amsf/lang b/_app/_includes/amsf/lang index 83fab4dc2..96abd4b42 100644 --- a/_app/_includes/amsf/lang +++ b/_app/_includes/amsf/lang @@ -1,12 +1,12 @@ -{% comment %} +{%- comment -%} Page language tag -{% endcomment %} -{% capture amsf_page_lang %} - {% if page.languages %} - {% if page.languages[0] != null %} +{%- endcomment -%} +{%- capture amsf_page_lang -%} + {%- if page.languages -%} + {%- if page.languages[0] != null -%} lang="{{ page.languages | first }}" - {% else %} + {%- else -%} lang="{{ page.languages }}" - {% endif %} - {% endif %} -{% endcapture %} + {%- endif -%} + {%- endif -%} +{%- endcapture -%} diff --git a/_app/_includes/amsf/open_graph b/_app/_includes/amsf/open_graph index f54e65f1e..f4b79bbac 100644 --- a/_app/_includes/amsf/open_graph +++ b/_app/_includes/amsf/open_graph @@ -1,21 +1,21 @@ -{% comment %} +{%- comment -%} Page type (used by Open Graph) -{% endcomment %} -{% capture amsf_page_type %} - {% if page.permalink == '/' %} +{%- endcomment -%} +{%- capture amsf_page_type -%} + {%- if page.permalink == '/' -%} website - {% else %} + {%- else -%} article - {% endif %} -{% endcapture %} + {%- endif -%} +{%- endcapture -%} -{% comment %} +{%- comment -%} Page type (used by Twitter Cards) -{% endcomment %} -{% capture amsf_page_type_twitter %} - {% if site.tc_large_image or page.tc_large_image %} +{%- endcomment -%} +{%- capture amsf_page_type_twitter -%} + {%- if site.tc_large_image or page.tc_large_image -%} summary_large_image - {% else %} + {%- else -%} summary - {% endif %} -{% endcapture %} + {%- endif -%} +{%- endcapture -%} diff --git a/_app/_includes/amsf/relative_url b/_app/_includes/amsf/relative_url index 255aa3f31..2e4b4049b 100644 --- a/_app/_includes/amsf/relative_url +++ b/_app/_includes/amsf/relative_url @@ -1,20 +1,20 @@ -{% comment %} +{%- comment -%} Relative URL Make given link relative to current site base (except external links with protocol) - {% include amsf/relative_url url=my_url %} + {%- include amsf/relative_url url=my_url -%} {{ amsf_relative_url }} @since 1.1.6 -{% endcomment %} -{% assign url = include.url | default: '' %} -{% include amsf/has_protocol url=url %} +{%- endcomment -%} +{%- assign url = include.url | default: '' -%} +{%- include amsf/has_protocol url=url -%} -{% capture amsf_relative_url %} - {% if amsf_has_protocol == null %} +{%- capture amsf_relative_url -%} + {%- if amsf_has_protocol == null -%} {{ url | relative_url }} - {% else %} + {%- else -%} {{ url }} - {% endif %} -{% endcapture %} + {%- endif -%} +{%- endcapture -%} diff --git a/_app/_includes/amsf/service_worker b/_app/_includes/amsf/service_worker index 4d927df41..e17405d2d 100644 --- a/_app/_includes/amsf/service_worker +++ b/_app/_includes/amsf/service_worker @@ -1,8 +1,8 @@ -{% comment %} +{%- comment -%} Service Worker -{% endcomment %} -{% capture amsf_service_worker %} - {% if site.service_worker.enabled == true and site.dev == false %} +{%- endcomment -%} +{%- capture amsf_service_worker -%} + {%- if site.service_worker.enabled == true and site.dev == false -%} - {% endif %} -{% endcapture %} + {%- endif -%} +{%- endcapture -%} diff --git a/_app/_includes/amsf/theme_color b/_app/_includes/amsf/theme_color index fecc6419b..c94ec2a71 100644 --- a/_app/_includes/amsf/theme_color +++ b/_app/_includes/amsf/theme_color @@ -1,4 +1,4 @@ -{% comment %} +{%- comment -%} Page theme color Generate page/post theme color based on current config, can used by: @@ -7,44 +7,44 @@ - Chrome Web App theme color @since 1.1.4 -{% endcomment %} -{% include amsf/type type=include.type %} -{% capture amsf_page_theme_color %} - {% if type.scheme-list-color %} - {% if type.scheme-list-color == 'text' %} +{%- endcomment -%} +{%- include amsf/type type=include.type -%} +{%- capture amsf_page_theme_color -%} + {%- if type.scheme-list-color -%} + {%- if type.scheme-list-color == 'text' -%} {{ type.scheme-text }} - {% elsif type.scheme-list-color == 'hover' %} + {%- elsif type.scheme-list-color == 'hover' -%} {{ type.scheme-hover }} - {% elsif type.scheme-list-color == 'code' %} + {%- elsif type.scheme-list-color == 'code' -%} {{ type.scheme-code }} - {% elsif type.scheme-list-color == 'bg' %} + {%- elsif type.scheme-list-color == 'bg' -%} {{ type.scheme-bg }} - {% else %} + {%- else -%} {{ type.scheme-link }} - {% endif %} - {% elsif type.scheme-bg %} - {% if type.scheme-bg-light %} + {%- endif -%} + {%- elsif type.scheme-bg -%} + {%- if type.scheme-bg-light -%} {{ type.scheme-link }} - {% else %} + {%- else -%} {{ type.scheme-bg }} - {% endif %} - {% elsif type.scheme-link %} + {%- endif -%} + {%- elsif type.scheme-link -%} {{ type.scheme-link }} - {% endif %} -{% endcapture %} + {%- endif -%} +{%- endcapture -%} -{% capture amsf_page_theme_color_with_fallback %} - {% assign amsf_page_theme_color = amsf_page_theme_color | strip %} - {% if amsf_page_theme_color != "" %} +{%- capture amsf_page_theme_color_with_fallback -%} + {%- assign amsf_page_theme_color = amsf_page_theme_color | strip -%} + {%- if amsf_page_theme_color != "" -%} {{ amsf_page_theme_color }} - {% else %} + {%- else -%} {{ site.colors.theme }} - {% endif %} -{% endcapture %} + {%- endif -%} +{%- endcapture -%} -{% comment %} +{%- comment -%} Chrome Web App theme color -{% endcomment %} -{% capture amsf_theme_color %} +{%- endcomment -%} +{%- capture amsf_theme_color -%} {{ amsf_page_theme_color_with_fallback }} -{% endcapture %} +{%- endcapture -%} diff --git a/_app/_includes/amsf/thumbnail b/_app/_includes/amsf/thumbnail index 6402ae2ce..0a28346e3 100644 --- a/_app/_includes/amsf/thumbnail +++ b/_app/_includes/amsf/thumbnail @@ -1,4 +1,4 @@ -{% comment %} +{%- comment -%} Thumbnails Generate page thumbnail for Open Graph and Twitter Cards @@ -7,50 +7,50 @@ - Match filename protocol: https://regex101.com/r/AmwvYE/2 @since 1.1.0 -{% endcomment %} -{% assign amsf_site_logo = "/logo.png" | absolute_url %} -{% capture amsf_page_first_image %} - {% assign hero_image = page.content | match_regex: '= 60 %} + {%- elsif amsf_page_reading_time_raw >= 60 -%} - {% assign amsf_page_reading_time_hr = amsf_page_reading_time_raw | divided_by: 60 %} - {% assign amsf_page_reading_time_min = amsf_page_reading_time_raw | modulo: 60 %} + {%- assign amsf_page_reading_time_hr = amsf_page_reading_time_raw | divided_by: 60 -%} + {%- assign amsf_page_reading_time_min = amsf_page_reading_time_raw | modulo: 60 -%} - {% capture amsf_page_reading_time_hr_unit %} - {% if amsf_page_reading_time_hr == 1 %} + {%- capture amsf_page_reading_time_hr_unit -%} + {%- if amsf_page_reading_time_hr == 1 -%} hr - {% else %} + {%- else -%} hrs - {% endif %} - {% endcapture %} + {%- endif -%} + {%- endcapture -%} - {% capture amsf_page_reading_time_min_unit %} - {% if amsf_page_reading_time_min > 1 %} + {%- capture amsf_page_reading_time_min_unit -%} + {%- if amsf_page_reading_time_min > 1 -%} mins - {% elsif amsf_page_reading_time_min == 1 %} + {%- elsif amsf_page_reading_time_min == 1 -%} min - {% endif %} - {% endcapture %} + {%- endif -%} + {%- endcapture -%} - {% capture amsf_page_reading_time_min_figure %} - {% if amsf_page_reading_time_min != 0 %} + {%- capture amsf_page_reading_time_min_figure -%} + {%- if amsf_page_reading_time_min != 0 -%} {{ amsf_page_reading_time_min }} - {% endif %} - {% endcapture %} + {%- endif -%} + {%- endcapture -%} {{ amsf_page_reading_time_hr }} {{ amsf_page_reading_time_hr_unit | strip }} {{ amsf_page_reading_time_min_figure | strip }} {{ amsf_page_reading_time_min_unit | strip }} - {% else %} + {%- else -%} {{ amsf_page_reading_time_raw }} mins - {% endif %} -{% endcapture %} + {%- endif -%} +{%- endcapture -%} diff --git a/_app/_includes/themes/curtana/includes/header.html b/_app/_includes/themes/curtana/includes/header.html index 353776050..0e4674b6d 100644 --- a/_app/_includes/themes/curtana/includes/header.html +++ b/_app/_includes/themes/curtana/includes/header.html @@ -2,7 +2,7 @@