redeyed-jekyll-theme 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +52 -0
  4. data/_config.yml +328 -0
  5. data/_data/assets/cross-origin.yml +65 -0
  6. data/_data/assets/self-host.yml +51 -0
  7. data/_data/authors.yml +12 -0
  8. data/_data/contact.yml +16 -0
  9. data/_data/locale/en.yml +78 -0
  10. data/_data/share.yml +16 -0
  11. data/_includes/back-to-top.html +2 -0
  12. data/_includes/breadcrumbs.html +1 -0
  13. data/_includes/comments.html +0 -0
  14. data/_includes/copyright.html +1 -0
  15. data/_includes/datetime.html +0 -0
  16. data/_includes/favicons.html +14 -0
  17. data/_includes/footer.html +1 -0
  18. data/_includes/ga-site-tag.html +8 -0
  19. data/_includes/google-tags-body.html +4 -0
  20. data/_includes/google-tags-head.html +6 -0
  21. data/_includes/head.html +72 -0
  22. data/_includes/header-banner.html +1 -0
  23. data/_includes/header-wide.html +1 -0
  24. data/_includes/header.html +1 -0
  25. data/_includes/javascript.html +89 -0
  26. data/_includes/jsdelivr-combine.html +18 -0
  27. data/_includes/lang.html +6 -0
  28. data/_includes/mermaid.html +1 -0
  29. data/_includes/mode-toggle.html +138 -0
  30. data/_includes/navbar.html +6 -0
  31. data/_includes/no-linenos.html +0 -0
  32. data/_includes/options.html +13 -0
  33. data/_includes/pagination.html +0 -0
  34. data/_includes/panel-bottom.html +1 -0
  35. data/_includes/panel-foot-2.html +1 -0
  36. data/_includes/panel-foot-3.html +1 -0
  37. data/_includes/panel-foot-4.html +1 -0
  38. data/_includes/panel-foot-full.html +1 -0
  39. data/_includes/panel-top-2.html +1 -0
  40. data/_includes/panel-top-3.html +1 -0
  41. data/_includes/panel-top-4.html +1 -0
  42. data/_includes/panel-top-full.html +1 -0
  43. data/_includes/post-nav.html +0 -0
  44. data/_includes/post-share.html +0 -0
  45. data/_includes/readtime.html +0 -0
  46. data/_includes/related-posts.html +0 -0
  47. data/_includes/search-loader.html +46 -0
  48. data/_includes/search-results.html +1 -0
  49. data/_includes/sidebar.html +0 -0
  50. data/_includes/toc.html +0 -0
  51. data/_javascript/common/back-to-top.js +20 -0
  52. data/_javascript/common/mode-toggle.js +13 -0
  53. data/_javascript/common/scroll-helper.js +36 -0
  54. data/_javascript/common/search-display.js +129 -0
  55. data/_javascript/common/sidebar.js +30 -0
  56. data/_javascript/common/tooltip-loader.js +6 -0
  57. data/_javascript/common/topbar-switcher.js +90 -0
  58. data/_javascript/common/topbar-title.js +67 -0
  59. data/_javascript/utils/category-collapse.js +30 -0
  60. data/_javascript/utils/checkbox.js +12 -0
  61. data/_javascript/utils/clipboard.js +133 -0
  62. data/_javascript/utils/img-extra.js +47 -0
  63. data/_javascript/utils/locale-datetime.js +45 -0
  64. data/_javascript/utils/pageviews.js +250 -0
  65. data/_javascript/utils/smooth-scroll.js +96 -0
  66. data/_layouts/archive.html +0 -0
  67. data/_layouts/categories.html +0 -0
  68. data/_layouts/category.html +0 -0
  69. data/_layouts/compress.html +10 -0
  70. data/_layouts/default.html +5 -0
  71. data/_layouts/page.html +5 -0
  72. data/_layouts/panel-both.html +14 -0
  73. data/_layouts/panel-left.html +14 -0
  74. data/_layouts/panel-none.html +81 -0
  75. data/_layouts/panel-right.html +14 -0
  76. data/_layouts/post.html +5 -0
  77. data/_layouts/tag.html +0 -0
  78. data/_layouts/tags.html +0 -0
  79. data/_sass/addon/common.scss +1630 -0
  80. data/_sass/addon/mixins.scss +144 -0
  81. data/_sass/addon/syntax.scss +0 -0
  82. data/_sass/addon/variables.scss +31 -0
  83. data/_sass/colors/brew-scheme.scss +7 -0
  84. data/_sass/colors/dark-scheme.scss +21 -0
  85. data/_sass/colors/dark-syntax.scss +88 -0
  86. data/_sass/colors/light-scheme.scss +7 -0
  87. data/_sass/colors/light-syntax.scss +84 -0
  88. data/_sass/layout/page.scss +0 -0
  89. data/_sass/layout/panel-both.scss +0 -0
  90. data/_sass/layout/panel-left.scss +0 -0
  91. data/_sass/layout/panel-none.scss +146 -0
  92. data/_sass/layout/panel-right.scss +0 -0
  93. data/_sass/layout/post.scss +0 -0
  94. data/_sass/redeyed-jekyll-theme.scss +26 -0
  95. data/_sass/variables-hook.scss +0 -0
  96. data/assets/css/style.scss +8 -0
  97. data/assets/img/d20R/d20R-128.png +0 -0
  98. data/assets/img/d20R/d20R-16.png +0 -0
  99. data/assets/img/d20R/d20R-200.png +0 -0
  100. data/assets/img/d20R/d20R-240.png +0 -0
  101. data/assets/img/d20R/d20R-32.png +0 -0
  102. data/assets/img/d20R/d20R-320.png +0 -0
  103. data/assets/img/d20R/d20R-48.png +0 -0
  104. data/assets/img/d20R/d20R-500.png +0 -0
  105. data/assets/img/d20R/d20R-600.png +0 -0
  106. data/assets/img/d20R/d20R-64.png +0 -0
  107. data/assets/img/d20R/d20R.svg +98 -0
  108. data/assets/img/d20RB/d20RB-128.png +0 -0
  109. data/assets/img/d20RB/d20RB-16.png +0 -0
  110. data/assets/img/d20RB/d20RB-200.png +0 -0
  111. data/assets/img/d20RB/d20RB-240.png +0 -0
  112. data/assets/img/d20RB/d20RB-32.png +0 -0
  113. data/assets/img/d20RB/d20RB-320.png +0 -0
  114. data/assets/img/d20RB/d20RB-48.png +0 -0
  115. data/assets/img/d20RB/d20RB-500.png +0 -0
  116. data/assets/img/d20RB/d20RB-600.png +0 -0
  117. data/assets/img/d20RB/d20RB-64.png +0 -0
  118. data/assets/img/d20RB/d20RB.svg +103 -0
  119. data/assets/img/favicons/android-chrome-192x192.png +0 -0
  120. data/assets/img/favicons/android-chrome-512x512.png +0 -0
  121. data/assets/img/favicons/apple-touch-icon.png +0 -0
  122. data/assets/img/favicons/browserconfig.xml +12 -0
  123. data/assets/img/favicons/favicon-16x16.png +0 -0
  124. data/assets/img/favicons/favicon-32x32.png +0 -0
  125. data/assets/img/favicons/favicon.ico +0 -0
  126. data/assets/img/favicons/mstile-150x150.png +0 -0
  127. data/assets/img/favicons/mstile-310x150.png +0 -0
  128. data/assets/img/favicons/mstile-310x310.png +0 -0
  129. data/assets/img/favicons/mstile-70x70.png +0 -0
  130. data/assets/img/favicons/safari-pinned-tab.svg +112 -0
  131. data/assets/img/favicons/site.webmanifest +19 -0
  132. data/assets/js/data/search.json +19 -0
  133. data/assets/js/data/swcache.js +54 -0
  134. data/assets/js/fetch.js +458 -0
  135. data/assets/js/pwa/app.js +47 -0
  136. data/assets/js/pwa/sw.js +89 -0
  137. data/assets/js/pwa/unregister.js +12 -0
  138. data/src/404.html +10 -0
  139. data/src/favicon.ico +0 -0
  140. data/src/feed.xml +61 -0
  141. data/src/index.md +22 -0
  142. data/src/robots.txt +10 -0
  143. data/src/style/html.md +7 -0
  144. data/src/style/index.md +11 -0
  145. data/src/style/markdown.md +108 -0
  146. metadata +375 -0
@@ -0,0 +1 @@
1
+ {% comment %} FOOTER {% endcomment %}
@@ -0,0 +1,8 @@
1
+ {% comment %} Global site tag (gtag.js) - Google Analytics {% endcomment %}
2
+ <script async src="https://www.googletagmanager.com/gtag/js?id=G-E941CYN0XY"></script>
3
+ <script>
4
+ window.dataLayer = window.dataLayer || [];
5
+ function gtag(){dataLayer.push(arguments);}
6
+ gtag('js', new Date());
7
+ gtag('config', 'G-E941CYN0XY');
8
+ </script>
@@ -0,0 +1,4 @@
1
+ {% comment %} Google Tag Manager (noscript) {% endcomment %}
2
+ <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-58TMKPV"
3
+ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
4
+ <!-- End Google Tag Manager (noscript) -->
@@ -0,0 +1,6 @@
1
+ {% comment %} Google Tag Manager {% endcomment %}
2
+ <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
3
+ new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
4
+ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;
5
+ f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-58TMKPV');</script>
6
+ {% comment %} End Google Tag Manager {% endcomment %}
@@ -0,0 +1,72 @@
1
+ {% comment %} HEAD ELEMENT {% endcomment %}
2
+ <head>
3
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
5
+ {% if site.prefer_datetime_locale %}
6
+ <meta name="prefer-datetime-locale" content="{{ site.prefer_datetime_locale }}">
7
+ {% endif %}
8
+ {% capture seo_tags %}{% seo title=false %}{% endcapture %}
9
+ {% if site.img_cdn and seo_tags contains 'og:image' %}
10
+ {% assign properties = 'og:image,twitter:image' | split: ',' %}
11
+ {% for prop in properties %}
12
+ {% if site.img_cdn contains '//' %}
13
+ {% capture target %}<meta property="{{ prop }}" content="{{ site.url }}">{% endcapture %}
14
+ {% capture replacement %}<meta property="{{ prop }}" content="{{ site.img_cdn }}">{% endcapture %}
15
+ {% else %}
16
+ {% capture target %}<meta property="{{ prop }}" content="{{ site.url }}{{ site.baseurl }}">{% endcapture %}
17
+ {% assign replacement = target | append: site.img_cdn %}
18
+ {% endif %}
19
+ {% assign seo_tags = seo_tags | replace: target, replacement %}
20
+ {% endfor %}
21
+ {% endif %}
22
+
23
+ {{ seo_tags }}
24
+
25
+ <title>{% unless page.layout == "home" %}{{ page.title | append: " | "}}{% endunless %}{{ site.title }}</title>
26
+
27
+ {% include favicons.html %}
28
+
29
+ {% if site.resources.ignore_env != jekyll.environment and site.resources.self_hosted %}
30
+ <link href="{{ site.data.assets[origin].webfonts | relative_url }}" rel="stylesheet">
31
+ {% else %}
32
+ {% for cdn in site.data.assets[origin].cdns %}
33
+ <link rel="preconnect" href="{{ cdn.url }}" {{ cdn.args }}>
34
+ <link rel="dns-prefetch" href="{{ cdn.url }}" {{ cdn.args }}>
35
+ {% endfor %}
36
+ <link rel="stylesheet" href="{{ site.data.assets[origin].webfonts | relative_url }}">
37
+ {% endif %}
38
+
39
+ {% if jekyll.environment == 'production' and site.google_analytics.id != empty and site.google_analytics.id %}
40
+ {% include ga-site-tag.html %}
41
+ {% endif %}
42
+
43
+ <!-- Bootstrap -->
44
+ <link rel="stylesheet" href="{{ site.data.assets[origin].bootstrap.css | relative_url}}">
45
+
46
+ <!-- Font Awesome -->
47
+ <link rel="stylesheet" href="{{ site.data.assets[origin].fontawesome.css | relative_url }}">
48
+
49
+ <!-- Material Design -->
50
+ <link rel="stylesheet" href="{{ site.data.assets[origin].material-design.css | relative_url}}">
51
+
52
+ <!-- Main Site Stylesheet -->
53
+ <link rel="stylesheet" href="{{ '/assets/css/style.css' | relative_url }}">
54
+
55
+ {% if site.toc and page.toc %}
56
+ <!-- Bootstrap TOC -->
57
+ <link rel="stylesheet" href="{{ site.data.assets[origin].bootstrap-toc.css | relative_url }}">
58
+ {% endif %}
59
+
60
+ {% if page.layout == 'page' or page.layout == 'post' %}
61
+ <!-- Manific Popup -->
62
+ <link rel="stylesheet" href="{{ site.data.assets[origin].magnific-popup.css | relative_url }}">
63
+ {% endif %}
64
+
65
+ <!-- JQuery -->
66
+ <script src="{{ site.data.assets[origin].jquery.js | relative_url }}"></script>
67
+
68
+ {% unless site.theme_mode %}
69
+ {% include mode-toggle.html %}
70
+ {% endunless %}
71
+
72
+ </head>
@@ -0,0 +1 @@
1
+ {% comment %} HEADER-BANNER {% endcomment %}
@@ -0,0 +1 @@
1
+ {% comment %} HEADER-WIDE {% endcomment %}
@@ -0,0 +1 @@
1
+ {% comment %} HEADER-REGULAR {% endcomment %}
@@ -0,0 +1,89 @@
1
+ <!--
2
+ JS selector for site.
3
+ -->
4
+ {% if page.layout == 'post' %}
5
+ {% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %}
6
+ <!-- pv-report needs countup.js -->
7
+ <script async src="{{ site.data.assets[origin].countup.js | relative_url }}"></script>
8
+ <script defer src="{{ '/assets/js/dist/pvreport.min.js' | relative_url }}"></script>
9
+ {% endif %}
10
+ {% endif %}
11
+
12
+ {% if page.layout == 'post' or page.layout == 'page' %}
13
+ <!-- image lazy-loading & popup & clipboard -->
14
+ {% assign _urls = site.data.assets[origin].magnific-popup.js
15
+ | append: ',' | append: site.data.assets[origin].lozad.js
16
+ | append: ',' | append: site.data.assets[origin].clipboard.js
17
+ %}
18
+ {% include jsdelivr-combine.html urls=_urls %}
19
+ {% endif %}
20
+
21
+ {% if page.layout == 'home'
22
+ or page.layout == 'post'
23
+ or page.layout == 'archives'
24
+ or page.layout == 'category'
25
+ or page.layout == 'tag' %}
26
+ {% if site.prefer_datetime_locale %}
27
+ {% assign locale = site.prefer_datetime_locale | downcase %}
28
+ {% else %}
29
+ {% assign locale = site.lang | split: '-' | first %}
30
+ {% endif %}
31
+ {% assign _urls = site.data.assets[origin].dayjs.js.common
32
+ | append: ',' | append: site.data.assets[origin].dayjs.js.locale
33
+ | replace: ':LOCALE', locale
34
+ | append: ',' | append: site.data.assets[origin].dayjs.js.relativeTime
35
+ | append: ',' | append: site.data.assets[origin].dayjs.js.localizedFormat
36
+ %}
37
+ {% include jsdelivr-combine.html urls=_urls %}
38
+ {% endif %}
39
+
40
+ {% if page.layout == 'home'
41
+ or page.layout == 'categories'
42
+ or page.layout == 'post'
43
+ or page.layout == 'page' %}
44
+ {% assign type = page.layout %}
45
+ {% elsif page.layout == 'archives'
46
+ or page.layout == 'category'
47
+ or page.layout == 'tag' %}
48
+ {% assign type = "misc" %}
49
+ {% else %}
50
+ {% assign type = "common" %}
51
+ {% endif %}
52
+
53
+ {% capture script %}/assets/js/dist/{{ type }}.min.js{% endcapture %}
54
+ <script defer src="{{ script | relative_url }}"></script>
55
+
56
+ {% if page.math %}
57
+ <!-- MathJax -->
58
+ <script>
59
+ /* see: <https://docs.mathjax.org/en/latest/options/input/tex.html#tex-options> */
60
+ MathJax = {
61
+ tex: {
62
+ inlineMath: [ /* start/end delimiter pairs for in-line math */
63
+ ['$','$'],
64
+ ['\\(','\\)']
65
+ ],
66
+ displayMath: [ /* start/end delimiter pairs for display math */
67
+ ['$$', '$$'],
68
+ ['\\[', '\\]']
69
+ ]
70
+ }
71
+ };
72
+ </script>
73
+ <script src="{{ site.data.assets[origin].polyfill.js | relative_url }}"></script>
74
+ <script id="MathJax-script" async src="{{ site.data.assets[origin].mathjax.js | relative_url }}">
75
+ </script>
76
+ {% endif %}
77
+
78
+ <!-- Bootstrap JS -->
79
+ <script src="{{ site.data.assets[origin].bootstrap.js | relative_url }}"></script>
80
+
81
+ {% if jekyll.environment == 'production' %}
82
+ <!-- PWA -->
83
+ {% if site.pwa.enabled %}
84
+ <script defer src="{{ '/app.js' | relative_url }}"></script>
85
+ {% else %}
86
+ <script defer src="{{ '/unregister.js' | relative_url }}"></script>
87
+ {% endif %}
88
+
89
+ {% endif %}
@@ -0,0 +1,18 @@
1
+ {% assign urls = include.urls | split: ',' %}
2
+ {% assign combined_urls = nil %}
3
+ {% assign domain = 'https://cdn.jsdelivr.net/' %}
4
+ {% for url in urls %}
5
+ {% if url contains domain %}
6
+ {% assign url_snippet = url | slice: domain.size, url.size %}
7
+ {% if combined_urls %}
8
+ {% assign combined_urls = combined_urls | append: ',' | append: url_snippet %}
9
+ {% else %}
10
+ {% assign combined_urls = domain | append: 'combine/' | append: url_snippet %}
11
+ {% endif %}
12
+ {% elsif url contains '//' %}
13
+ <script src="{{ url }}"></script>
14
+ {% else %}
15
+ <script src="{{ url | relative_url }}"></script>
16
+ {% endif %}
17
+ {% endfor %}
18
+ {% if combined_urls %}<script src="{{ combined_urls }}"></script>{% endif %}
@@ -0,0 +1,6 @@
1
+ {% comment %} Detect appearance language and return it through variable "lang" {% endcomment %}
2
+ {% if site.data.locales[site.lang] %}
3
+ {% assign lang = site.lang %}
4
+ {% else %}
5
+ {% assign lang = 'en' %}
6
+ {% endif %}
@@ -0,0 +1 @@
1
+ {% comment %} MERMAID {% endcomment %}
@@ -0,0 +1,138 @@
1
+ <!--
2
+ Switch the mode between dark and light.
3
+ -->
4
+
5
+ <script type="text/javascript">
6
+ class ModeToggle {
7
+ static get MODE_KEY() { return "mode"; }
8
+ static get MODE_ATTR() { return "data-mode"; }
9
+ static get DARK_MODE() { return "dark"; }
10
+ static get LIGHT_MODE() { return "light"; }
11
+ static get BREW_MODE() { return "brew"; }
12
+ static get ID() { return "mode-toggle"; }
13
+
14
+ constructor() {
15
+ if (this.hasMode) {
16
+ if (this.isDarkMode) {
17
+ if (!this.isSysDarkPrefer) {
18
+ this.setDark();
19
+ }
20
+ } else {
21
+ if (this.isSysDarkPrefer) {
22
+ this.setLight();
23
+ }
24
+ }
25
+ }
26
+
27
+ let self = this;
28
+
29
+ /* always follow the system prefers */
30
+ this.sysDarkPrefers.addEventListener("change", () => {
31
+ if (self.hasMode) {
32
+ if (self.isDarkMode) {
33
+ if (!self.isSysDarkPrefer) {
34
+ self.setDark();
35
+ }
36
+
37
+ } else {
38
+ if (self.isSysDarkPrefer) {
39
+ self.setLight();
40
+ }
41
+ }
42
+
43
+ self.clearMode();
44
+ }
45
+
46
+ self.notify();
47
+
48
+ });
49
+
50
+ } /* constructor() */
51
+
52
+ get sysDarkPrefers() { return window.matchMedia("(prefers-color-scheme: dark)"); }
53
+
54
+ get isSysDarkPrefer() { return this.sysDarkPrefers.matches; }
55
+
56
+ get isDarkMode() { return this.mode === ModeToggle.DARK_MODE; }
57
+
58
+ get isLightMode() { return this.mode === ModeToggle.LIGHT_MODE; }
59
+
60
+ get isBrewMode() { return this.mode === ModeToggle.BREW_MODE; }
61
+
62
+ get hasMode() { return this.mode != null; }
63
+
64
+ get mode() { return sessionStorage.getItem(ModeToggle.MODE_KEY); }
65
+
66
+ /* get the current mode on screen */
67
+ get modeStatus() {
68
+ if (this.isDarkMode || (!this.hasMode && this.isSysDarkPrefer)) {
69
+ return ModeToggle.DARK_MODE;
70
+ } else if (this.isBrewMode) {
71
+ return ModeToggle.BREW_MODE;
72
+ } else {
73
+ return ModeToggle.LIGHT_MODE;
74
+ }
75
+ }
76
+
77
+ setDark() {
78
+ $('html').attr(ModeToggle.MODE_ATTR, ModeToggle.DARK_MODE);
79
+ sessionStorage.setItem(ModeToggle.MODE_KEY, ModeToggle.DARK_MODE);
80
+ }
81
+
82
+ setLight() {
83
+ $('html').attr(ModeToggle.MODE_ATTR, ModeToggle.LIGHT_MODE);
84
+ sessionStorage.setItem(ModeToggle.MODE_KEY, ModeToggle.LIGHT_MODE);
85
+ }
86
+
87
+ setBrew() {
88
+ $('html').attr(ModeToggle.MODE_ATTR, ModeToggle.BREW_MODE);
89
+ sessionStorage.setItem(ModeToggle.MODE_KEY, ModeToggle.BREW_MODE);
90
+ }
91
+
92
+ clearMode() {
93
+ $('html').removeAttr(ModeToggle.MODE_ATTR);
94
+ sessionStorage.removeItem(ModeToggle.MODE_KEY);
95
+ }
96
+
97
+ /* Notify another plugins that the theme mode has changed */
98
+ notify() {
99
+ window.postMessage({
100
+ direction: ModeToggle.ID,
101
+ message: this.modeStatus
102
+ }, "*");
103
+ }
104
+
105
+ } /* ModeToggle */
106
+
107
+ const toggle = new ModeToggle();
108
+
109
+ function flipMode() {
110
+ if (toggle.hasMode) {
111
+ if (toggle.isSysDarkPrefer) {
112
+ if (toggle.isLightMode) {
113
+ toggle.clearMode();
114
+ } else {
115
+ toggle.setLight();
116
+ }
117
+
118
+ } else {
119
+ if (toggle.isDarkMode) {
120
+ toggle.clearMode();
121
+ } else {
122
+ toggle.setDark();
123
+ }
124
+ }
125
+
126
+ } else {
127
+ if (toggle.isSysDarkPrefer) {
128
+ toggle.setLight();
129
+ } else {
130
+ toggle.setDark();
131
+ }
132
+ }
133
+
134
+ toggle.notify();
135
+
136
+ } /* flipMode() */
137
+
138
+ </script>
@@ -0,0 +1,6 @@
1
+ {% comment %} NAVBAR {% endcomment %}
2
+ <nav>
3
+ {% for item in site.data.navigation %}
4
+ <a href="{{ item.link }}" {% if page.url == item.link %}style="color: red;"{% endif %}>{{ item.name }}</a>
5
+ {% endfor %}
6
+ </nav>
File without changes
@@ -0,0 +1,13 @@
1
+ {% comment %} Site static assets origin {% endcomment %}
2
+
3
+ {% assign origin = 'cross_origin' %}
4
+
5
+ {% if site.assets.self_host.enabled %}
6
+ {% if site.assets.self_host.env %}
7
+ {% if site.assets.self_host.env == jekyll.environment %}
8
+ {% assign origin = 'self_host' %}
9
+ {% endif %}
10
+ {% else %}
11
+ {% assign origin = 'self_host' %}
12
+ {% endif %}
13
+ {% endif %}
File without changes
@@ -0,0 +1 @@
1
+ {% comment %} PANEL-BOTTOM {% endcomment %}
@@ -0,0 +1 @@
1
+ {% comment %} FOOTER PANEL, 2 COLUMN {% endcomment %}
@@ -0,0 +1 @@
1
+ {% comment %} FOOTER PANEL, 3 COLUMN {% endcomment %}
@@ -0,0 +1 @@
1
+ {% comment %} FOOTER PANEL, 4 COLUMN {% endcomment %}
@@ -0,0 +1 @@
1
+ {% comment %} FOOTER PANEL, FULL WIDTH {% endcomment %}
@@ -0,0 +1 @@
1
+ {% comment %} TOP PANEL, 2 COLUMN {% endcomment %}
@@ -0,0 +1 @@
1
+ {% comment %} TOP PANEL, 3 COLUMN {% endcomment %}
@@ -0,0 +1 @@
1
+ {% comment %} TOP PANEL, 4 COLUMN {% endcomment %}
@@ -0,0 +1 @@
1
+ {% comment %} FOOTER PANEL, FULL WIDTH {% endcomment %}
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,46 @@
1
+ <!--
2
+ Jekyll Simple Search loader
3
+ See: <https://github.com/christian-fei/Simple-Jekyll-Search>
4
+ -->
5
+
6
+ {% capture result_elem %}
7
+ <div class="pl-1 pr-1 pl-sm-2 pr-sm-2 pl-lg-4 pr-lg-4 pl-xl-0 pr-xl-0">
8
+ <a href="{url}">{title}</a>
9
+ <div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
10
+ {categories}
11
+ {tags}
12
+ </div>
13
+ <p>{snippet}</p>
14
+ </div>
15
+ {% endcapture %}
16
+
17
+ {% capture not_found %}<p class="mt-5">{{ site.data.locales[lang].search.no_results }}</p>{% endcapture %}
18
+
19
+ <script src="{{ site.data.assets[origin].search.js | relative_url }}"></script>
20
+
21
+ <script>
22
+ SimpleJekyllSearch({
23
+ searchInput: document.getElementById('search-input'),
24
+ resultsContainer: document.getElementById('search-results'),
25
+ json: '{{ '/assets/js/data/search.json' | relative_url }}',
26
+ searchResultTemplate: '{{ result_elem | strip_newlines }}',
27
+ noResultsText: '{{ not_found }}',
28
+ templateMiddleware: function(prop, value, template) {
29
+ if (prop === 'categories') {
30
+ if (value === '') {
31
+ return `${value}`;
32
+ } else {
33
+ return `<div class="mr-sm-4"><i class="far fa-folder fa-fw"></i>${value}</div>`;
34
+ }
35
+ }
36
+
37
+ if (prop === 'tags') {
38
+ if (value === '') {
39
+ return `${value}`;
40
+ } else {
41
+ return `<div><i class="fa fa-tag fa-fw"></i>${value}</div>`;
42
+ }
43
+ }
44
+ }
45
+ });
46
+ </script>
@@ -0,0 +1 @@
1
+ {% comment %} SEARCH RESULTS {% endcomment %}
File without changes
File without changes
@@ -0,0 +1,20 @@
1
+ /*
2
+ Reference: https://bootsnipp.com/snippets/featured/link-to-top-page
3
+ */
4
+ $(function() {
5
+ $(window).scroll(() => {
6
+ if ($(this).scrollTop() > 50 &&
7
+ $("#sidebar-trigger").css("display") === "none") {
8
+ $("#back-to-top").fadeIn();
9
+ } else {
10
+ $("#back-to-top").fadeOut();
11
+ }
12
+ });
13
+
14
+ $("#back-to-top").click(() => {
15
+ $("body,html").animate({
16
+ scrollTop: 0
17
+ }, 800);
18
+ return false;
19
+ });
20
+ });
@@ -0,0 +1,13 @@
1
+ /*
2
+ * Listener for theme mode toggle
3
+ */
4
+ $(function() {
5
+ $(".mode-toggle").click((e) => {
6
+ const $target = $(e.target);
7
+ let $btn = ($target.prop("tagName") === "button".toUpperCase() ?
8
+ $target : $target.parent());
9
+
10
+ $btn.blur(); // remove the clicking outline
11
+ flipMode();
12
+ });
13
+ });
@@ -0,0 +1,36 @@
1
+ /**
2
+ * A tool for smooth scrolling and topbar switcher
3
+ */
4
+ const ScrollHelper = (function () {
5
+ const $body = $("body");
6
+ const ATTR_TOPBAR_VISIBLE = "data-topbar-visible";
7
+ const topbarHeight = $("#topbar-wrapper").outerHeight();
8
+
9
+ let scrollUpCount = 0; // the number of times the scroll up was triggered by ToC or anchor
10
+ let topbarLocked = false;
11
+ let orientationLocked = false;
12
+
13
+ return {
14
+ hideTopbar: () => $body.attr(ATTR_TOPBAR_VISIBLE, false),
15
+ showTopbar: () => $body.attr(ATTR_TOPBAR_VISIBLE, true),
16
+
17
+ // scroll up
18
+
19
+ addScrollUpTask: () => {
20
+ scrollUpCount += 1;
21
+ if (!topbarLocked) { topbarLocked = true; }
22
+ },
23
+ popScrollUpTask: () => scrollUpCount -= 1,
24
+ hasScrollUpTask: () => scrollUpCount > 0,
25
+ topbarLocked: () => topbarLocked === true,
26
+ unlockTopbar: () => topbarLocked = false,
27
+ getTopbarHeight: () => topbarHeight,
28
+
29
+ // orientation change
30
+
31
+ orientationLocked: () => orientationLocked === true,
32
+ lockOrientation: () => orientationLocked = true,
33
+ unLockOrientation: () => orientationLocked = false
34
+ };
35
+
36
+ }());