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.
- checksums.yaml +4 -4
- data/README.md +35 -22
- data/_includes/assets/defaults.liquid +69 -0
- data/_includes/assets/i18n.liquid +1 -0
- data/_includes/{reset → assets}/site_pages.liquid +0 -0
- data/_includes/{extend → assets}/tabs.liquid +0 -0
- data/_includes/{reset → assets}/workdir.liquid +0 -0
- data/_includes/{breadcrumbs.liquid → class/_breadcrumbs.liquid} +10 -4
- data/_includes/{footer.liquid → class/_footer.liquid} +14 -9
- data/_includes/{extend/toctree.liquid → class/_toctree.extend.liquid} +5 -5
- data/_includes/{toctree.liquid → class/_toctree.liquid} +4 -4
- data/_includes/class/addons-wrap.liquid +26 -0
- data/_includes/{addons → class/addons}/analytics.liquid +2 -2
- data/_includes/class/addons/github.liquid +21 -0
- data/_includes/class/content-wrap.liquid +20 -0
- data/_includes/class/sidebar-wrap.liquid +18 -0
- data/_includes/head/links.liquid +16 -0
- data/_includes/head/metadata.liquid +21 -0
- data/_includes/head/script.extension.liquid +24 -0
- data/_includes/head/script.liquid +16 -0
- data/_includes/head/script.schema.liquid +27 -0
- data/_includes/head/title.liquid +1 -0
- data/_includes/{extend/list.liquid → list.extend.liquid} +5 -5
- data/_includes/list.liquid +3 -3
- data/_includes/shortcodes/danger.liquid +8 -6
- data/_includes/shortcodes/note.liquid +8 -6
- data/_includes/shortcodes/tip.liquid +8 -6
- data/_includes/shortcodes/warning.liquid +8 -6
- data/_layouts/default.liquid +16 -184
- data/_layouts/plugins/extension.liquid +3 -1
- data/_sass/_icons.scss +4 -0
- data/_sass/_layout.scss +3 -4
- data/_sass/_variables.scss +11 -8
- data/_sass/class/admonition.scss +47 -0
- data/_sass/class/container.scss +1 -1
- data/_sass/class/markdown-body.scss +15 -7
- data/_sass/class/sidebar-wrap.scss +31 -20
- data/_sass/class/title.scss +0 -1
- data/_sass/theme.scss +8 -7
- data/assets/404.liquid +3 -1
- data/assets/css/theme.min.css +1 -1
- data/assets/js/mermaid.min.js +0 -1
- data/assets/js/theme.js +95 -18
- data/assets/js/theme.min.js +1 -1
- data/assets/pages.liquid +1 -1
- data/assets/search.liquid +5 -14
- data/assets/sitemap.liquid +1 -1
- data/assets/sw.caches.liquid +1 -1
- metadata +24 -15
- data/_includes/addons/github.liquid +0 -18
- data/_includes/reset/defaults.liquid +0 -54
- data/_includes/safe/shortcodes.liquid +0 -9
- 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 -%}
|
data/assets/js/search.js
DELETED
@@ -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
|
-
});
|