editorial-autogestiva-jekyll-theme 0.2.8 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -2
  3. data/_config.yml +73 -0
  4. data/_data/en.yml +129 -27
  5. data/_data/es.yml +111 -31
  6. data/_data/forms/billing_address.yml +71 -0
  7. data/_data/forms/contacto.yml +2 -2
  8. data/_data/forms/shipping_address.yml +76 -0
  9. data/_data/forms/user.yml +11 -0
  10. data/_data/layouts/book.yml +88 -99
  11. data/_data/layouts/cart.yml +198 -0
  12. data/_data/layouts/confirmation.yml +68 -0
  13. data/_data/layouts/editorial.yml +21 -3
  14. data/_data/layouts/menu.yml +65 -0
  15. data/_data/layouts/payment.yml +114 -0
  16. data/_data/layouts/post.yml +6 -7
  17. data/_data/layouts/shipment.yml +126 -0
  18. data/_includes/cart.svg +1 -0
  19. data/_includes/cart_add.html +8 -0
  20. data/_includes/cart_controller.html +10 -0
  21. data/_includes/contact.html +6 -5
  22. data/_includes/content.html +1 -0
  23. data/_includes/country.html +53 -0
  24. data/_includes/editorial.html +24 -30
  25. data/_includes/file.html +35 -0
  26. data/_includes/floating_alert.html +6 -0
  27. data/_includes/footer.html +10 -8
  28. data/_includes/form/boolean.html +1 -1
  29. data/_includes/form/content.html +1 -0
  30. data/_includes/form/email.html +1 -1
  31. data/_includes/form/file.html +1 -0
  32. data/_includes/form/hidden.html +1 -1
  33. data/_includes/form/image.html +1 -0
  34. data/_includes/form/input.html +1 -1
  35. data/_includes/form/markdown_content.html +1 -0
  36. data/_includes/form/number.html +1 -1
  37. data/_includes/form/predefined_array.html +1 -1
  38. data/_includes/form/section.html +1 -1
  39. data/_includes/form/separator.html +1 -1
  40. data/_includes/form/string.html +1 -1
  41. data/_includes/form/submit.html +1 -1
  42. data/_includes/form/tel.html +1 -0
  43. data/_includes/form/text.html +1 -1
  44. data/_includes/form/url.html +1 -1
  45. data/_includes/image.html +32 -0
  46. data/_includes/input.html +14 -2
  47. data/_includes/item.html +38 -0
  48. data/_includes/markdown_content.html +1 -0
  49. data/_includes/menu.html +27 -0
  50. data/_includes/navbar.html +29 -25
  51. data/_includes/notification.html +5 -0
  52. data/_includes/password.html +1 -0
  53. data/_includes/picture.html +23 -0
  54. data/_includes/postal_code.html +45 -0
  55. data/_includes/preload_font.html +1 -0
  56. data/_includes/search.html +25 -0
  57. data/_includes/share.html +22 -0
  58. data/_includes/share_box.html +16 -0
  59. data/_includes/state.html +53 -0
  60. data/_includes/submit.html +1 -1
  61. data/_includes/tel.html +1 -0
  62. data/_layouts/book.html +42 -84
  63. data/_layouts/cart.html +72 -0
  64. data/_layouts/confirmation.html +17 -0
  65. data/_layouts/default.html +30 -10
  66. data/_layouts/home.html +25 -13
  67. data/_layouts/payment.html +21 -0
  68. data/_layouts/post.html +5 -5
  69. data/_layouts/shipment.html +52 -0
  70. data/_sass/accessibility.scss +37 -0
  71. data/_sass/editor.scss +8 -0
  72. data/_sass/embed.scss +5 -0
  73. data/_sass/floating_alert.scss +10 -0
  74. data/_sass/helpers.scss +318 -0
  75. data/_sass/logic.scss +17 -0
  76. data/_sass/menu.scss +20 -0
  77. data/_sass/share.html +12 -0
  78. data/_sass/share_box.html +16 -0
  79. data/_sass/share_box.scss +26 -0
  80. data/_sass/snap.scss +58 -0
  81. data/_sass/toggler.scss +39 -0
  82. data/assets/css/styles.scss +41 -5
  83. data/assets/data/site.json +24 -0
  84. data/assets/fonts/forkawesome-webfont.woff2 +0 -0
  85. data/assets/js/pack.js +16 -0
  86. data/assets/js/pack.js.map +1 -0
  87. data/assets/js/script.js +44 -0
  88. data/assets/templates/alert.html +7 -0
  89. data/assets/templates/cart.html +65 -0
  90. data/assets/templates/payment_methods.html +41 -0
  91. data/assets/templates/recover_order.html +11 -0
  92. data/assets/templates/results.html +17 -0
  93. data/assets/templates/shipping_methods.html +36 -0
  94. metadata +227 -29
  95. data/README.md.orig +0 -118
  96. data/_includes/contact.html.orig +0 -55
  97. data/_includes/navbar.html.orig +0 -44
  98. data/_sass/home.scss +0 -22
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="28.026" height="25.222" viewBox="0 0 7.415 6.673"><path d="M2.86 6.663a.823.823 0 01-.549-.432.82.82 0 01.143-.926.694.694 0 01.552-.238.69.69 0 01.549.237.81.81 0 01.003 1.125.726.726 0 01-.307.204.947.947 0 01-.39.03zm2.77-.008a.826.826 0 01-.525-.42c-.184-.493.065-1.04.54-1.156a.565.565 0 01.304 0 .713.713 0 01.392.222c.211.218.282.479.21.77a.783.783 0 01-.922.584zM2.346 4.85c-.075-.039-.103-.09-.149-.269A2078.986 2078.986 0 011.17.491L1.155.435H.662C.12.435.1.432.04.345a.224.224 0 01.056-.31L.146 0h.617c.587 0 .62.002.665.03a.258.258 0 01.068.063c.012.019.074.244.139.5.064.256.12.477.125.491.007.025.15.026 2.75.026 2.53 0 2.745.002 2.792.025a.228.228 0 01.113.163c.005.03-.116.538-.385 1.606-.468 1.862-.456 1.813-.488 1.87a.232.232 0 01-.077.075c-.049.027-.128.028-2.06.028-1.884 0-2.012-.002-2.058-.027z"/></svg>
@@ -0,0 +1,8 @@
1
+ <button
2
+ {{ include.product.in_stock | value_unless: 'disabled' }}
3
+ data-action="cart#add"
4
+ data-stock-add
5
+ class="btn btn-success btn-block btn-lg">
6
+ <span class="when-parent-disabled">{{ site.cart.out_of_stock }}</span>
7
+ <span class="when-parent-enabled">{{ site.cart.add }}</span>
8
+ </button>
@@ -0,0 +1,10 @@
1
+ data-controller="cart"
2
+ data-target="stock.product"
3
+ data-cart-url="{{ include.product.url }}"
4
+ data-cart-variant-id="{{ include.product.variant_id }}"
5
+ data-cart-image="{{ include.product.image.path | thumbnail: 212, 300 }}"
6
+ data-cart-title="{{ include.product.title }}"
7
+ data-cart-price="{{ include.product.price }}"
8
+ data-cart-in-stock="{{ include.product.in_stock }}"
9
+ data-cart-stock="{{ include.product.stock }}"
10
+ data-cart-extra="{{ include.extra | join: '|' }}"
@@ -1,15 +1,16 @@
1
1
  {% comment %}
2
- Esta imagen obtiene una cookie desde la API de Sutty para autorizar el
3
- envío del formulario.
2
+ Esta imagen obtiene una cookie desde la API de Sutty para autorizar el
3
+ envío del formulario.
4
4
  {% endcomment %}
5
- <img class="d-none" src="https://api.sutty.nl/v1/sites/{{ site.hostname }}/contact/cookie.png" />
5
+ <img class="d-none invisible" src="https://api.sutty.nl/v1/sites/{{ site.hostname }}/contact/cookie.png" />
6
6
 
7
7
  {% comment %}
8
8
  El formulario se envía a la API. La definición del formulario se
9
9
  encuentra en _data/forms/contacto.yml
10
10
  {% endcomment %}
11
- <form action="https://api.sutty.nl/v1/sites/{{ site.hostname }}/contact/contacto"
12
- method="post">
11
+ <form
12
+ action="https://api.sutty.nl/v1/sites/{{ site.hostname }}/contact/{{ include.name }}"
13
+ method="post">
13
14
  {%- for field in include.form -%}
14
15
  {% assign template = field[1].type | append: '.html' %}
15
16
  <div class="col{{ field[1].col | default: 12 | prepend: '-' }}">
@@ -0,0 +1 @@
1
+ {% include text.html field=field %}
@@ -0,0 +1,53 @@
1
+ {% if include.form %}
2
+ {%- assign name = include.field[0] | append: ']' | prepend: '[' | prepend: include.form -%}
3
+ {%- assign id = include.field[1].id | default: name | replace: '[', '_' | remove: ']' -%}
4
+ {% else %}
5
+ {%- assign name = include.field[0] -%}
6
+ {%- assign id = include.field[1].id | default: name %}
7
+ {% endif %}
8
+
9
+ {%- assign label = include.field[1].label[site.locale] -%}
10
+ {%- assign help = include.field[1].help[site.locale] -%}
11
+ {%- assign error = include.field[1].error[site.locale] -%}
12
+ {%- assign autocomplete = include.field[1].autocomplete -%}
13
+
14
+ <div class="form-group" data-controller="country" data-country-group="{{ include.field[1].group }}">
15
+ <label for="{{ id }}">
16
+ {{ label }}
17
+ {% if include.field[1].required %}*{% endif %}
18
+ </label>
19
+
20
+ <input data-target="country.id" type="hidden" name="{{ name }}" id="{{ id }}" value="" />
21
+ <input data-target="country.iso" type="hidden" name="{{ include.form }}_ignore_{{ include.field[0] }}_iso" value="" />
22
+
23
+ <input
24
+ data-target="country.name"
25
+ {% if help %}
26
+ aria-describedby="help-{{ id }}"
27
+ {% endif %}
28
+ {% if include.field[1].required %}
29
+ required
30
+ {% endif %}
31
+ type="{{ include.field[1].type }}"
32
+ {% if autocomplete %}
33
+ autocomplete="{{ autocomplete }}"
34
+ {% endif %}
35
+ name="{{ include.form }}_ignore_{{ include.field[0] }}"
36
+ id="{{ include.form }}_ignore_{{ include.field[0] }}"
37
+ disabled
38
+ list="list-{{ id }}"
39
+ class="form-control" />
40
+
41
+ {%- if error -%}
42
+ <div class="invalid-feedback">{{ error }}</div>
43
+ {%- endif -%}
44
+
45
+ {%- if help -%}
46
+ <small id="help-{{ id }}" class="form-text">
47
+ {{ help }}
48
+ </small>
49
+ {%- endif -%}
50
+
51
+ <datalist id="list-{{ id }}" data-target="country.list">
52
+ </datalist>
53
+ </div>
@@ -1,19 +1,23 @@
1
- <article id="editorial" class="col h-card" itemscope itemtype="https://schema.org/Organization">
2
- <div class="media">
3
- <img
4
- itemprop="logo"
5
- class="u-photo"
6
- src="{{ include.editorial.logo.path | thumbnail: 100 }}"
7
- alt="{{ include.editorial.logo.description }}" />
8
-
9
- <div class="media-body">
10
- <h1 class="p-name" itemprop="name">{{ include.editorial.title }}</h1>
11
- <p class="lead">{{ include.editorial.description }}</p>
1
+ <article id="editorial" class="h-card" itemscope itemtype="https://schema.org/Organization">
2
+ <div class="row no-gutters mb-3">
3
+ <div class="col-12 col-md-4 mb-3 mb-md-0">
4
+ {%- include_cached
5
+ picture.html
6
+ image=include.editorial.logo
7
+ itemprop='logo' -%}
12
8
  </div>
13
9
 
10
+ <header class="col-12 col-md pl-3">
11
+ <h1 class="p-name" itemprop="name">
12
+ <a href="{{ include.editorial.url }}">
13
+ {{ include.editorial.title }}
14
+ </a>
15
+ </h1>
16
+ <p class="lead">{{ include.editorial.description }}</p>
17
+ </header>
14
18
  </div>
15
19
 
16
- <div itemprop="location" itemscope itemtype="https://schema.org/PostalAddress">
20
+ <address itemprop="location" itemscope itemtype="https://schema.org/PostalAddress">
17
21
  {%- if include.editorial.address -%}
18
22
  <p class="p-street-address" itemprop="streetAddress">{{ include.editorial.address }}</p>
19
23
  {%- endif -%}
@@ -23,26 +27,16 @@
23
27
  {%- if include.editorial.country -%}
24
28
  <p class="p-country-name" itemprop="addressCountry">{{ include.editorial.country }}</p>
25
29
  {%- endif -%}
26
- </div>
30
+ </address>
27
31
 
28
- <ul>
32
+ <ul class="list-unstyled">
29
33
  {%- for social in include.editorial.social_networks -%}
30
- <li><a rel="me" href="{{ social }}">
31
- {% comment %}
32
-
33
- Obtenemos la URL de la red social, eliminamos la www,
34
- obtenemos el tercer elemento separando por / y el primero
35
- separando por .
36
-
37
- https://www.twitter.com/SuttyWeb
38
- https://twitter.com/SuttyWeb
39
- twitter.com
40
- twitter
41
- Twitter
42
- {% endcomment %}
43
- {% assign s = social | remove: 'www.' | split: '/' %}
44
- {{ s[2] | split: '.' | first | capitalize }}
45
- </a></li>
34
+ {% assign network = social | social_network %}
35
+ <li>
36
+ <a
37
+ target="_blank"
38
+ rel="noopener noreferrer me"
39
+ href="{{ social }}">{{ network.name | capitalize }}</a></li>
46
40
  {%- endfor -%}
47
41
  </ul>
48
42
 
@@ -0,0 +1,35 @@
1
+ {%- assign name = include.field[0] -%}
2
+ {%- assign id = include.field[1].id | default: name -%}
3
+ {%- assign label = include.field[1]['path'].label[site.locale] -%}
4
+ {%- assign help = include.field[1]['path'].help[site.locale] -%}
5
+ {%- assign accept = include.field[1].accept -%}
6
+
7
+ <label>{{ label }}</label>
8
+
9
+ <div class="custom-file">
10
+ <input
11
+ {% if help %}
12
+ aria-describedby="help-{{ id }}"
13
+ {% endif %}
14
+ {% if include.field[1].required %}
15
+ required
16
+ {% endif %}
17
+ type="{{ include.field[1].type }}"
18
+ name="{{ name }}[path]"
19
+ id="{{ id }}_path"
20
+ {% if accept %}
21
+ accept="{{ accept }}"
22
+ {% endif %}
23
+ class="custom-file-input" />
24
+
25
+ <label for="{{ id }}_path" class="custom-file-label">
26
+ {{ label }}
27
+ {% if include.field[1].required %}*{% endif %}
28
+ </label>
29
+
30
+ {%- if help -%}
31
+ <small id="help-{{ id }}" class="form-text">
32
+ {{ help }}
33
+ </small>
34
+ {%- endif -%}
35
+ </div>
@@ -0,0 +1,6 @@
1
+ <div
2
+ data-controller="floating-alert"
3
+ class="pointer-event-none floating-alert floating-alert-bottom d-flex justify-content-center w-100 position-fixed fade hide"
4
+ role="status" aria-live="polite" aria-atomic="true">
5
+ <div data-target="floating-alert.content" class="floating-alert-content white background-black-t4"></div>
6
+ </div>
@@ -1,12 +1,14 @@
1
- <footer>
2
- <div class="row align-items-end">
3
- {%- if include.footer -%}
4
- {% assign editorial = site.posts | where: 'layout', 'editorial' | first %}
5
- {% include_cached editorial.html editorial=editorial %}
6
- {%- endif -%}
1
+ <footer class="border-top pt-3 container">
2
+ <div class="row">
3
+ <div class="col">
4
+ {%- if include.footer -%}
5
+ {% assign editorial = site.posts | where: 'layout', 'editorial' | first %}
6
+ {% include_cached editorial.html editorial=editorial %}
7
+ {%- endif -%}
8
+ </div>
7
9
 
8
- <div class="col text-right">
9
- <ul class="">
10
+ <div class="col d-flex flex-column align-items-end justify-content-end">
11
+ <ul class="list-unstyled">
10
12
  {%- for link in site.i18n.footer.links %}
11
13
  <li>
12
14
  <a href="{{ link.url }}">{{ link.text }}</a>
@@ -1 +1 @@
1
- .././boolean.html
1
+ ../boolean.html
@@ -0,0 +1 @@
1
+ ../content.html
@@ -1 +1 @@
1
- .././email.html
1
+ ../email.html
@@ -0,0 +1 @@
1
+ ../file.html
@@ -1 +1 @@
1
- .././hidden.html
1
+ ../hidden.html
@@ -0,0 +1 @@
1
+ ../image.html
@@ -1 +1 @@
1
- .././input.html
1
+ ../input.html
@@ -0,0 +1 @@
1
+ ../markdown_content.html
@@ -1 +1 @@
1
- .././number.html
1
+ ../number.html
@@ -1 +1 @@
1
- .././predefined_array.html
1
+ ../predefined_array.html
@@ -1 +1 @@
1
- .././section.html
1
+ ../section.html
@@ -1 +1 @@
1
- .././separator.html
1
+ ../separator.html
@@ -1 +1 @@
1
- .././string.html
1
+ ../string.html
@@ -1 +1 @@
1
- .././submit.html
1
+ ../submit.html
@@ -0,0 +1 @@
1
+ ../tel.html
@@ -1 +1 @@
1
- .././text.html
1
+ ../text.html
@@ -1 +1 @@
1
- .././url.html
1
+ ../url.html
@@ -0,0 +1,32 @@
1
+ {%- assign name = include.field[0] -%}
2
+ {%- assign id = include.field[1].id | default: name -%}
3
+ {%- assign label = include.field[1]['path'].label[site.locale] -%}
4
+ {%- assign help = include.field[1]['path'].help[site.locale] -%}
5
+
6
+ <label>{{ label }}</label>
7
+
8
+ <div class="custom-file">
9
+ <input
10
+ {% if help %}
11
+ aria-describedby="help-{{ id }}"
12
+ {% endif %}
13
+ {% if include.field[1].required %}
14
+ required
15
+ {% endif %}
16
+ type="{{ include.field[1].type }}"
17
+ name="{{ name }}[path]"
18
+ id="{{ id }}_path"
19
+ accept="image/*"
20
+ class="custom-file-input" />
21
+
22
+ <label for="{{ id }}_path" class="custom-file-label">
23
+ {{ label }}
24
+ {% if include.field[1].required %}*{% endif %}
25
+ </label>
26
+
27
+ {%- if help -%}
28
+ <small id="help-{{ id }}" class="form-text">
29
+ {{ help }}
30
+ </small>
31
+ {%- endif -%}
32
+ </div>
data/_includes/input.html CHANGED
@@ -1,7 +1,14 @@
1
- {%- assign name = include.field[0] -%}
2
- {%- assign id = include.field[1].id | default: name -%}
1
+ {% if include.form %}
2
+ {%- assign name = include.field[0] | append: ']' | prepend: '[' | prepend: include.form -%}
3
+ {%- assign id = include.field[1].id | default: name | replace: '[', '_' | remove: ']' -%}
4
+ {% else %}
5
+ {%- assign name = include.field[0] -%}
6
+ {%- assign id = include.field[1].id | default: name %}
7
+ {% endif %}
8
+
3
9
  {%- assign label = include.field[1].label[site.locale] -%}
4
10
  {%- assign help = include.field[1].help[site.locale] -%}
11
+ {%- assign error = include.field[1].error[site.locale] -%}
5
12
  {%- assign autocomplete = include.field[1].autocomplete -%}
6
13
 
7
14
  <div class="form-group">
@@ -11,6 +18,7 @@
11
18
  </label>
12
19
 
13
20
  <input
21
+ {{ include.field[1].extra.input }}
14
22
  {% if help %}
15
23
  aria-describedby="help-{{ id }}"
16
24
  {% endif %}
@@ -25,6 +33,10 @@
25
33
  {% endif %}
26
34
  class="form-control" />
27
35
 
36
+ {%- if error -%}
37
+ <div class="invalid-feedback">{{ error }}</div>
38
+ {%- endif -%}
39
+
28
40
  {%- if help -%}
29
41
  <small id="help-{{ id }}" class="form-text">
30
42
  {{ help }}
@@ -0,0 +1,38 @@
1
+ {%- comment -%}
2
+ El ítem tiene un dropdown si tiene sub ítems o si tiene categorías.
3
+ {%- endcomment -%}
4
+ {%- assign dropdown = include.item.items | present -%}
5
+ {%- unless dropdown -%}
6
+ {%- assign dropdown = include.item.categories | present -%}
7
+ {%- endunless -%}
8
+
9
+ <div class="nav-item w-100 w-lg-auto {{ dropdown | value_if: 'dropdown d-flex flex-wrap' }}">
10
+ {%- comment -%}
11
+ La URL del item puede ser:
12
+ * El artículo vinculado
13
+ * El vínculo escrito manualmente
14
+ * La primera categoría de la lista
15
+ * La dirección propia (en el caso de categorías)
16
+ {%- endcomment -%}
17
+ <a
18
+ href="{{ include.item.post.url | default: include.item.link | default: include.item.categories[0].url | default: include.item.url }}"
19
+ class="nav-link flex-grow-1 flex-grow-lg-0">
20
+ {{ include.item.title }}
21
+ </a>
22
+
23
+ {%- if dropdown -%}
24
+ <button class="dropdown-toggle border-0 background-white w-5 w-lg-auto pl-lg-3"></button>
25
+ <div class="dropdown-menu w-100 w-lg-auto flex-grow-1 flex-grow-lg-0">
26
+ {% for item in include.item.items %}
27
+ {%- include_cached item.html item=item -%}
28
+ {% endfor %}
29
+
30
+ {%- comment -%}
31
+ Esto necesita `replace` en sutty-archives
32
+ {%- endcomment -%}
33
+ {%- for item in include.item.categories offset: 1 -%}
34
+ {%- include_cached item.html item=item -%}
35
+ {%- endfor -%}
36
+ </div>
37
+ {%- endif -%}
38
+ </div>
@@ -0,0 +1 @@
1
+ {% include text.html field=field %}
@@ -0,0 +1,27 @@
1
+ {%- comment -%}
2
+ Empezamos con los ítems que no dependen de otros e implementamos
3
+ recursivamente.
4
+ {%- endcomment -%}
5
+ {%- assign items = site.posts | where: 'layout', 'menu' | where: 'item', nil -%}
6
+
7
+ <nav class="navbar navbar-expand-lg navbar-light">
8
+ <button class="navbar-toggler"
9
+ type="button"
10
+ data-toggle="collapse"
11
+ data-target="#menu"
12
+ aria-label="{{ site.i18n.menu.title }}">
13
+ <span class="navbar-toggler-icon"></span>
14
+ </button>
15
+
16
+ <div class="collapse navbar-collapse" id="menu">
17
+ <div class="navbar-nav w-100 d-flex align-items-start justify-content-center">
18
+ {% for item in items %}
19
+ {%- include_cached item.html item=item -%}
20
+ {% endfor %}
21
+
22
+ <div class="nav-item w-100 w-lg-auto">
23
+ {%- include_cached search.html -%}
24
+ </div>
25
+ </div>
26
+ </div>
27
+ </nav>