desy-html 8.1.2 → 8.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -135,7 +135,7 @@ import componentTree %}
135
135
  {% for example in examples %}
136
136
  <div class="grid grid-cols-1 gap-x-xl mt-xl">
137
137
  <div class="pt-xl">
138
- <h3 id="example-title-{{ loop.index }}" class="c-h3 group">{{ example.name | capitalize }} <a href="#{{ example.name | capitalize | urlencode }}" class="hidden font-semibold text-neutral-base underline group-hover:inline-block">#</a></h3>
138
+ <h3 id="example-title-{{ loop.index }}" class="c-h3 group">{{ example.name | capitalize }} <a href="#{{ example.name |filterslugify }}" class="hidden font-semibold text-neutral-base underline group-hover:inline-block">#</a></h3>
139
139
  <p class="c-paragraph-base mb-0">{{ example.description | safe }}</p>
140
140
  </div>
141
141
  <div class="pt-base lg:pt-lg">
@@ -1,3 +1,3 @@
1
1
  {% macro DSSectionTitle(params) %}
2
- <h2 id="{{ params.title | urlencode }}" class="c-h2 mb-xl pb-sm border-b group">{{params.title}} <a href="#{{ params.title | urlencode }}" class="hidden font-semibold text-neutral-base underline group-hover:inline-block">#</a></h2>
2
+ <h2 id="{{ params.title | filterslugify }}" class="c-h2 mb-xl pb-sm border-b group">{{params.title}} <a href="#{{ params.title | filterslugify }}" class="hidden font-semibold text-neutral-base underline group-hover:inline-block">#</a></h2>
3
3
  {% endmacro %}
@@ -1,3 +1,3 @@
1
1
  {% macro DSSubsectionTitle(params) %}
2
- <h3 id="{{ params.title | urlencode }}" class="c-h3 mb-xl group">{{ params.title }} <a href="#{{ params.title | urlencode }}" class="hidden font-semibold text-neutral-base underline group-hover:inline-block">#</a></h3>
2
+ <h3 id="{{ params.title | filterslugify }}" class="c-h3 mb-xl group">{{ params.title }} <a href="#{{ params.title | filterslugify }}" class="hidden font-semibold text-neutral-base underline group-hover:inline-block">#</a></h3>
3
3
  {% endmacro %}
@@ -59,6 +59,7 @@
59
59
  <li>una columna (100%)</li>
60
60
  <li>dos columnas (50% + 50%)</li>
61
61
  </ul>
62
+ <div class="pb-lg"></div>
62
63
  </div>
63
64
  </div>
64
65
  {{ showHtmlFromFile("ds/_ds.example.layout-movil.njk") }}
package/docs/index.html CHANGED
@@ -37,6 +37,10 @@
37
37
 
38
38
  <h2>Changelog (English)</h2>
39
39
  <p>What's new in the latest version of desy-html</p>
40
+ <h3>v.8.1.3</h3>
41
+ <ul class="text-sm">
42
+ <li>Fixed anchors in docs.</li>
43
+ </ul>
40
44
  <h3>v.8.1.2</h3>
41
45
  <ul class="text-sm">
42
46
  <li>Improvements in estilos page in docs.</li>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "desy-html",
3
- "version": "8.1.2",
3
+ "version": "8.1.3",
4
4
  "description": "desy-html contains the code you need to start building a user interface for Gobierno de Aragón government webapps.",
5
5
  "author": {
6
6
  "name": "Desy (SDA Servicios Digitales de Aragón)",
@@ -0,0 +1,11 @@
1
+ function filterSlugify(str) {
2
+ // Replace spaces with hyphens
3
+ let slug = str.replace(/\s+/g, '-');
4
+ // Remove special characters
5
+ slug = slug.replace(/[^\w-]+/g, '');
6
+ // Convert to lowercase
7
+ slug = slug.toLowerCase();
8
+ return slug;
9
+ }
10
+
11
+ module.exports = filterSlugify
@@ -3,8 +3,10 @@
3
3
  */
4
4
  const highlight = require('./highlight')
5
5
  const filtercaller = require('./filter-caller')
6
+ const filterslugify = require('./filter-slugify')
6
7
 
7
8
  module.exports = {
8
9
  highlight,
9
- filtercaller
10
+ filtercaller,
11
+ filterslugify
10
12
  }