editorial-autogestiva-jekyll-theme 0.2.6 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -2
  3. data/_config.yml +73 -0
  4. data/_data/en.yml +151 -0
  5. data/_data/es.yml +111 -31
  6. data/_data/forms/billing_address.yml +71 -0
  7. data/_data/forms/contacto.yml +49 -0
  8. data/_data/forms/contacto.yml~ +45 -0
  9. data/_data/forms/shipping_address.yml +76 -0
  10. data/_data/forms/user.yml +11 -0
  11. data/_data/layouts/book.yml +82 -93
  12. data/_data/layouts/cart.yml +198 -0
  13. data/_data/layouts/confirmation.yml +68 -0
  14. data/_data/layouts/menu.yml +65 -0
  15. data/_data/layouts/payment.yml +114 -0
  16. data/_data/layouts/post.yml +0 -1
  17. data/_data/layouts/shipment.yml +126 -0
  18. data/_includes/boolean.html +30 -0
  19. data/_includes/cart.svg +1 -0
  20. data/_includes/cart_add.html +8 -0
  21. data/_includes/cart_controller.html +10 -0
  22. data/_includes/contact.html +17 -29
  23. data/_includes/content.html +1 -0
  24. data/_includes/country.html +53 -0
  25. data/_includes/editorial.html +24 -30
  26. data/_includes/email.html +1 -0
  27. data/_includes/file.html +35 -0
  28. data/_includes/floating_alert.html +6 -0
  29. data/_includes/footer.html +10 -8
  30. data/_includes/form/boolean.html +1 -0
  31. data/_includes/form/content.html +1 -0
  32. data/_includes/form/email.html +1 -0
  33. data/_includes/form/file.html +1 -0
  34. data/_includes/form/hidden.html +1 -0
  35. data/_includes/form/image.html +1 -0
  36. data/_includes/form/input.html +1 -0
  37. data/_includes/form/markdown_content.html +1 -0
  38. data/_includes/form/number.html +1 -0
  39. data/_includes/form/predefined_array.html +1 -0
  40. data/_includes/form/section.html +1 -0
  41. data/_includes/form/separator.html +1 -0
  42. data/_includes/form/string.html +1 -0
  43. data/_includes/form/submit.html +1 -0
  44. data/_includes/form/tel.html +1 -0
  45. data/_includes/form/text.html +1 -0
  46. data/_includes/form/url.html +1 -0
  47. data/_includes/hidden.html +5 -0
  48. data/_includes/image.html +32 -0
  49. data/_includes/input.html +45 -0
  50. data/_includes/item.html +38 -0
  51. data/_includes/markdown_content.html +1 -0
  52. data/_includes/menu.html +27 -0
  53. data/_includes/navbar.html +29 -25
  54. data/_includes/notification.html +5 -0
  55. data/_includes/number.html +1 -0
  56. data/_includes/password.html +1 -0
  57. data/_includes/picture.html +23 -0
  58. data/_includes/postal_code.html +45 -0
  59. data/_includes/predefined_array.html +39 -0
  60. data/_includes/preload_font.html +1 -0
  61. data/_includes/search.html +25 -0
  62. data/_includes/section.html +1 -0
  63. data/_includes/separator.html +1 -0
  64. data/_includes/share.html +22 -0
  65. data/_includes/share_box.html +16 -0
  66. data/_includes/state.html +53 -0
  67. data/_includes/string.html +3 -0
  68. data/_includes/submit.html +1 -0
  69. data/_includes/tel.html +1 -0
  70. data/_includes/text.html +32 -0
  71. data/_includes/url.html +1 -0
  72. data/_layouts/book.html +42 -84
  73. data/_layouts/cart.html +72 -0
  74. data/_layouts/confirmation.html +17 -0
  75. data/_layouts/default.html +30 -10
  76. data/_layouts/home.html +23 -13
  77. data/_layouts/payment.html +21 -0
  78. data/_layouts/post.html +5 -5
  79. data/_layouts/shipment.html +52 -0
  80. data/_sass/accessibility.scss +37 -0
  81. data/_sass/editor.scss +8 -0
  82. data/_sass/embed.scss +5 -0
  83. data/_sass/floating_alert.scss +10 -0
  84. data/_sass/helpers.scss +318 -0
  85. data/_sass/logic.scss +17 -0
  86. data/_sass/menu.scss +20 -0
  87. data/_sass/share.html +12 -0
  88. data/_sass/share_box.html +16 -0
  89. data/_sass/share_box.scss +26 -0
  90. data/_sass/snap.scss +58 -0
  91. data/_sass/toggler.scss +39 -0
  92. data/assets/css/styles.scss +41 -5
  93. data/assets/data/site.json +24 -0
  94. data/assets/fonts/forkawesome-webfont.woff2 +0 -0
  95. data/assets/js/pack.js +16 -0
  96. data/assets/js/pack.js.map +1 -0
  97. data/assets/js/script.js +44 -0
  98. data/assets/templates/alert.html +7 -0
  99. data/assets/templates/cart.html +65 -0
  100. data/assets/templates/payment_methods.html +41 -0
  101. data/assets/templates/recover_order.html +11 -0
  102. data/assets/templates/results.html +17 -0
  103. data/assets/templates/shipping_methods.html +36 -0
  104. metadata +258 -30
  105. data/_sass/home.scss +0 -22
@@ -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=field %}
@@ -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>
@@ -0,0 +1,45 @@
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="postal-code" data-postal-code-group="{{ include.field[1].group }}">
15
+ <label for="{{ id }}">
16
+ {{ label }}
17
+ {% if include.field[1].required %}*{% endif %}
18
+ </label>
19
+
20
+ <input
21
+ name="{{ name }}"
22
+ id="{{ id }}"
23
+ data-target="postal-code.code"
24
+ {% if help %}
25
+ aria-describedby="help-{{ id }}"
26
+ {% endif %}
27
+ {% if include.field[1].required %}
28
+ required
29
+ {% endif %}
30
+ type="{{ include.field[1].type }}"
31
+ {% if autocomplete %}
32
+ autocomplete="{{ autocomplete }}"
33
+ {% endif %}
34
+ class="form-control" />
35
+
36
+ {%- if error -%}
37
+ <div class="invalid-feedback">{{ error }}</div>
38
+ {%- endif -%}
39
+
40
+ {%- if help -%}
41
+ <small id="help-{{ id }}" class="form-text">
42
+ {{ help }}
43
+ </small>
44
+ {%- endif -%}
45
+ </div>
@@ -0,0 +1,39 @@
1
+ {%- assign name = include.field[0] -%}
2
+ {%- assign id = include.field[1].id | default: name -%}
3
+ {%- assign label = include.field[1].label[site.locale] -%}
4
+ {%- assign help = include.field[1].help[site.locale] -%}
5
+ {%- assign autocomplete = include.field[1].autocomplete -%}
6
+
7
+ <div class="form-group">
8
+ <label for="{{ id }}">
9
+ {{ label }}
10
+ {% if include.field[1].required %}*{% endif %}
11
+ </label>
12
+
13
+ <select
14
+ {% if help %}
15
+ aria-describedby="help-{{ id }}"
16
+ {% endif %}
17
+ {% if include.field[1].required %}
18
+ required
19
+ {% endif %}
20
+ name="{{ name }}"
21
+ id="{{ id }}"
22
+ {% if autocomplete %}
23
+ autocomplete="{{ autocomplete }}"
24
+ {% endif %}
25
+ class="form-control">
26
+
27
+ <option value="" selected></option>
28
+
29
+ {%- for option in include.field[1].values -%}
30
+ <option value="{{ option }}">{{ option }}</option>
31
+ {%- endfor -%}
32
+ </select>
33
+
34
+ {%- if help -%}
35
+ <small id="help-{{ id }}" class="form-text">
36
+ {{ help }}
37
+ </small>
38
+ {%- endif -%}
39
+ </div>
@@ -0,0 +1 @@
1
+ <link rel="preload" as="font" type="font/woff2" crossorigin href="{{ include.font }}" />
@@ -0,0 +1,25 @@
1
+ {%- assign param = include.param | default: 'search' -%}
2
+
3
+ <form method="get" action="" class="form-inline" data-controller="search" data-action="search#search">
4
+ <div class="form-group">
5
+ <label for="{{ param }}_q" class="sr-only">{{ site.i18n.search.label }}</label>
6
+
7
+ <div class="input-group flex-nowrap">
8
+ <div class="input-group-prepend">
9
+ <span class="input-group-text fa fa-search border-0 pt-2"></span>
10
+ </div>
11
+
12
+ <input
13
+ class="border-0 form-control"
14
+ type="search"
15
+ required
16
+ id="{{ param }}_q"
17
+ name="q"
18
+ placeholder="{{ site.i18n.search.submit }}"
19
+ data-target="search.q"
20
+ autocomplete="off" />
21
+ </div>
22
+ </div>
23
+
24
+ <input class="sr-only" type="submit" value="{{ site.i18n.search.submit }}" />
25
+ </form>
@@ -0,0 +1 @@
1
+ <h2 id="{{ include.field[0] }}">{{ include.field[1].title }}</h2>
@@ -0,0 +1 @@
1
+ <hr/>
@@ -0,0 +1,22 @@
1
+ {% capture url %}{{ site.url }}{{ include.url }}{% endcapture %}
2
+
3
+ {% unless include.share.url == '%url' %}
4
+ {% assign url = url | default: '' | cgi_escape %}
5
+ {% endunless %}
6
+ {% assign title = include.title | default: '' | cgi_escape %}
7
+ {% assign description = include.description | default: '' | cgi_escape %}
8
+ {% assign tags = include.tags | join: ',' | default: '' | cgi_escape %}
9
+
10
+ <a
11
+ {% if include.share.url == '%url' %}
12
+ download
13
+ {% else %}
14
+ target="_blank"
15
+ {% endif %}
16
+ rel="noopener nofollow"
17
+ title="{{ include.share.title }}"
18
+ class="d-flex flex-column align-items-center p-3"
19
+ href="{{ include.share.url | replace: '%url', url | replace: '%title', title | replace: '%description', description | replace: '%tags', tags }}">
20
+ <i class="fa fa-fw fa-2x fa-{{ include.share.icon }}"></i>
21
+ <span>{{ include.share.title }}</span>
22
+ </a>
@@ -0,0 +1,16 @@
1
+ <input type="checkbox" id="share" class="toggler" autocomplete="off" />
2
+
3
+ <label class="share btn border btn-block" for="share">
4
+ {{ site.i18n.share.text }}
5
+ <i class="fa fa-{{ site.i18n.share.icon }}"></i>
6
+
7
+ <div class="share-box toggled d-flex align-items-center justify-content-center">
8
+ <div class="box background-white color-redpink row no-gutters align-items-center justify-content-center p-3">
9
+ {% for share in site.i18n.share.items %}
10
+ <div class="col-4">
11
+ {% include_cached share.html share=share url=include.url title=include.title description=include.description %}
12
+ </div>
13
+ {% endfor %}
14
+ </div>
15
+ </div>
16
+ </label>
@@ -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="state" data-state-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="state.id" type="hidden" name="{{ name }}" id="{{ id }}" value="" />
21
+
22
+ <input
23
+ data-target="state.name"
24
+ {% if help %}
25
+ aria-describedby="help-{{ id }}"
26
+ {% endif %}
27
+ {% if include.field[1].required %}
28
+ required
29
+ {% endif %}
30
+ type="{{ include.field[1].type }}"
31
+ {% if autocomplete %}
32
+ autocomplete="{{ autocomplete }}"
33
+ {% endif %}
34
+ name="{{ include.form }}_ignore_{{ include.field[0] }}"
35
+ id="{{ include.form }}_ignore_{{ include.field[0] }}"
36
+ disabled
37
+ list="list-{{ id }}"
38
+ class="form-control" />
39
+
40
+ {%- if error -%}
41
+ <div class="invalid-feedback">{{ error }}</div>
42
+ {%- endif -%}
43
+
44
+ {%- if help -%}
45
+ <small id="help-{{ id }}" class="form-text">
46
+ {{ help }}
47
+ </small>
48
+ {%- endif -%}
49
+
50
+ <datalist id="list-{{ id }}" data-target="state.list">
51
+ </datalist>
52
+ </div>
53
+
@@ -0,0 +1,3 @@
1
+ {% assign f = field %}
2
+ {% assign f.type = 'text' %}
3
+ {% include input.html field=f %}
@@ -0,0 +1 @@
1
+ <input type="submit" class="btn btn-block btn-success" value="{{ include.field[1].label[site.locale] }}" />
@@ -0,0 +1 @@
1
+ {% include input.html field=field %}
@@ -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].label[site.locale] -%}
4
+ {%- assign help = include.field[1].help[site.locale] -%}
5
+ {%- assign autocomplete = include.field[1].autocomplete -%}
6
+
7
+ <div class="form-group">
8
+ <label for="{{ id }}">
9
+ {% if include.field[1].required %}*{% endif %}
10
+ {{ label }}
11
+ </label>
12
+
13
+ <textarea
14
+ {% if help %}
15
+ aria-describedby="help-{{ id }}"
16
+ {% endif %}
17
+ {% if include.field[1].required %}
18
+ required
19
+ {% endif %}
20
+ name="{{ name }}"
21
+ id="{{ id }}"
22
+ {% if autocomplete %}
23
+ autocomplete="{{ autocomplete }}"
24
+ {% endif %}
25
+ class="form-control"></textarea>
26
+
27
+ {%- if .help -%}
28
+ <small id="help-{{ id }}" class="form-text">
29
+ {{ help }}
30
+ </small>
31
+ {%- endif -%}
32
+ </div>
@@ -0,0 +1 @@
1
+ {% include input.html field=field %}
data/_layouts/book.html CHANGED
@@ -2,7 +2,11 @@
2
2
  layout: default
3
3
  ---
4
4
 
5
- <article class="h-entry" itemscope itemtype="http://schema.org/Book">
5
+ <article
6
+ {% include_cached cart_controller.html product=page extra=page.author %}
7
+ class="h-entry"
8
+ itemscope itemtype="http://schema.org/Book">
9
+
6
10
  <header>
7
11
  <h1 class="p-name" itemprop="name headline">{{ page.title | escape }}</h1>
8
12
 
@@ -15,8 +19,8 @@ layout: default
15
19
  class="dt-published"
16
20
  datetime="{{ page.date | date_to_xmlschema }}"
17
21
  itemprop="datePublished">
18
- {%- assign date_format = site.i18n.date | default: "%b %-d, %Y" -%}
19
- {{ page.date | date: date_format }}
22
+ {%- assign date_format = site.i18n.date.format | default: "%b %-d, %Y" -%}
23
+ {{ page.date | date_local: date_format }}
20
24
  </time>
21
25
 
22
26
  {%- for author in page.author -%}
@@ -31,7 +35,7 @@ layout: default
31
35
  </header>
32
36
 
33
37
  <div class="row">
34
- <div class="col">
38
+ <div class="col-12 col-md">
35
39
  {%- if page.image.path -%}
36
40
  <picture>
37
41
  {% for size in site.images.sizes %}
@@ -58,101 +62,55 @@ layout: default
58
62
  </a>
59
63
  {%- endif %}
60
64
 
61
- {%- if page.payment_url -%}
62
- <a
63
- href="{{ page.payment_url }}"
64
- class="btn btn-success btn-block btn-lg">
65
- {{ site.i18n.book.payment_url }}
66
- </a>
67
- {%- endif %}
65
+ {%- include_cached cart_add.html product=page -%}
68
66
  </div>
69
67
 
70
- <div class="col">
71
- {% comment %}
72
- La disponibilidad del libro!
73
- {% endcomment %}
68
+ <div class="col-12 col-md">
74
69
  <div itemprop="offers" itemscope itemtype="https://schema.org/Offer">
75
- <h2>
76
- <span itemprop="price">{{ page.price }}</span>
77
- <span itemprop="priceCurrency">{{ page.currency }}</span>
78
- </h2>
79
-
80
- <dl>
81
- <dt>{{ site.i18n.book.availability }}</dt>
82
- {%- if page.availability -%}
83
- <meta itemprop="availability"
84
- content="https://schema.org/InStock" />
85
- <dd>{{ site.i18n.book.in_stock }}</dd>
86
- {%- else -%}
87
- <meta itemprop="availability"
88
- content="https://schema.org/OutOfStock" />
89
- <dd class="out-of-stock">
90
- {{ site.i18n.book.out_of_stock }}
91
- </dd>
92
- {%- endif -%}
93
-
94
- <dt>{{ site.i18n.book.payment_methods }}</dt>
95
- {%- for pm in page.payment_methods -%}
96
- <dd>{{ site.i18n.book[pm].text }}</dd>
97
- <meta
98
- itemprop="acceptedPaymentMethod"
99
- content="http://purl.org/goodrelations/v1#{{ site.i18n.book[pm].schema }}" />
100
- {%- endfor -%}
101
-
102
- <dt>{{ site.i18n.book.delivery_methods }}</dt>
103
- {%- for dm in page.delivery_methods -%}
104
- <dd>{{ site.i18n.book[dm].text }}</dd>
105
- <meta
106
- itemprop="acceptedPaymentMethod"
107
- content="http://purl.org/goodrelations/v1#{{ site.i18n.book[pm].schema }}" />
108
- {%- endfor -%}
109
- </dl>
70
+ <p class="f-4">
71
+ <span data-stock-price>
72
+ <span itemprop="price">{{ page.price }}</span>
73
+ <span itemprop="priceCurrency">{{ site.cart.currency }}</span>
74
+ </span>
75
+ <meta itemprop="availability" content="https://schema.org/{{ page.in_stock | ternary: 'InStock', 'OutOfStock' }}" />
76
+ </p>
110
77
  </div>
111
78
 
112
79
  <dl>
113
- <dt>{{ site.i18n.book.pages }}</dt>
114
- <dd itemprop="numberOfPages">{{ page.pages }}</dd>
115
-
116
- <dt>{{ site.i18n.book.size }}</dt>
117
- <dd>{{ page.size }}</dd>
80
+ {%- if page.pages -%}
81
+ <dt>{{ site.i18n.book.pages }}</dt>
82
+ <dd itemprop="numberOfPages">{{ page.pages }}</dd>
83
+ {%- endif -%}
84
+
85
+ {%- assign divider = site.i18n.units.size.divider | default: 10 -%}
86
+ {%- assign width = page.width | divided_by: divider | floor -%}
87
+ {%- if width > 0 -%}
88
+ {%- assign height = page.height | divided_by: divider | floor -%}
89
+ {%- assign depth = page.depth | divided_by: divider | floor -%}
90
+ <dt>{{ site.i18n.book.size }}</dt>
91
+ <dd>
92
+ {{ width }}x{{ height }}{% if depth > 0 %}x{{ depth }}{% endif %} {{ site.i18n.units.size.name }}
93
+ </dd>
94
+ {%- endif -%}
118
95
  </dl>
119
96
 
120
97
  <div class="e-content" itemprop="abstract">
121
- {{ content }}
98
+ {{ content | replace: '<img ', '<img loading="lazy" ' | replace: '<iframe ', '<iframe loading="lazy" ' }}
122
99
  </div>
123
100
  </div>
124
101
  </div>
125
102
 
126
- <div class="row">
127
- <div class="col">
128
- {% include contact.html url=page.url %}
129
- </div>
130
- </div>
131
-
132
103
  <footer>
133
- <a class="u-url" itemprop="url" href="{{ page.url }}" hidden>
134
- {{ site.url }}/{{ page.url }}
135
- </a>
136
-
137
- {%- if page.uuid -%}
138
- <span hidden itemprop="identifier">{{ page.uuid }}</span>
139
- {%- endif -%}
104
+ <a class="u-url" itemprop="url" href="{{ page.url }}" hidden>{{ page.url | absolute_url }}</a>
105
+ <meta itemprop="identifier" content="{{ page.uuid }}"/>
106
+ <meta itemprop="keywords" content="{{ page.tags | join: ',' }},{{ page.categories | join: ',' }}" />
140
107
 
141
- {%- if page.license.url -%}
142
- <p itemprop="license" itemtype="http://schema.org/CreativeWork">
143
- <a rel="license" itemprop="url" href="{{ page.license.url }}">
144
- <span itemprop="articleBody">
145
- {{ page.license.description }}
146
- </span>
147
- </a>
148
- </p>
149
- {%- endif -%}
108
+ {%- for tag in page.tags -%}
109
+ <span hidden class="h-category">{{ tag }}</span>
110
+ {%- endfor -%}
150
111
 
151
- {%- if page.tags %}
152
- <span itemprop="keywords" hidden>{{ page.tags | join: ', ' }}</span>
153
- {%- for tag in page.tags -%}
154
- <span hidden class="h-category">{{ tag }}</span>
155
- {%- endfor -%}
156
- {%- endif -%}
112
+ {%- for category in page.categories -%}
113
+ <span hidden class="h-category">{{ category }}</span>
114
+ {%- endfor -%}
157
115
  </footer>
158
116
  </article>