jekyll-rtd-theme 0.1.9 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -5
  3. data/_includes/addons.liquid +4 -2
  4. data/_includes/addons/{source/analytics.liquid → analytics.liquid} +1 -3
  5. data/_includes/addons/{source/github.liquid → github.liquid} +0 -0
  6. data/_includes/addons/i18n.liquid +13 -0
  7. data/_includes/addons/{source/gems.liquid → plugins.liquid} +1 -1
  8. data/_includes/album.liquid +2 -2
  9. data/_includes/assets/common.js +40 -0
  10. data/_includes/assets/search.js +76 -0
  11. data/_includes/breadcrumbs.liquid +8 -2
  12. data/_includes/extend/list.liquid +2 -2
  13. data/_includes/extend/toctree.liquid +16 -5
  14. data/_includes/footer.liquid +4 -4
  15. data/_includes/i18n/en.liquid +4 -2
  16. data/_includes/i18n/fr.liquid +29 -0
  17. data/_includes/i18n/it.liquid +29 -0
  18. data/_includes/i18n/ja.liquid +29 -0
  19. data/_includes/i18n/ko.liquid +29 -0
  20. data/_includes/i18n/ru.liquid +29 -0
  21. data/_includes/i18n/{zh.liquid → zh-cn.liquid} +3 -1
  22. data/_includes/list.liquid +1 -1
  23. data/_includes/reset/defaults.liquid +40 -33
  24. data/_includes/reset/i18n.liquid +30 -2
  25. data/_includes/reset/languages.liquid +110 -0
  26. data/_includes/reset/workdir.liquid +17 -1
  27. data/_includes/toctree.liquid +1 -1
  28. data/_layouts/default.liquid +228 -2
  29. data/_sass/_album.scss +1 -1
  30. data/_sass/_embed.scss +1 -1
  31. data/_sass/fluid.scss +1 -1
  32. data/_sass/site.scss +13 -10
  33. data/assets/404.liquid +1 -0
  34. data/assets/favicon.svg +1 -1
  35. data/assets/js/html5shiv.min.js +4 -0
  36. data/assets/robots.txt +1 -1
  37. data/assets/search.liquid +17 -1
  38. data/assets/sitemap.liquid +17 -0
  39. metadata +20 -20
  40. data/_includes/addons/analytics/baidu.liquid +0 -18
  41. data/_includes/addons/analytics/cnzz.liquid +0 -4
  42. data/_includes/addons/analytics/google.liquid +0 -18
  43. data/_includes/addons/comments/disqus.liquid +0 -10
  44. data/_includes/addons/seo/og.liquid +0 -7
  45. data/_includes/addons/seo/schema.liquid +0 -10
  46. data/_includes/assets/site.js +0 -125
  47. data/_includes/reset/schema.liquid +0 -2
  48. data/_includes/searchbox.liquid +0 -5
  49. data/_layouts/basic.liquid +0 -107
  50. data/assets/sitemap.xml +0 -18
@@ -22,4 +22,4 @@
22
22
  width: 100%;
23
23
  }
24
24
  }
25
- }
25
+ }
@@ -20,4 +20,4 @@
20
20
  max-width: 100%;
21
21
  }
22
22
  }
23
- }
23
+ }
@@ -4,4 +4,4 @@
4
4
  .wy-nav-content {
5
5
  max-width: none;
6
6
  }
7
- }
7
+ }
@@ -1,6 +1,6 @@
1
1
  @import "_album.scss";
2
2
  @import "_embed.scss";
3
-
3
+ /* custom */
4
4
  p {
5
5
  font-size: 15px;
6
6
  }
@@ -11,21 +11,21 @@ footer {
11
11
  text-align: center;
12
12
  }
13
13
  }
14
-
14
+ /* breadcrumbs icon */
15
15
  .fa-angle-double-right {
16
16
  font-size: 13px;
17
17
  }
18
-
18
+ /* fixed the addon overflow */
19
19
  .rst-versions {
20
20
  &.shift-up {
21
21
  overflow-y: auto;
22
22
  }
23
23
  }
24
-
24
+ /* fixed the toctree padding */
25
25
  .wy-nav-side {
26
26
  padding-bottom: 3em;
27
27
  }
28
-
28
+ /* mobile title margin, not the best method, flex should be better */
29
29
  .wy-nav-top {
30
30
  a {
31
31
  margin-left: -30px;
@@ -33,31 +33,32 @@ footer {
33
33
  }
34
34
 
35
35
  .rst-content {
36
+ /* fixed the long list */
36
37
  ol,
37
38
  ul {
38
39
  overflow-x: auto;
39
40
  }
40
-
41
+ /* fixed link>code */
41
42
  a code.literal {
42
43
  color: #2980b9;
43
44
  }
44
-
45
+ /* custom */
45
46
  code,
46
47
  div[class^=highlight] pre,
47
48
  pre {
48
49
  font-family: monospace;
49
50
  font-size: 12px;
50
51
  }
51
-
52
+ /* theme copyright */
52
53
  .copyright-rtd {
53
54
  display: none;
54
55
  }
55
-
56
+ /* view box of search results */
56
57
  .highlighted-box {
57
58
  border: 1px solid #f1c40f;
58
59
  }
59
60
  }
60
-
61
+ /* fixed the last of search results display */
61
62
  #search-results {
62
63
  li:last-child {
63
64
  border-bottom: 0;
@@ -66,12 +67,14 @@ footer {
66
67
  }
67
68
  @media screen and (max-width: 768px) {
68
69
  .wy-nav-content-wrap {
70
+ /* custom */
69
71
  .wy-nav-content {
70
72
  padding: 1em;
71
73
  }
72
74
  }
73
75
  }
74
76
  @media screen and (max-width: 480px) {
77
+ /* show edit on mobile */
75
78
  .wy-breadcrumbs li.wy-breadcrumbs-aside {
76
79
  display: initial;
77
80
  }
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  permalink: /404.html
3
+ layout: default
3
4
  ---
4
5
 
5
6
  {%- include reset/i18n.liquid -%}
@@ -2,4 +2,4 @@
2
2
  <path d="M0 0h24v24H0z" fill="none"/>
3
3
  <path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-5 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z"/>
4
4
  </svg>
5
- <!-- material-design-icons article -->
5
+ <!-- material-design-icons article -->
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
3
+ */
4
+ !function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3-pre",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document);
@@ -6,4 +6,4 @@ permalink: /robots.txt
6
6
  User-agent: *
7
7
  Allow: /
8
8
 
9
- Sitemap: {{ "sitemap.xml" | absolute_url }}
9
+ Sitemap: {{ "sitemap.xml" | absolute_url | replace: "http://", "https://" }}
@@ -1,8 +1,9 @@
1
1
  ---
2
2
  permalink: /search.html
3
- layout: basic
3
+ layout: default
4
4
  ---
5
5
 
6
+ {%- include reset/site_pages.liquid -%}
6
7
  {%- include reset/i18n.liquid -%}
7
8
 
8
9
  <div id="search-results">
@@ -10,3 +11,18 @@ layout: basic
10
11
  <p class="search-summary"></p>
11
12
  <ul class="search"></ul>
12
13
  </div>
14
+
15
+ <script>
16
+ const i18n = {
17
+ {%- for lang in site_langs -%}
18
+ {%- include i18n/{{ lang }}.liquid %}
19
+ "{{ lang }}": {
20
+ search_docs: "{{ __search_docs }}",
21
+ search_results: "{{ __search_results }}",
22
+ search_results_found: "{{ __search_results_found }}",
23
+ search_results_not_found: "{{ __search_results_not_found }}"
24
+ }{% unless forloop.last %},{% endunless %}
25
+ {%- endfor -%}
26
+ };
27
+ </script>
28
+ <script>{% include assets/search.js %}</script>
@@ -0,0 +1,17 @@
1
+ ---
2
+ layout: plugins/compress
3
+ permalink: /sitemap.xml
4
+ ---
5
+
6
+ {%- include reset/site_pages.liquid -%}
7
+
8
+ <?xml version="1.0" encoding="UTF-8"?>
9
+ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
10
+ {%- for page in site_pages -%}
11
+ <url>
12
+ <loc>{{ page.url | absolute_url | replace: "http://", "https://" | xml_escape }}</loc>
13
+ <priority>{{ page.content | size | divided_by: 2048.0 | times: 10 | ceil | divided_by: 10.0 | at_least: 0.1 | at_most: 1.0 }}</priority>
14
+ <lastmod>{{ site.time | date_to_xmlschema }}</lastmod>
15
+ </url>
16
+ {%- endfor %}
17
+ </urlset>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-rtd-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - saowang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-31 00:00:00.000000000 Z
11
+ date: 2020-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: github-pages
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '206'
19
+ version: '207'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '206'
26
+ version: '207'
27
27
  description:
28
28
  email:
29
29
  - saowang@outlook.com
@@ -34,35 +34,34 @@ files:
34
34
  - LICENSE
35
35
  - README.md
36
36
  - _includes/addons.liquid
37
- - _includes/addons/analytics/baidu.liquid
38
- - _includes/addons/analytics/cnzz.liquid
39
- - _includes/addons/analytics/google.liquid
40
- - _includes/addons/comments/disqus.liquid
41
- - _includes/addons/seo/og.liquid
42
- - _includes/addons/seo/schema.liquid
43
- - _includes/addons/source/analytics.liquid
44
- - _includes/addons/source/gems.liquid
45
- - _includes/addons/source/github.liquid
37
+ - _includes/addons/analytics.liquid
38
+ - _includes/addons/github.liquid
39
+ - _includes/addons/i18n.liquid
40
+ - _includes/addons/plugins.liquid
46
41
  - _includes/album.liquid
42
+ - _includes/assets/common.js
47
43
  - _includes/assets/custom.js
48
44
  - _includes/assets/custom.scss
49
- - _includes/assets/site.js
45
+ - _includes/assets/search.js
50
46
  - _includes/breadcrumbs.liquid
51
47
  - _includes/extend/list.liquid
52
48
  - _includes/extend/tabs.liquid
53
49
  - _includes/extend/toctree.liquid
54
50
  - _includes/footer.liquid
55
51
  - _includes/i18n/en.liquid
56
- - _includes/i18n/zh.liquid
52
+ - _includes/i18n/fr.liquid
53
+ - _includes/i18n/it.liquid
54
+ - _includes/i18n/ja.liquid
55
+ - _includes/i18n/ko.liquid
56
+ - _includes/i18n/ru.liquid
57
+ - _includes/i18n/zh-cn.liquid
57
58
  - _includes/list.liquid
58
59
  - _includes/reset/defaults.liquid
59
60
  - _includes/reset/i18n.liquid
60
- - _includes/reset/schema.liquid
61
+ - _includes/reset/languages.liquid
61
62
  - _includes/reset/site_pages.liquid
62
63
  - _includes/reset/workdir.liquid
63
- - _includes/searchbox.liquid
64
64
  - _includes/toctree.liquid
65
- - _layouts/basic.liquid
66
65
  - _layouts/default.liquid
67
66
  - _layouts/plugins/compress.liquid
68
67
  - _sass/_album.scss
@@ -113,12 +112,13 @@ files:
113
112
  - assets/css/theme.css
114
113
  - assets/favicon.svg
115
114
  - assets/js/anchor.min.js
115
+ - assets/js/html5shiv.min.js
116
116
  - assets/js/jquery.min.js
117
117
  - assets/js/theme.js
118
118
  - assets/pages.json
119
119
  - assets/robots.txt
120
120
  - assets/search.liquid
121
- - assets/sitemap.xml
121
+ - assets/sitemap.liquid
122
122
  homepage: https://github.com/rundocs/jekyll-rtd-theme
123
123
  licenses:
124
124
  - MIT
@@ -141,5 +141,5 @@ requirements: []
141
141
  rubygems_version: 3.1.2
142
142
  signing_key:
143
143
  specification_version: 4
144
- summary: Just another documentation theme compatible with GitHub Pages, based on sphinx_rtd_theme
144
+ summary: Just another jekyll docs theme compatible with GitHub Pages, based on sphinx_rtd_theme
145
145
  test_files: []
@@ -1,18 +0,0 @@
1
- {%- if site.baidu.linksubmit -%}
2
- <script>
3
- (function(script) {
4
- script.src = "https://zz.bdstatic.com/linksubmit/push.js";
5
- document.head.appendChild(script);
6
- })(document.createElement("script"));
7
- </script>
8
- {%- endif -%}
9
-
10
- {%- if site.baidu.hm -%}
11
- <script>
12
- var _hmt = _hmt || [];
13
- (function(script) {
14
- script.src = "https://hm.baidu.com/hm.js?{{ site.baidu.hm }}";
15
- document.head.appendChild(script);
16
- })(document.createElement("script"));
17
- </script>
18
- {%- endif -%}
@@ -1,4 +0,0 @@
1
- {%- if site.cnzz -%}
2
- <span id="cnzz_stat_icon_{{ site.cnzz }}" style="display: none;"></span>
3
- <script async src="https://v1.cnzz.com/z_stat.php?id={{ site.cnzz }}"></script>
4
- {%- endif -%}
@@ -1,18 +0,0 @@
1
- {%- if site.google.gtag -%}
2
- <!-- Google Analytics -->
3
- <script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google.gtag }}"></script>
4
- <script>
5
- window.dataLayer = window.dataLayer || [];
6
-
7
- function gtag() {
8
- dataLayer.push(arguments);
9
- }
10
- gtag("js", new Date());
11
- gtag("config", "{{ site.google.gtag }}");
12
- </script>
13
- {%- endif -%}
14
-
15
- {%- if site.google.adsense -%}
16
- <!-- Google AdSense -->
17
- <script data-ad-client="{{ site.google.adsense }}" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
18
- {%- endif -%}
@@ -1,10 +0,0 @@
1
- {% if site.disqus %}
2
- <div id="disqus_thread" class="articleComments"></div>
3
- <script>
4
- (function(script) {
5
- script.src = "https://{{ site.disqus }}.disqus.com/embed.js";
6
- script.setAttribute("data-timestamp", +new Date());
7
- document.head.appendChild(script);
8
- })(document.createElement("script"));
9
- </script>
10
- {% endif %}
@@ -1,7 +0,0 @@
1
- <meta property="og:title" content="{{ title }}">
2
- <meta property="og:description" content="{{ description }}">
3
- <meta property="og:locale" content="{{ lang }}">
4
- <meta property="og:url" content="{{ schema_url }}">
5
- <meta property="og:type" content="article">
6
- <meta property="article:author" content="{{ author }}">
7
- <meta property="article:modified_time" content="{{ schema_lastmod }}">
@@ -1,10 +0,0 @@
1
- <script type="application/ld+json">
2
- {
3
- "@context": "http://schema.org",
4
- "@type": "Article",
5
- "name": "{{ title }}",
6
- "author": "{{ author }}",
7
- "url": "{{ schema_url }}",
8
- "dateModified": "{{ schema_lastmod }}"
9
- }
10
- </script>
@@ -1,125 +0,0 @@
1
- function feedback(type, message) {
2
- console.log(`feedback: https://github.com/rundocs/jekyll-rtd-theme/issues?q=${type}+${message}`);
3
- }
4
-
5
- function highlight() {
6
- let text = new URL(location.href).searchParams.get("highlight");
7
- let regexp = new RegExp(text, "im");
8
-
9
- if (text) {
10
- $(".section").find("*").each(function() {
11
- if (this.outerHTML.match(regexp)) {
12
- $(this).addClass("highlighted-box");
13
- }
14
- });
15
- $(".section").find(".highlighted-box").each(function() {
16
- if (($(this).find(".highlighted-box").length > 0)) {
17
- $(this).removeClass("highlighted-box");
18
- }
19
- });
20
- }
21
- }
22
-
23
- function search(data) {
24
- let text = new URL(location.href).searchParams.get("q");
25
- let results = [];
26
- let regexp = new RegExp(text, "im");
27
-
28
- function slice(content, min, max) {
29
- return content.slice(min, max).replace(regexp, (match) => `<span class="highlighted">${match}</span>`);
30
- }
31
- for (page of data) {
32
- let [title, content] = [null, null];
33
- try {
34
- if (page.title) {
35
- title = page.title.match(regexp);
36
- } else {
37
- if (page.url == "/") {
38
- page.title = "{{ site.title }}";
39
- } else {
40
- page.title = page.url;
41
- }
42
- }
43
- } catch (e) {
44
- feedback("search", e.message);
45
- }
46
- try {
47
- if (page.content) {
48
- page.content = $("<div/>").html(page.content).text();
49
- content = page.content.match(regexp);
50
- }
51
- } catch (e) {
52
- feedback("search", e.message);
53
- }
54
- if (title || content) {
55
- let result = [`<a href="{{ site.baseurl }}${page.url}?highlight=${text}">${page.title}</a>`];
56
- if (content) {
57
- let [min, max] = [content.index - 100, content.index + 100];
58
- let [prefix, suffix] = ["...", "..."];
59
-
60
- if (min < 0) {
61
- prefix = "";
62
- min = 0;
63
- }
64
- if (max > page.content.length) {
65
- suffix = "";
66
- max = page.content.length;
67
- }
68
- result.push(`<p class="context">${prefix}${slice(page.content ,min, max)}${suffix}</p>`);
69
- }
70
- results.push(`<li>${result.join("")}</li>`);
71
- }
72
- }
73
- if (results.length > 0 && text.length > 0) {
74
- $("#search-results ul.search").html(results.join(""));
75
- $("#search-results p.search-summary").html("{{ __search_results_found }}".replace("#", results.length));
76
- } else {
77
- $("#search-results ul.search").empty();
78
- $("#search-results p.search-summary").html("{{ __search_results_not_found }}");
79
- }
80
- $("#rtd-search-form [name='q']").val(text);
81
- $("#search-results h2").html("{{ __search_results }}");
82
- }
83
-
84
- function reset() {
85
- const link = $(".wy-menu-vertical").find(`[href="${location.pathname}"]`);
86
- if (link.length > 0) {
87
- $(".wy-menu-vertical .current").removeClass("current");
88
- link.addClass("current");
89
- link.closest("li.toctree-l1").parent().addClass("current");
90
- link.closest("li.toctree-l1").addClass("current");
91
- link.closest("li.toctree-l2").addClass("current");
92
- link.closest("li.toctree-l3").addClass("current");
93
- link.closest("li.toctree-l4").addClass("current");
94
- link.closest("li.toctree-l5").addClass("current");
95
- }
96
- }
97
-
98
- function admonition() {
99
- const items = {
100
- note: "{{ __note }}",
101
- tip: "{{ __tip }}",
102
- warning: "{{ __warning }}",
103
- danger: "{{ __danger }}"
104
- };
105
- for (let item in items) {
106
- let content = $(`.language-${item}`).html();
107
- $(`.language-${item}`).replaceWith(`<div class="admonition ${item}"><p class="admonition-title">${items[item]}</p><p>${content}</p></div>`);
108
- }
109
- }
110
-
111
- $(document).ready(function() {
112
- if (location.pathname == "{{ site.baseurl }}/search.html") {
113
- $.ajax({
114
- dataType: "json",
115
- url: "{{ site.baseurl }}/pages.json"
116
- })
117
- .done(search)
118
- .fail((xhr, message) => feedback("search", message));
119
- }
120
- admonition();
121
- anchors.add();
122
- highlight();
123
- SphinxRtdTheme.Navigation.reset = reset;
124
- SphinxRtdTheme.Navigation.enable(true);
125
- });