jekyll-readthedocs 0.2.0 → 0.2.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
  SHA1:
3
- metadata.gz: 9f90ee37365aab92331d4e7493d974ab636c71b1
4
- data.tar.gz: 646592101a0fec1c4f5e912535a46d4f8fa2dfd8
3
+ metadata.gz: e0062a0388403190df038bc77d38433aab718c90
4
+ data.tar.gz: 611866553134aa2f38537e513a5c6fbca6334db1
5
5
  SHA512:
6
- metadata.gz: 1bfab6e78cfe8291d1e9b4bcd9797c87fb27d4cd2ad94567769a0e73526f9b56e5e03f9e5c1f97f8391ed94dbcf16b7c4956335d7735f787846507aa6d127a5b
7
- data.tar.gz: 3ffe1935869b6cf13092af98b2d0dee7bbffc672f67f6aa0db03ae2cdfe7f83a5484eee1565bf778c718296b95a0cce2fbc4a08b190bf7b36eb53a0a5af6d7b8
6
+ metadata.gz: 3661e74bdcfc8ebfc9ecfe6374660d081cdfaef69cd924e7066a3798d516212bd7aa5c20779a51bae7404b0e94bf28a05de6b9856a5e209fb539a1b04025fa55
7
+ data.tar.gz: c4d0db96fb593bde286798512f38426cd35fbc0eaa753a0600f56fbbf7ef63a1a13da9a3e7ecc2818b2da8297fa08911c42789f16dba12e09f8f7a619d1400ba
@@ -0,0 +1,56 @@
1
+ <script src="https://code.jquery.com/jquery-3.3.1.min.js"
2
+ integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
3
+ crossorigin="anonymous"></script>
4
+
5
+ <script>
6
+ function getUrlParameter(sParam) {
7
+ var sPageURL = decodeURIComponent(window.location.search.substring(1)),
8
+ sURLVariables = sPageURL.split('&'),
9
+ sParameterName,
10
+ i;
11
+
12
+ for (i = 0; i < sURLVariables.length; i++) {
13
+ sParameterName = sURLVariables[i].split('=');
14
+
15
+ if (sParameterName[0] === sParam) {
16
+ return sParameterName[1] === undefined ? true : sParameterName[1];
17
+ }
18
+ }
19
+ };
20
+
21
+ $(document).ready(function() {
22
+
23
+ var ul = $(".post-list"),
24
+ q = getUrlParameter("q"),
25
+ re = new RegExp(q, "gi");
26
+
27
+ $.getJSON('{{ site.baseurl }}/search.json', function(data) {
28
+ for (var i = 0; i < data.length; i++) {
29
+ var matching = false;
30
+ if (data[i].title.search(re) >= 0) {
31
+ matching = true;
32
+ } else if (data[i].date.search(re) >= 0) {
33
+ matching = true;
34
+ } else if (data[i].category.search(re) >= 0) {
35
+ matching = true;
36
+ } else if (data[i].tags.search(re) >= 0) {
37
+ matching = true;
38
+ } else if (data[i].content.search(re) >= 0) {
39
+ matching = true;
40
+ }
41
+
42
+ if (matching == true) {
43
+ ul.append(
44
+ $('<li>').append(
45
+ $('<span>', {'class': 'post-meta', 'text': data[i].date}),
46
+ $('<h3>').append(
47
+ $('<a>', {'class': 'post-link', 'href': data[i].url, 'text': data[i].title})
48
+ )
49
+ )
50
+ );
51
+ }
52
+ }
53
+ });
54
+
55
+ });
56
+ </script>
@@ -0,0 +1,7 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+
5
+ {% include search.html %}
6
+
7
+ <ul class="post-list"></ul>
@@ -0,0 +1,17 @@
1
+ ---
2
+ layout: null
3
+ permalink: /search.json/
4
+ ---
5
+ {% assign date_format = site.minima.date_format | default: "%b %-d, %Y" %}
6
+ [
7
+ {% for post in site.posts %}
8
+ {
9
+ "title" : "{{ post.title | escape }}",
10
+ "content" : "{{ post.content | slugify }}",
11
+ "category" : "{{ post.category }}",
12
+ "tags" : "{{ post.tags | join: ', ' }}",
13
+ "url" : "{{ post.url | relative_url }}",
14
+ "date" : "{{ post.date | date: date_format }}"
15
+ } {% unless forloop.last %},{% endunless %}
16
+ {% endfor %}
17
+ ]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-readthedocs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timothée Mazzucotelli
@@ -66,18 +66,21 @@ files:
66
66
  - _includes/google-analytics.html
67
67
  - _includes/head.html
68
68
  - _includes/header.html
69
+ - _includes/search.html
69
70
  - _includes/sidebar.html
70
71
  - _includes/social.html
71
72
  - _layouts/default.html
72
73
  - _layouts/home.html
73
74
  - _layouts/page.html
74
75
  - _layouts/post.html
76
+ - _layouts/search.html
75
77
  - _sass/minima.scss
76
78
  - _sass/minima/_base.scss
77
79
  - _sass/minima/_layout.scss
78
80
  - _sass/minima/_syntax-highlighting.scss
79
81
  - assets/main.scss
80
82
  - assets/minima-social-icons.svg
83
+ - assets/search.json
81
84
  homepage: https://github.com/Pawamoy/jekyll-readthedocs
82
85
  licenses:
83
86
  - MIT