jekyll-rtd-theme 2.0.0.pre.beta → 2.0.0.pre.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +35 -22
  3. data/_includes/assets/defaults.liquid +69 -0
  4. data/_includes/assets/i18n.liquid +1 -0
  5. data/_includes/{reset → assets}/site_pages.liquid +0 -0
  6. data/_includes/{extend → assets}/tabs.liquid +0 -0
  7. data/_includes/{reset → assets}/workdir.liquid +0 -0
  8. data/_includes/{breadcrumbs.liquid → class/_breadcrumbs.liquid} +10 -4
  9. data/_includes/{footer.liquid → class/_footer.liquid} +14 -9
  10. data/_includes/{extend/toctree.liquid → class/_toctree.extend.liquid} +5 -5
  11. data/_includes/{toctree.liquid → class/_toctree.liquid} +4 -4
  12. data/_includes/class/addons-wrap.liquid +26 -0
  13. data/_includes/{addons → class/addons}/analytics.liquid +2 -2
  14. data/_includes/class/addons/github.liquid +21 -0
  15. data/_includes/class/content-wrap.liquid +20 -0
  16. data/_includes/class/sidebar-wrap.liquid +18 -0
  17. data/_includes/head/links.liquid +16 -0
  18. data/_includes/head/metadata.liquid +21 -0
  19. data/_includes/head/script.extension.liquid +24 -0
  20. data/_includes/head/script.liquid +16 -0
  21. data/_includes/head/script.schema.liquid +27 -0
  22. data/_includes/head/title.liquid +1 -0
  23. data/_includes/{extend/list.liquid → list.extend.liquid} +5 -5
  24. data/_includes/list.liquid +3 -3
  25. data/_includes/shortcodes/danger.liquid +8 -6
  26. data/_includes/shortcodes/note.liquid +8 -6
  27. data/_includes/shortcodes/tip.liquid +8 -6
  28. data/_includes/shortcodes/warning.liquid +8 -6
  29. data/_layouts/default.liquid +16 -184
  30. data/_layouts/plugins/extension.liquid +3 -1
  31. data/_sass/_icons.scss +4 -0
  32. data/_sass/_layout.scss +3 -4
  33. data/_sass/_variables.scss +11 -8
  34. data/_sass/class/admonition.scss +47 -0
  35. data/_sass/class/container.scss +1 -1
  36. data/_sass/class/markdown-body.scss +15 -7
  37. data/_sass/class/sidebar-wrap.scss +31 -20
  38. data/_sass/class/title.scss +0 -1
  39. data/_sass/theme.scss +8 -7
  40. data/assets/404.liquid +3 -1
  41. data/assets/css/theme.min.css +1 -1
  42. data/assets/js/mermaid.min.js +0 -1
  43. data/assets/js/theme.js +95 -18
  44. data/assets/js/theme.min.js +1 -1
  45. data/assets/pages.liquid +1 -1
  46. data/assets/search.liquid +5 -14
  47. data/assets/sitemap.liquid +1 -1
  48. data/assets/sw.caches.liquid +1 -1
  49. metadata +24 -15
  50. data/_includes/addons/github.liquid +0 -18
  51. data/_includes/reset/defaults.liquid +0 -54
  52. data/_includes/safe/shortcodes.liquid +0 -9
  53. data/assets/js/search.js +0 -90
@@ -1,18 +0,0 @@
1
- <dl>
2
- <dt>{{ site.data.translate.github | default: "GitHub" }}</dt>
3
- <dd>
4
- <a href="{{ site.github.repository_url }}">
5
- <i class="fa fa-github"></i> {{ site.data.translate.homepage | default: "HomePage" }}
6
- </a>
7
- </dd>
8
- <dd>
9
- <a href="{{ site.github.issues_url }}">
10
- <i class="fa fa-question-circle-o"></i> {{ site.data.translate.issues | default: "Issues" }}
11
- </a>
12
- </dd>
13
- <dd>
14
- <a href="{{ site.github.zip_url }}">
15
- <i class="fa fa-download"></i> {{ site.data.translate.download | default: "Download" }}
16
- </a>
17
- </dd>
18
- </dl>
@@ -1,54 +0,0 @@
1
- {%- assign description = content | strip_html | split: " " | join: " " | escape | truncate: 150 -%}
2
- {%- assign version = "2.0.0-beta" -%}
3
-
4
- {%- assign schema_date = page.date | default: site.time | date_to_xmlschema -%}
5
- {%- assign schema_modi = site.time | date_to_xmlschema -%}
6
- {%- assign schema_surl = page.url | absolute_url | xml_escape -%}
7
-
8
- {% comment %} cdn {% endcomment %}
9
- {%- if site.debug -%}
10
- {%- assign cdn = site.baseurl -%}
11
- {%- else -%}
12
- {%- assign cdn = "https://cdn.jsdelivr.net/gh/rundocs/jekyll-rtd-theme@" | append: version -%}
13
- {%- endif -%}
14
-
15
- {%- include reset/site_pages.liquid %}
16
-
17
- {% comment %} title {% endcomment %}
18
- {%- case page.url -%}
19
- {%- when "/" -%}
20
- {%- assign title = site.title | append: " · " | append: site.description -%}
21
- {%- when "/search.html" -%}
22
- {%- assign title = __search | append: " · " | append: site.title -%}
23
- {%- when "/404.html" -%}
24
- {%- assign title = __404 | append: " · " | append: site.title -%}
25
- {%- else -%}
26
- {%- assign title = page.title | default: page.url | append: " · " | append: site.title -%}
27
- {%- endcase -%}
28
-
29
- {% comment %} content {% endcomment %}
30
- {%- assign content = content
31
- | replace: '’', "'"
32
- | replace: "highlighter-rouge", "highlighter-rouge notranslate" -%}
33
-
34
-
35
- {% comment %} prev and next {% endcomment %}
36
- {%- assign workdir_files = site_files | where_exp: "item", "item.dir == page.dir" -%}
37
-
38
- {%- assign _index = 0 -%}
39
- {%- for item in workdir_files %}
40
- {%- if item.url == page.url %}
41
- {%- assign _index = forloop.index -%}
42
- {%- endif %}
43
- {%- endfor -%}
44
-
45
- {%- for item in workdir_files -%}
46
- {%- assign _index_prev = _index | minus: 1 -%}
47
- {%- assign _index_next = _index | plus: 1 -%}
48
- {%- if forloop.index == _index_prev -%}
49
- {%- assign prev = item -%}
50
- {%- endif %}
51
- {%- if forloop.index == _index_next and page.url != page.dir -%}
52
- {%- assign next = item -%}
53
- {%- endif %}
54
- {%- endfor -%}
@@ -1,9 +0,0 @@
1
- {%- capture safe_list -%}
2
- mermaid
3
- note
4
- tip
5
- warning
6
- danger
7
- {%- endcapture -%}
8
-
9
- {%- assign shortcodes = safe_list | split: " " -%}
@@ -1,90 +0,0 @@
1
- function search(data) {
2
- let text = new URL(location.href).searchParams.get("q");
3
- let lang = new URL(location.href).searchParams.get("lang") || ui.lang;
4
-
5
- $("input[name='q']").val(text);
6
- $("input[name='q']").attr("placeholder", i18n[lang].search_docs + "...");
7
-
8
- let results = [];
9
- let regexp = new RegExp();
10
- try {
11
- regexp = new RegExp(text, "im");
12
- } catch (e) {
13
- $(".search").empty();
14
- $(".search-summary").html(i18n[lang].search_results_not_found);
15
- $("#search-results h2").html(i18n[lang].search_results);
16
- return debug(e.message);
17
- }
18
-
19
- function slice(content, min, max) {
20
- return content
21
- .slice(min, max)
22
- .replace(regexp, (match) => `<span class="highlighted">${match}</span>`);
23
- }
24
- for (page of data) {
25
- let [title, content] = [null, null];
26
- try {
27
- if (page.title) {
28
- title = page.title.match(regexp);
29
- } else {
30
- if (page.url == "/") {
31
- page.title = ui.title;
32
- } else {
33
- page.title = page.url;
34
- }
35
- }
36
- } catch (e) {
37
- debug(e.message);
38
- }
39
- try {
40
- if (page.content) {
41
- page.content = $("<div/>").html(page.content).text();
42
- content = page.content.match(regexp);
43
- }
44
- } catch (e) {
45
- debug(e.message);
46
- }
47
- if (title || content) {
48
- let result = [
49
- `<a href="${ui.baseurl}${page.url}?highlight=${text}">${page.title}</a>`,
50
- ];
51
- if (content) {
52
- let [min, max] = [content.index - 100, content.index + 100];
53
- let [prefix, suffix] = ["...", "..."];
54
-
55
- if (min < 0) {
56
- prefix = "";
57
- min = 0;
58
- }
59
- if (max > page.content.length) {
60
- suffix = "";
61
- max = page.content.length;
62
- }
63
- result.push(
64
- `<p class="context">${prefix}${slice(
65
- page.content,
66
- min,
67
- max
68
- )}${suffix}</p>`
69
- );
70
- }
71
- results.push(`<li>${result.join("")}</li>`);
72
- }
73
- }
74
- if (results.length > 0 && text.length > 0) {
75
- $(".search").html(results.join(""));
76
- $(".search-summary").html(
77
- i18n[lang].search_results_found.replace("#", results.length)
78
- );
79
- } else {
80
- $(".search").empty();
81
- $(".search-summary").html(i18n[lang].search_results_not_found);
82
- }
83
- $("#search-results h2").html(i18n[lang].search_results);
84
- }
85
-
86
- $(document).ready(function () {
87
- $.ajax(`${ui.baseurl}/pages.json`)
88
- .done(search)
89
- .fail((xhr, message) => debug(message));
90
- });