Skip to content

Commit

Permalink
Include template settings
Browse files Browse the repository at this point in the history
  • Loading branch information
PeeterPaal committed Mar 8, 2022
1 parent 6e73ecc commit fbf638a
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 17 deletions.
2 changes: 1 addition & 1 deletion components/html-head.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{% if site.data.touch_icon %}<link rel="apple-touch-icon" href="{{ site.data.touch_icon }}">{% endif %}

{% comment %}STYLESHEETS{% endcomment %}
{% stylesheet_link "main.min.css?v=barcelona-2.4.1" %}
<link href="{{ stylesheets_path }}/main.min.css?v={{ template_settings.version }}" media="screen" rel="stylesheet" type="text/css"/>
{% if editmode %}<link rel="stylesheet" href="{{ site.static_asset_host }}/libs/edicy-tools/latest/edicy-tools.css">{% endif %}

{% comment %}Google fonts for Design Editor{% endcomment %}
Expand Down
4 changes: 2 additions & 2 deletions components/javascripts.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<script src="https://cdn.jsdelivr.net/npm/intersection-observer@0.11.0/intersection-observer.js" integrity="sha256-LkCt8+MalJg9nIGzDMmSEJzqyssPhY1VCvqaGNBNng8=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vanilla-lazyload/17.1.3/lazyload.min.js" integrity="sha512-V3DZ9ZAJrv8ZYY5Zarlfjusec9J6S8htRT3bJDKTdEgq0g9OhbHQUjK+vsBkE6CH0J5VJtBCzPSXJ0ZCVpjPdQ==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/object-fit-images/3.2.4/ofi.min.js" integrity="sha512-7taFZYSf0eAWyi1UvMzNrBoPVuvLU7KX6h10e4AzyHVnPjzuxeGWbXYX+ED9zXVVq+r9Xox5WqvABACBSCevmg==" crossorigin="anonymous"></script>
<script src="{{ javascripts_path }}/application.min.js?v=barcelona-2.4.1"></script>
<script src="{{ javascripts_path }}/application.min.js?v={{ template_settings.version }}"></script>
{% sitejs_include %}

{%- if editmode -%}
<script src="{{ javascripts_path }}/editmode.min.js?v=barcelona-2.4.1"></script>
<script src="{{ javascripts_path }}/editmode.min.js?v={{ template_settings.version }}"></script>
{%- endif -%}

{% comment %}Site search related javascript components.{% endcomment %}
Expand Down
3 changes: 3 additions & 0 deletions components/template-settings-json.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"version": "barcelona-2.4.1"
}
5 changes: 5 additions & 0 deletions components/template-settings.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{%- capture template_settings_json -%}
{% include 'template-settings-json' %}
{%- endcapture -%}

{%- assign template_settings = template_settings_json | replace: 'PREFIX', 'barcelona' | json_parse -%}
3 changes: 2 additions & 1 deletion layouts/auto_generated_product.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!DOCTYPE html>
{% include "template-variables" %}
{%- include "template-settings" -%}
{%- include "template-variables" -%}
<html class="content-page {% if editmode %}editmode{% else %}public{% endif %}" lang="{{ page.language_code }}">
<head prefix="og: http://ogp.me/ns#">
{% include "edicy-tools-variables" %}
Expand Down
5 changes: 3 additions & 2 deletions layouts/blog___news.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!DOCTYPE html>
{% include "template-variables" %}
{% include "blog-article-variables" %}
{%- include "template-settings" -%}
{%- include "template-variables" -%}
{%- include "blog-article-variables" -%}
<html class="blog-list-page height-calculation {% if editmode %}editmode{% else %}public{% endif %}" lang="{{ page.language_code }}">
<head prefix="og: http://ogp.me/ns#">
{% assign blog_page = true %}
Expand Down
7 changes: 4 additions & 3 deletions layouts/blog_article.tpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<!DOCTYPE html>
{% include "template-variables" %}
{% include "blog-article-variables" %}
{% include "blog-settings-variables" %}
{%- include "template-settings" -%}
{%- include "template-variables" -%}
{%- include "blog-article-variables" -%}
{%- include "blog-settings-variables" -%}
<html class="content-page {% if editmode %}editmode{% else %}public{% endif %}" lang="{{ page.language_code }}">
<head prefix="og: http://ogp.me/ns#">
{% include "edicy-tools-variables" %}
Expand Down
3 changes: 2 additions & 1 deletion layouts/common_page.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!DOCTYPE html>
{% include "template-variables" %}
{%- include "template-settings" -%}
{%- include "template-variables" -%}
<html class="content-page {% if editmode %}editmode{% else %}public{% endif %}" lang="{{ page.language_code }}">
<head prefix="og: http://ogp.me/ns#">
{% include "edicy-tools-variables" %}
Expand Down
3 changes: 2 additions & 1 deletion layouts/feature_page.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!DOCTYPE html>
{% include "template-variables" %}
{%- include "template-settings" -%}
{%- include "template-variables" -%}
<html class="front-page height-calculation {% if editmode %}editmode{% else %}public{% endif %}" lang="{{ page.language_code }}">
<head prefix="og: http://ogp.me/ns#">
{% assign front_page = true %}
Expand Down
5 changes: 3 additions & 2 deletions layouts/front_page.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!DOCTYPE html>
{% include "template-variables" %}
{% include "blog-article-variables" %}
{%- include "template-settings" -%}
{%- include "template-variables" -}
{%- include "blog-article-variables" -%}
<html class="blog-list-page height-calculation {% if editmode %}editmode{% else %}public{% endif %}" lang="{{ page.language_code }}">
<head prefix="og: http://ogp.me/ns#">
{% assign blog_page = true %}
Expand Down
5 changes: 3 additions & 2 deletions layouts/product.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!DOCTYPE html>
{% include "template-variables" %}
{%- include "template-settings" -%}
{%- include "template-variables" -%}
<html class="content-page {% if editmode %}editmode{% else %}public{% endif %}" lang="{{ page.language_code }}">
<head prefix="og: http://ogp.me/ns#">
{% include "edicy-tools-variables" %}
Expand Down Expand Up @@ -72,4 +73,4 @@
{% include "javascripts" %}
{% include "edicy-tools" %}
</body>
</html>
</html>
5 changes: 3 additions & 2 deletions layouts/product_list.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!DOCTYPE html>
{% include "template-variables" %}
{%- include "template-settings" -%}
{%- include "template-variables" -%}
<html class="content-page {% if editmode %}editmode{% else %}public{% endif %}" lang="{{ page.language_code }}">
<head prefix="og: http://ogp.me/ns#">
{% include "edicy-tools-variables" %}
Expand Down Expand Up @@ -40,4 +41,4 @@
{% include "javascripts" %}
{% include "edicy-tools" %}
</body>
</html>
</html>
14 changes: 14 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,20 @@
"layout_name": "template-meta",
"title": "template-meta"
},
{
"content_type": "component",
"component": true,
"file": "components/template-settings-json.tpl",
"layout_name": "template-settings-json",
"title": "template-settings-json"
},
{
"content_type": "component",
"component": true,
"file": "components/template-settings.tpl",
"layout_name": "template-settings",
"title": "template-settings"
},
{
"content_type": "component",
"component": true,
Expand Down

0 comments on commit fbf638a

Please sign in to comment.