editorial-autogestiva-jekyll-theme 0.2.8 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) 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 +82 -93
  11. data/_data/layouts/cart.yml +198 -0
  12. data/_data/layouts/confirmation.yml +68 -0
  13. data/_data/layouts/menu.yml +65 -0
  14. data/_data/layouts/payment.yml +114 -0
  15. data/_data/layouts/post.yml +0 -1
  16. data/_data/layouts/shipment.yml +126 -0
  17. data/_includes/cart.svg +1 -0
  18. data/_includes/cart_add.html +8 -0
  19. data/_includes/cart_controller.html +10 -0
  20. data/_includes/contact.html +6 -5
  21. data/_includes/content.html +1 -0
  22. data/_includes/country.html +53 -0
  23. data/_includes/editorial.html +24 -30
  24. data/_includes/file.html +35 -0
  25. data/_includes/floating_alert.html +6 -0
  26. data/_includes/footer.html +10 -8
  27. data/_includes/form/boolean.html +1 -1
  28. data/_includes/form/content.html +1 -0
  29. data/_includes/form/email.html +1 -1
  30. data/_includes/form/file.html +1 -0
  31. data/_includes/form/hidden.html +1 -1
  32. data/_includes/form/image.html +1 -0
  33. data/_includes/form/input.html +1 -1
  34. data/_includes/form/markdown_content.html +1 -0
  35. data/_includes/form/number.html +1 -1
  36. data/_includes/form/predefined_array.html +1 -1
  37. data/_includes/form/section.html +1 -1
  38. data/_includes/form/separator.html +1 -1
  39. data/_includes/form/string.html +1 -1
  40. data/_includes/form/submit.html +1 -1
  41. data/_includes/form/tel.html +1 -0
  42. data/_includes/form/text.html +1 -1
  43. data/_includes/form/url.html +1 -1
  44. data/_includes/image.html +32 -0
  45. data/_includes/input.html +14 -2
  46. data/_includes/item.html +38 -0
  47. data/_includes/markdown_content.html +1 -0
  48. data/_includes/menu.html +27 -0
  49. data/_includes/navbar.html +29 -25
  50. data/_includes/notification.html +5 -0
  51. data/_includes/password.html +1 -0
  52. data/_includes/picture.html +23 -0
  53. data/_includes/postal_code.html +45 -0
  54. data/_includes/preload_font.html +1 -0
  55. data/_includes/search.html +25 -0
  56. data/_includes/share.html +22 -0
  57. data/_includes/share_box.html +16 -0
  58. data/_includes/state.html +53 -0
  59. data/_includes/submit.html +1 -1
  60. data/_includes/tel.html +1 -0
  61. data/_layouts/book.html +42 -84
  62. data/_layouts/cart.html +72 -0
  63. data/_layouts/confirmation.html +15 -0
  64. data/_layouts/default.html +30 -10
  65. data/_layouts/home.html +23 -13
  66. data/_layouts/payment.html +21 -0
  67. data/_layouts/post.html +5 -5
  68. data/_layouts/shipment.html +49 -0
  69. data/_sass/accessibility.scss +37 -0
  70. data/_sass/editor.scss +8 -0
  71. data/_sass/embed.scss +5 -0
  72. data/_sass/floating_alert.scss +10 -0
  73. data/_sass/helpers.scss +318 -0
  74. data/_sass/logic.scss +17 -0
  75. data/_sass/menu.scss +20 -0
  76. data/_sass/share.html +12 -0
  77. data/_sass/share_box.html +16 -0
  78. data/_sass/share_box.scss +26 -0
  79. data/_sass/snap.scss +58 -0
  80. data/_sass/toggler.scss +39 -0
  81. data/assets/css/styles.scss +41 -5
  82. data/assets/data/site.json +24 -0
  83. data/assets/fonts/forkawesome-webfont.woff2 +0 -0
  84. data/assets/js/pack.js +16 -0
  85. data/assets/js/pack.js.map +1 -0
  86. data/assets/js/script.js +44 -0
  87. data/assets/templates/alert.html +7 -0
  88. data/assets/templates/cart.html +65 -0
  89. data/assets/templates/payment_methods.html +41 -0
  90. data/assets/templates/recover_order.html +11 -0
  91. data/assets/templates/results.html +17 -0
  92. data/assets/templates/shipping_methods.html +35 -0
  93. metadata +227 -29
  94. data/README.md.orig +0 -118
  95. data/_includes/contact.html.orig +0 -55
  96. data/_includes/navbar.html.orig +0 -44
  97. data/_sass/home.scss +0 -22
@@ -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.title }}">
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>
@@ -1,33 +1,37 @@
1
- {% assign editorial = site.posts | where: 'layout', 'editorial' | first %}
1
+ {%- assign items = site.posts | where: 'layout', 'menu' | where: 'item', nil -%}
2
2
 
3
- <nav class="navbar navbar-expand-lg navbar-light bg-light d-print-block" role="navigation" aria-label="{{ site.i18n.menu.title }}">
4
- <a class="navbar-brand" href="">
3
+ <nav class="navbar navbar-expand-lg navbar-light d-print-block" role="navigation" aria-label="{{ site.i18n.menu.title }}">
4
+ <a class="navbar-brand w-100 w-lg-auto" href="?">
5
5
  {{ site.title }}
6
6
  </a>
7
7
 
8
- {% comment %}
9
- TODO: Add CSS-only hamburger menu.
10
- {% endcomment %}
11
- <ul class="navbar-nav d-print-none">
12
- {%- for item in site.i18n.menu.items -%}
13
- {% comment %}
14
- This makes it hard to just cache the whole navbar, but we prefer
15
- to mark the active item in code rather than with JS.
16
- {% endcomment %}
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>
17
15
 
18
- {% assign url = item.url | liquify %}
16
+ <div class="collapse navbar-collapse order-last order-md-2" 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 %}
19
21
 
20
- <li class="nav-item">
21
- <a class="nav-link{% if page.url == url %} active{% endif %}" href="{{ url }}">
22
- {{ item.text }}
22
+ {% comment %}
23
+ <div class="nav-item w-100 w-lg-auto">
24
+ {%- include_cached search.html -%}
25
+ </div>
26
+ {% endcomment %}
27
+ </div>
28
+ </div>
23
29
 
24
- {%- if page.url == url -%}
25
- <span class="sr-only">
26
- {{ site.i18n.menu.active | default: '(current)' }}
27
- </span>
28
- {%- endif -%}
29
- </a>
30
- </li>
31
- {%- endfor -%}
32
- </ul>
30
+ <a class="black pr-lg-3 pl-lg-3 order-md-last" href="{{ site.cart.url }}">
31
+ <span class="d-flex align-items-center justify-content-center" data-controller="cart-counter">
32
+ <i class="fa fa-fw fa-2x fa-shopping-cart"></i>
33
+ <span class="sr-only">{{ site.cart.title }}</span>
34
+ <span class="font-weight-bold ml-1" data-target="cart-counter.counter">0</span>
35
+ </span>
36
+ </a>
33
37
  </nav>
@@ -0,0 +1,5 @@
1
+ <div
2
+ data-controller="notification"
3
+ data-notification-templates="assets/templates/"
4
+ class="notification fixed-top w-100 fade collapse hide">
5
+ </div>
@@ -0,0 +1 @@
1
+ {% include input.html field=include.field form=include.form %}
@@ -0,0 +1,23 @@
1
+ {% comment %}
2
+ Imágenes responsive. Esto logra que solo se carguen las versiones de
3
+ las imágenes con el ancho máximo de la pantalla.
4
+
5
+ TODO: Las imágenes en md y superior nunca llegan al ancho máximo así
6
+ que tienen una resolución de más.
7
+ {% endcomment %}
8
+ {%- assign image = include.image.path | default: 'public/placeholder.png' %}
9
+ {%- assign height = include.height | default: site.i18n.post.height -%}
10
+ {%- assign width = include.width | default: '100' -%}
11
+
12
+ <picture>
13
+ {% for size in site.images.sizes %}
14
+ <source srcset="{{ image | thumbnail: size }}" media="(max-width: {{ size }}px)" />
15
+ {% endfor %}
16
+
17
+ <img
18
+ class="u-photo w-{{ width }} {{ include.cover | equals: false | value_unless: 'fit-cover' }} h-{{ height }} {{ include.extra }}"
19
+ loading="lazy"
20
+ itemprop="{{ include.itemprop | default: 'image' }}"
21
+ src="{{ image | thumbnail: 1140 }}"
22
+ alt="{{ include.image.description | include.default_description }}" />
23
+ </picture>