linaro-jekyll-theme 4.1.0 → 4.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd592e9e9ff522dd92a76d5c0e1a64ef11b009013aa73a609aacc56e86d66fb9
4
- data.tar.gz: d2ea51fe5a317c15c5eae4fcb06b73ad3ca6cc5a79ce9b8896b5f8f3c9351645
3
+ metadata.gz: 756d7402b28b07848743f83a9e6e57c6abb27722786e0df049445f338bb0ebd8
4
+ data.tar.gz: bf19a183f36c41c556bd2e3a15503af49667c8e8225234535e3719fe021ea210
5
5
  SHA512:
6
- metadata.gz: 39357ba76b554388a4b92def2623066dd8da55bf88be926a44f568cd3805039d0e595a3fde465b095ccba4bb17bd03d2c5dbc0ea3ade20cd1f04dfc911829ac4
7
- data.tar.gz: 9c639501e9654f80aa79d1edfe26bd9c6c152991367f1747e62370a1cf904eb87c352f6eb0a10728ae395742310e086c8ae95e0e3d28f20eb8e7778e722863a2
6
+ metadata.gz: 020b1d2206083b0a79a2e4e269f898ea33851c62dbf0a98c8e7f4696a989d72074c698f498d0cfa18f556103bbaab55ae4efbc44f63606e16e9b03f91c79e6a9
7
+ data.tar.gz: a6ca0015b7d7eb587c136abf656d126611ecd7dc409808b728c6e2b574226278e2354c9e65c03d07acc099b13e243bf7e6b8ffe4c39cf94307e4c1f5b81bce68
@@ -19,7 +19,7 @@
19
19
  </div>
20
20
  <div class="col col-12 tagged_posts" id="tagged_posts">
21
21
  {% for tag in site.tags %}
22
- <div class="tag_list {{tag[0]}} d-none">
22
+ <div class="tag_list {{tag[0] | slugify}} d-none">
23
23
  <h3>{{ tag[0] }}</h3>
24
24
  <ul class="list-unstyled">
25
25
  {% for post in tag[1] %}
@@ -56,7 +56,7 @@ css_package: blog
56
56
  <div class="post_tags text-center text-md-left my-2 my-sm-1">
57
57
  {% assign post_tags = page.tags | split: " " %}
58
58
  {% for tag in page.tags %}
59
- <a class="btn bg-light text-dark btn-sm my-1" href="/{{page.category}}/tags/?tag={{tag}}" data-toggle="tooltip" data-placement="top" title="View {{page.category}} post tagged {{tag}}">
59
+ <a class="btn bg-light text-dark btn-sm my-1" href="/{{page.category | downcase }}/tags/?tag={{tag}}" data-toggle="tooltip" data-placement="top" title="View {{page.category}} post tagged {{tag}}">
60
60
  {{tag}}
61
61
  </a>
62
62
  {% endfor %}
@@ -1,3 +1,22 @@
1
+ function slugify(string) {
2
+ const a =
3
+ "àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;";
4
+ const b =
5
+ "aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------";
6
+ const p = new RegExp(a.split("").join("|"), "g");
7
+
8
+ return string
9
+ .toString()
10
+ .toLowerCase()
11
+ .replace(/\s+/g, "-") // Replace spaces with -
12
+ .replace(p, (c) => b.charAt(a.indexOf(c))) // Replace special characters
13
+ .replace(/&/g, "-and-") // Replace & with 'and'
14
+ .replace(/[^\w\-]+/g, "") // Remove all non-word characters
15
+ .replace(/\-\-+/g, "-") // Replace multiple - with single -
16
+ .replace(/^-+/, "") // Trim - from start of text
17
+ .replace(/-+$/, ""); // Trim - from end of text
18
+ }
19
+
1
20
  $(document).ready(function () {
2
21
  // Clipboard JS
3
22
  if ($("div.highlight").length > 0) {
@@ -27,27 +46,29 @@ $(document).ready(function () {
27
46
  });
28
47
  }
29
48
  // Tagged Posts
30
- if($("#tagged_posts").length > 0){
31
- var getUrlParameter = (sParam) => {
49
+ if ($("#tagged_posts").length > 0) {
50
+ var getUrlParameter = (sParam) => {
32
51
  var sPageURL = window.location.search.substring(1),
33
- sURLVariables = sPageURL.split('&'),
34
- sParameterName,
35
- i;
36
-
52
+ sURLVariables = sPageURL.split("&"),
53
+ sParameterName,
54
+ i;
55
+
37
56
  for (i = 0; i < sURLVariables.length; i++) {
38
- sParameterName = sURLVariables[i].split('=');
39
-
40
- if (sParameterName[0] === sParam) {
41
- return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);
42
- }
57
+ sParameterName = sURLVariables[i].split("=");
58
+
59
+ if (sParameterName[0] === sParam) {
60
+ return sParameterName[1] === undefined
61
+ ? true
62
+ : decodeURIComponent(sParameterName[1]);
63
+ }
43
64
  }
44
65
  };
45
- var tag = getUrlParameter('tag');
46
- if(tag !== undefined){
66
+ var tag = getUrlParameter("tag");
67
+ if (tag !== undefined) {
47
68
  console.log(tag);
48
69
  $(".tag_list").addClass("d-none");
49
- $(`.tag_list.${tag}`).addClass("d-block");
50
- $(this).html(tag)
70
+ $(`.tag_list.${slugify(tag)}`).addClass("d-block");
71
+ $(this).html(tag);
51
72
  }
52
73
  }
53
74
  if ($("#jumbotron-slider").length > 0) {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linaro-jekyll-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0
4
+ version: 4.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Kirkby