databook-theme 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +21 -21
  3. data/README.MD +1 -1
  4. data/_includes/blog/blog.liquid +50 -50
  5. data/_includes/blog/features.liquid +36 -36
  6. data/_includes/blog/full.liquid +3 -3
  7. data/_includes/blog/list.liquid +41 -41
  8. data/_includes/blog/post.liquid +6 -6
  9. data/_includes/components/analytics.google.liquid +11 -11
  10. data/_includes/components/analytics.liquid +11 -11
  11. data/_includes/components/comments.disqus.liquid +17 -17
  12. data/_includes/components/comments.gitalk.liquid +22 -22
  13. data/_includes/components/comments.liquid +13 -13
  14. data/_includes/components/navmenu.items.liquid +51 -51
  15. data/_includes/components/navmenu.liquid +4 -4
  16. data/_includes/components/pagination.liquid +83 -83
  17. data/_includes/components/prevnext.liquid +1 -1
  18. data/_includes/components/search.baidu.liquid +7 -7
  19. data/_includes/components/search.bing.liquid +6 -6
  20. data/_includes/components/search.google.liquid +6 -6
  21. data/_includes/components/search.liquid +21 -21
  22. data/_includes/components/social_button.liquid +9 -9
  23. data/_includes/components/social_link.liquid +14 -14
  24. data/_includes/components/title.liquid +41 -41
  25. data/_includes/components/toc.liquid +28 -28
  26. data/_includes/custom/analytics.liquid +3 -3
  27. data/_includes/custom/blog.liquid +3 -3
  28. data/_includes/custom/body.liquid +3 -3
  29. data/_includes/custom/comments.liquid +3 -3
  30. data/_includes/custom/favicon.liquid +11 -0
  31. data/_includes/custom/footer.liquid +3 -3
  32. data/_includes/custom/head.liquid +3 -3
  33. data/_includes/custom/katex.liquid +15 -15
  34. data/_includes/custom/mathjax.liquid +19 -19
  35. data/_includes/custom/search.liquid +3 -3
  36. data/_includes/extensions/toc.liquid +182 -182
  37. data/_includes/functions/get_config.liquid +11 -11
  38. data/_includes/functions/get_config_data.liquid +23 -23
  39. data/_includes/functions/get_icon.liquid +5 -5
  40. data/_includes/functions/get_page_meta.liquid +74 -60
  41. data/_includes/functions/get_page_thumbnail.liquid +22 -23
  42. data/_includes/functions/get_page_title.liquid +7 -7
  43. data/_includes/functions/get_recent_posts.liquid +17 -17
  44. data/_includes/functions/get_taxonomy_link.liquid +9 -9
  45. data/_includes/head/head.liquid +11 -12
  46. data/_includes/head/meta.liquid +50 -41
  47. data/_includes/head/requirements.liquid +87 -87
  48. data/_includes/head/styles.liquid +10 -10
  49. data/_includes/js/codes.js +116 -116
  50. data/_includes/js/scrollspy.js +16 -16
  51. data/_includes/layout/article.liquid +74 -71
  52. data/_includes/layout/footer.liquid +53 -53
  53. data/_includes/layout/header.liquid +31 -31
  54. data/_includes/layout/hero.liquid +29 -29
  55. data/_includes/layout/page.liquid +33 -33
  56. data/_includes/layout/pagehead.liquid +17 -17
  57. data/_includes/layout/sidebar.liquid +178 -178
  58. data/_includes/localize +29 -29
  59. data/_includes/notice +6 -6
  60. data/_includes/version +1 -1
  61. data/_layouts/article.liquid +10 -10
  62. data/_layouts/default.liquid +132 -131
  63. data/_layouts/home.liquid +20 -20
  64. data/_layouts/page.liquid +9 -9
  65. data/_layouts/post.liquid +9 -9
  66. data/_layouts/system.liquid +35 -35
  67. data/_layouts/taxonomy.liquid +67 -67
  68. data/_sass/_databook.scss +42 -42
  69. data/_sass/_debug.scss +7 -7
  70. data/_sass/_variables.scss +24 -24
  71. data/_sass/base/_mixins.scss +32 -32
  72. data/_sass/base/_normalize.scss +45 -45
  73. data/_sass/base/_responsive.scss +28 -28
  74. data/_sass/components/_archive.scss +49 -49
  75. data/_sass/components/_blog.scss +249 -249
  76. data/_sass/components/_forms.scss +30 -30
  77. data/_sass/components/_hero.scss +70 -70
  78. data/_sass/components/_misc.scss +3 -3
  79. data/_sass/components/_notice.scss +27 -27
  80. data/_sass/components/_notification.scss +10 -10
  81. data/_sass/components/_post.scss +19 -19
  82. data/_sass/components/_sidebar.scss +303 -303
  83. data/_sass/components/_tabs.scss +67 -67
  84. data/_sass/components/_text.scss +27 -27
  85. data/_sass/components/_toc.scss +50 -50
  86. data/_sass/layout/_article.scss +211 -211
  87. data/_sass/layout/_body.scss +26 -26
  88. data/_sass/layout/_footer.scss +75 -75
  89. data/_sass/layout/_header.scss +124 -124
  90. data/_sass/layout/_main.scss +8 -8
  91. data/_sass/layout/_misc.scss +7 -7
  92. data/_sass/layout/_navbar.scss +323 -323
  93. data/_sass/layout/_sidebar.scss +115 -115
  94. data/_sass/layout/_wrapper.scss +7 -7
  95. data/_sass/theme/_scheme.scss +112 -112
  96. data/_sass/typography/_article.scss +49 -49
  97. data/_sass/typography/_doc.scss +104 -104
  98. data/_sass/typography/_highlight.scss +208 -208
  99. data/_sass/typography/_markdown.scss +18 -18
  100. data/_sass/typography/_table.scss +119 -119
  101. data/_sass/typography/_typography.scss +103 -108
  102. data/_sass/utilities/_thinscrollbar.scss +35 -35
  103. data/assets/databook/css/databook.scss +6 -6
  104. data/assets/databook/js/databook.js +8 -8
  105. data/assets/databook/js/search.js +47 -47
  106. data/assets/databook/version.json +9 -9
  107. data/assets/search.json +30 -30
  108. metadata +8 -8
  109. data/_includes/head/opengraph.liquid +0 -1
@@ -1,7 +1,7 @@
1
- {%- assign pageitem = include.page | default: page -%}
2
-
3
- {%- if pageitem.title_key -%}
4
- {%- include localize key=pageitem.title_key default=pageitem.title -%}
5
- {%- else -%}
6
- {{- pageitem.title -}}
7
- {%- endif -%}
1
+ {%- assign pageitem = include.page | default: page -%}
2
+
3
+ {%- if pageitem.title_key -%}
4
+ {%- include localize key=pageitem.title_key default=pageitem.title -%}
5
+ {%- else -%}
6
+ {{- pageitem.title -}}
7
+ {%- endif -%}
@@ -1,17 +1,17 @@
1
- {%- assign posts = site.posts | sort: "date" -%}
2
-
3
- {%- if include.sticky -%}
4
- {%- assign sticky_posts = posts | where_exp: "item", "item.sticky == true" -%}
5
- {%- assign normal_posts = posts | where_exp: "item", "item.sticky != true" -%}
6
- {%- assign posts = sticky_posts | concat: normal_posts -%}
7
- {%- elsif include.featured -%}
8
- {%- assign featured_posts = posts | where_exp: "item", "item.featured == true" -%}
9
- {%- assign normal_posts = posts | where_exp: "item", "item.featured != true" -%}
10
- {%- assign posts = featured_posts | concat: normal_posts -%}
11
- {%- endif -%}
12
-
13
- {%- if include.count -%}
14
- {%- assign posts = posts | slice: 0, include.count -%}
15
- {%- endif -%}
16
-
17
- {%- assign return = posts -%}
1
+ {%- assign posts = site.posts | sort: "date" -%}
2
+
3
+ {%- if include.sticky -%}
4
+ {%- assign sticky_posts = posts | where_exp: "item", "item.sticky == true" -%}
5
+ {%- assign normal_posts = posts | where_exp: "item", "item.sticky != true" -%}
6
+ {%- assign posts = sticky_posts | concat: normal_posts -%}
7
+ {%- elsif include.featured -%}
8
+ {%- assign featured_posts = posts | where_exp: "item", "item.featured == true" -%}
9
+ {%- assign normal_posts = posts | where_exp: "item", "item.featured != true" -%}
10
+ {%- assign posts = featured_posts | concat: normal_posts -%}
11
+ {%- endif -%}
12
+
13
+ {%- if include.count -%}
14
+ {%- assign posts = posts | slice: 0, include.count -%}
15
+ {%- endif -%}
16
+
17
+ {%- assign return = posts -%}
@@ -1,9 +1,9 @@
1
- {%- if include.tag -%}
2
- /tags/#!/{{- include.tag | url_encode -}}
3
- {%- elsif include.category -%}
4
- /categories/#!/{{- include.category | url_encode -}}
5
- {%- elsif include.archive -%}
6
- /archive/#!/{{- include.archive | url_encode -}}
7
- {%- elsif include.author -%}
8
- /authors/#!/{{- include.author | url_encode -}}
9
- {%- endif -%}
1
+ {%- if include.tag -%}
2
+ /tags/#!/{{- include.tag | url_encode -}}
3
+ {%- elsif include.category -%}
4
+ /categories/#!/{{- include.category | url_encode -}}
5
+ {%- elsif include.archive -%}
6
+ /archive/#!/{{- include.archive | url_encode -}}
7
+ {%- elsif include.author -%}
8
+ /authors/#!/{{- include.author | url_encode -}}
9
+ {%- endif -%}
@@ -1,12 +1,11 @@
1
- <head>
2
- {% include head/meta.liquid %}
3
- {% include head/opengraph.liquid %}
4
- {% include head/requirements.liquid %}
5
- {% include head/styles.liquid %}
6
-
7
- {%- if jekyll.environment == "production" -%}
8
- {%- include components/analytics.liquid -%}
9
- {%- endif %}
10
-
11
- {% include custom/head.liquid %}
12
- </head>
1
+ <head>
2
+ {% include head/meta.liquid %}
3
+ {% include head/requirements.liquid %}
4
+ {% include head/styles.liquid %}
5
+
6
+ {%- if jekyll.environment == "production" -%}
7
+ {%- include components/analytics.liquid -%}
8
+ {%- endif %}
9
+
10
+ {% include custom/head.liquid %}
11
+ </head>
@@ -1,41 +1,50 @@
1
- {%- assign robots = "index,follow" -%}
2
- {%- if site.disallow_robots -%}
3
- {%- assign robots = "noindex,nofollow" -%}
4
- {%- endif -%}
5
-
6
- {%- assign title_separator = site.title_separator | default: "-" -%}
7
- {%- capture page_title -%}{%- include functions/get_page_title.liquid -%}{%- endcapture -%}
8
- {%- assign html_title = page_title -%}
9
- {%- if page.title -%}
10
- {%- assign html_title = html_title | append: " " | append: title_separator | append: " " -%}
11
- {%- endif -%}
12
- {%- assign html_title = html_title | append: site.title -%}
13
-
14
-
15
- <meta charset="{{- site.encoding | default: 'utf-8' -}}">
16
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
17
- <meta name="viewport" content="width=device-width, initial-scale=1">
18
- <meta name="robots" content="{{- robots -}}">
19
- {%- if site.keywords -%}<meta name="keywords" content="{{- site.keywords -}}">{%- endif -%}
20
- {%- if site.baseurl -%}<base href="{{- site.baseurl -}}">{%- endif -%}
21
- <link rel="icon" type="image/x-icon" href="{{- site.favicon | default:'/assets/favicon.ico' -}}">
22
-
23
- <title>{{- html_title -}}</title>
24
-
25
- <script type="text/javascript" >
26
- window.databookConfig = {
27
- siteTitle: "{{- site.title -}}",
28
- siteBaseurl: "{{- site.baseurl -}}",
29
- siteUrl: "{{- site.url -}}",
30
- titleSeparater: "{{- site.title_separator -}}",
31
- generatedDate: "{{- site.time | date_to_xmlschema -}}",
32
- pageTitle: "{{- page_title -}}",
33
- pageLayout: "{{- page.layout -}}",
34
- {%- if page.scrollspy or layout.scrollspy or site.scrollspy -%}scrollspy: true,{%- endif -%}
35
- {%- if page.chartjs or layout.chartjs or site.chartjs -%}chartjs: true,{%- endif -%}
36
- {%- if page.mathjax or layout.mathjax or site.mathjax -%}mathjax: true,{%- endif -%}
37
- {%- if page.mermaid or layout.mermaid or site.mermaid -%}mermaid: true,{%- endif -%}
38
- {% if jekyll.environment == "development" %}debug: true,{% endif %}
39
- };
40
- document.querySelector('.js-disabled').classList.remove('js-disabled');
41
- </script>
1
+ {%- assign robots = "index,follow" -%}
2
+ {%- if site.disallow_robots -%}
3
+ {%- assign robots = "noindex,nofollow" -%}
4
+ {%- endif -%}
5
+
6
+ {%- assign title_separator = site.title_separator | default: "|" -%}
7
+ {%- assign site_title = site.title | default: site.name -%}
8
+ {%- assign site_description = site.tagline | default: site.description -%}
9
+ {%- capture page_title -%}{%- include functions/get_page_title.liquid -%}{%- endcapture -%}
10
+
11
+ {%- assign html_title = "" -%}
12
+ {%- if page_title.size > 0 -%}
13
+ {%- assign html_title = page_title | append: " " | append: title_separator | append: " " | append: site.title -%}
14
+ {%- else -%}
15
+ {%- assign html_title = site_title | append: " " | append: title_separator | append: " " | append: site_description -%}
16
+ {%- endif -%}
17
+
18
+
19
+ <meta charset="{{- site.encoding | default: 'utf-8' -}}">
20
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
21
+ <meta name="viewport" content="width=device-width, initial-scale=1">
22
+ <meta name="robots" content="{{- robots -}}">
23
+ {%- if site.keywords -%}<meta name="keywords" content="{{- site.keywords -}}">{%- endif -%}
24
+ {%- if site.baseurl -%}<base href="{{- site.baseurl -}}">{%- endif -%}
25
+
26
+ <link rel="alternate" type="application/atom+xml" href="{{- '/feed.xml' | relative_url -}}" title="Atom Feed">
27
+
28
+ <title>{{- html_title -}}</title>
29
+
30
+ {% include custom/favicon.liquid %}
31
+
32
+ {%- seo title=false -%}
33
+
34
+ <script type="text/javascript" >
35
+ window.databookConfig = {
36
+ siteTitle: "{{- site_title -}}",
37
+ siteBaseurl: "{{- site.baseurl -}}",
38
+ siteUrl: "{{- site.url -}}",
39
+ titleSeparater: "{{- site.title_separator -}}",
40
+ generatedDate: "{{- site.time | date_to_xmlschema -}}",
41
+ pageTitle: "{{- page_title -}}",
42
+ pageLayout: "{{- page.layout -}}",
43
+ {%- if page.scrollspy or layout.scrollspy or site.scrollspy -%}scrollspy: true,{%- endif -%}
44
+ {%- if page.chartjs or layout.chartjs or site.chartjs -%}chartjs: true,{%- endif -%}
45
+ {%- if page.mathjax or layout.mathjax or site.mathjax -%}mathjax: true,{%- endif -%}
46
+ {%- if page.mermaid or layout.mermaid or site.mermaid -%}mermaid: true,{%- endif -%}
47
+ {% if jekyll.environment == "development" %}debug: true,{% endif %}
48
+ };
49
+ document.querySelector('.js-disabled').classList.remove('js-disabled');
50
+ </script>
@@ -1,87 +1,87 @@
1
- {%- assign npm_cdn_key = ":npm_cdn/" -%}
2
- {%- assign npm_cdn = site.npm_cdn | default: "https://cdn.jsdelivr.net/npm/"-%}
3
- {%- assign last_char = npm_cdn | split: "" | last -%}
4
- {%- if last_char != "/" -%}{%- assign npc_cdn = npm_cdn | append: "/" -%}{%- endif -%}
5
-
6
- {%- assign github_cdn_key = ":github_cdn/" -%}
7
- {%- assign github_cdn = site.github_cdn | default: "https://cdn.jsdelivr.net/gh/" -%}
8
- {%- assign last_char = github_cdn | split: "" | last -%}
9
- {%- if last_char != "/" -%}{%- assign github_cdn = github_cdn | append: "/" -%}{%- endif -%}
10
-
11
- {%- assign js_list = "" | split: "" -%}
12
- {%- assign mjs_list = "" | split: "" -%}
13
- {%- assign css_list = "" | split: "" -%}
14
-
15
- {%- assign js_list = js_list
16
- | push: "/assets/databook/js/databook.js"
17
- -%}
18
-
19
- {%- assign mjs_list = mjs_list
20
- -%}
21
-
22
- {%- assign css_list = css_list
23
- | push: "/assets/databook/css/databook.css"
24
- | push: ":npm_cdn/@fortawesome/fontawesome-free/css/all.min.css"
25
- -%}
26
-
27
- {%- if page.chartjs or layout.chartjs or site.chartjs -%}
28
- {%- assign js_list = js_list | push: ":npm_cdn/chart.js/dist/chart.min.js" -%}
29
- {%- endif -%}
30
-
31
- {%- if page.flowchart or layout.flowchart or site.flowchart -%}
32
- {%- assign js_list = js_list | push: ":npm_cdn/raphael@2.3.0/raphael.min.js" -%}
33
- {%- assign js_list = js_list | push: ":npm_cdn/flowchart.js@1.8.0/release/flowchart.min.js" -%}
34
- {%- endif -%}
35
-
36
- {%- if page.katex or layout.katex or site.katex -%}
37
- {%- assign css_list = css_list | push: ":npm_cdn/katex/dist/katex.min.css" -%}
38
- {%- assign js_list = js_list | push: ":npm_cdn/katex/dist/katex.min.js" -%}
39
- {%- assign js_list = js_list | push: ":npm_cdn/katex/dist/contrib/auto-render.min.js" -%}
40
- {%- include custom/katex.liquid -%}
41
- {%- endif -%}
42
-
43
- {%- if page.mathjax or layout.mathjax or site.mathjax -%}
44
- {%- assign js_list = js_list | push: ":npm_cdn/mathjax/es5/tex-mml-chtml.js" -%}
45
- {%- include custom/mathjax.liquid -%}
46
- {%- endif -%}
47
-
48
- {%- if page.mermaid or layout.mermaid or site.mermaid -%}
49
- {%- assign js_list = js_list | push: ":npm_cdn/mermaid/dist/mermaid.min.js" -%}
50
- {%- endif -%}
51
-
52
- {%- if site.data.requirements.js -%}{%- assign js_list = js_list | concat: site.data.requirements.js -%}{%- endif -%}
53
- {%- if site.data.requirements.modules -%}{%- assign mjs_list = mjs_list | concat: site.data.requirements.modules -%}{%- endif -%}
54
- {%- if site.data.requirements.css -%}{%- assign css_list = css_list | concat: site.data.requirements.css -%}{%- endif -%}
55
-
56
- {%- if site.requirements.js -%}{%- assign js_list = js_list | concat: site.requirements.js -%}{%- endif -%}
57
- {%- if site.requirements.modules -%}{%- assign mjs_list = mjs_list | concat: site.requirements.modules -%}{%- endif -%}
58
- {%- if site.requirements.css -%}{%- assign css_list = css_list | concat: site.requirements.css -%}{%- endif -%}
59
-
60
- {%- if layout.requirements.js -%}{%- assign js_list = js_list | concat: layout.requirements.js -%}{%- endif -%}
61
- {%- if layout.requirements.modules -%}{%- assign mjs_list = mjs_list | concat: layout.requirements.modules -%}{%- endif -%}
62
- {%- if layout.requirements.css -%}{%- assign css_list = css_list | concat: layout.requirements.css -%}{%- endif -%}
63
-
64
- {%- if page.requirements.js -%}{%- assign js_list = js_list | concat: page.requirements.js -%}{%- endif -%}
65
- {%- if page.requirements.modules -%}{%- assign mjs_list = mjs_list | concat: page.requirements.modules -%}{%- endif -%}
66
- {%- if page.requirements.css -%}{%- assign css_list = css_list | concat: page.requirements.css -%}{%- endif -%}
67
-
68
- {%- if page.js -%}{%- assign js_list = js_list | concat: page.js -%}{%- endif -%}
69
- {%- if page.modules -%}{%- assign mjs_list = mjs_list | concat: page.modules -%}{%- endif -%}
70
- {%- if page.css -%}{%- assign css_list = css_list | concat: page.css -%}{%- endif -%}
71
-
72
- {%- assign js_list = js_list | uniq -%}
73
- {%- assign mjs_list = mjs_list | uniq -%}
74
- {%- assign css_list = css_list | uniq -%}
75
-
76
-
77
- {%- for url in css_list -%}
78
- <link href="{{- url | replace: npm_cdn_key, npm_cdn | replace: github_cdn_key, github_cdn | relative_url -}}" type="text/css" rel="stylesheet">
79
- {%- endfor -%}
80
-
81
- {%- for url in js_list -%}
82
- <script src="{{- url | replace: npm_cdn_key, npm_cdn | replace: github_cdn_key, github_cdn | relative_url -}}" type="text/javascript" defer></script>
83
- {%- endfor -%}
84
-
85
- {%- for url in mjs_list -%}
86
- <script src="{{- url | replace: npm_cdn_key, npm_cdn | replace: github_cdn_key, github_cdn | relative_url -}}" type="module" ></script>
87
- {%- endfor -%}
1
+ {%- assign npm_cdn_key = ":npm_cdn/" -%}
2
+ {%- assign npm_cdn = site.npm_cdn | default: "https://cdn.jsdelivr.net/npm/"-%}
3
+ {%- assign last_char = npm_cdn | split: "" | last -%}
4
+ {%- if last_char != "/" -%}{%- assign npc_cdn = npm_cdn | append: "/" -%}{%- endif -%}
5
+
6
+ {%- assign github_cdn_key = ":github_cdn/" -%}
7
+ {%- assign github_cdn = site.github_cdn | default: "https://cdn.jsdelivr.net/gh/" -%}
8
+ {%- assign last_char = github_cdn | split: "" | last -%}
9
+ {%- if last_char != "/" -%}{%- assign github_cdn = github_cdn | append: "/" -%}{%- endif -%}
10
+
11
+ {%- assign js_list = "" | split: "" -%}
12
+ {%- assign mjs_list = "" | split: "" -%}
13
+ {%- assign css_list = "" | split: "" -%}
14
+
15
+ {%- assign js_list = js_list
16
+ | push: "/assets/databook/js/databook.js"
17
+ -%}
18
+
19
+ {%- assign mjs_list = mjs_list
20
+ -%}
21
+
22
+ {%- assign css_list = css_list
23
+ | push: "/assets/databook/css/databook.css"
24
+ | push: ":npm_cdn/@fortawesome/fontawesome-free/css/all.min.css"
25
+ -%}
26
+
27
+ {%- if page.chartjs or layout.chartjs or site.chartjs -%}
28
+ {%- assign js_list = js_list | push: ":npm_cdn/chart.js/dist/chart.min.js" -%}
29
+ {%- endif -%}
30
+
31
+ {%- if page.flowchart or layout.flowchart or site.flowchart -%}
32
+ {%- assign js_list = js_list | push: ":npm_cdn/raphael@2.3.0/raphael.min.js" -%}
33
+ {%- assign js_list = js_list | push: ":npm_cdn/flowchart.js@1.8.0/release/flowchart.min.js" -%}
34
+ {%- endif -%}
35
+
36
+ {%- if page.katex or layout.katex or site.katex -%}
37
+ {%- assign css_list = css_list | push: ":npm_cdn/katex/dist/katex.min.css" -%}
38
+ {%- assign js_list = js_list | push: ":npm_cdn/katex/dist/katex.min.js" -%}
39
+ {%- assign js_list = js_list | push: ":npm_cdn/katex/dist/contrib/auto-render.min.js" -%}
40
+ {%- include custom/katex.liquid -%}
41
+ {%- endif -%}
42
+
43
+ {%- if page.mathjax or layout.mathjax or site.mathjax -%}
44
+ {%- assign js_list = js_list | push: ":npm_cdn/mathjax/es5/tex-mml-chtml.js" -%}
45
+ {%- include custom/mathjax.liquid -%}
46
+ {%- endif -%}
47
+
48
+ {%- if page.mermaid or layout.mermaid or site.mermaid -%}
49
+ {%- assign js_list = js_list | push: ":npm_cdn/mermaid/dist/mermaid.min.js" -%}
50
+ {%- endif -%}
51
+
52
+ {%- if site.data.requirements.js -%}{%- assign js_list = js_list | concat: site.data.requirements.js -%}{%- endif -%}
53
+ {%- if site.data.requirements.modules -%}{%- assign mjs_list = mjs_list | concat: site.data.requirements.modules -%}{%- endif -%}
54
+ {%- if site.data.requirements.css -%}{%- assign css_list = css_list | concat: site.data.requirements.css -%}{%- endif -%}
55
+
56
+ {%- if site.requirements.js -%}{%- assign js_list = js_list | concat: site.requirements.js -%}{%- endif -%}
57
+ {%- if site.requirements.modules -%}{%- assign mjs_list = mjs_list | concat: site.requirements.modules -%}{%- endif -%}
58
+ {%- if site.requirements.css -%}{%- assign css_list = css_list | concat: site.requirements.css -%}{%- endif -%}
59
+
60
+ {%- if layout.requirements.js -%}{%- assign js_list = js_list | concat: layout.requirements.js -%}{%- endif -%}
61
+ {%- if layout.requirements.modules -%}{%- assign mjs_list = mjs_list | concat: layout.requirements.modules -%}{%- endif -%}
62
+ {%- if layout.requirements.css -%}{%- assign css_list = css_list | concat: layout.requirements.css -%}{%- endif -%}
63
+
64
+ {%- if page.requirements.js -%}{%- assign js_list = js_list | concat: page.requirements.js -%}{%- endif -%}
65
+ {%- if page.requirements.modules -%}{%- assign mjs_list = mjs_list | concat: page.requirements.modules -%}{%- endif -%}
66
+ {%- if page.requirements.css -%}{%- assign css_list = css_list | concat: page.requirements.css -%}{%- endif -%}
67
+
68
+ {%- if page.js -%}{%- assign js_list = js_list | concat: page.js -%}{%- endif -%}
69
+ {%- if page.modules -%}{%- assign mjs_list = mjs_list | concat: page.modules -%}{%- endif -%}
70
+ {%- if page.css -%}{%- assign css_list = css_list | concat: page.css -%}{%- endif -%}
71
+
72
+ {%- assign js_list = js_list | uniq -%}
73
+ {%- assign mjs_list = mjs_list | uniq -%}
74
+ {%- assign css_list = css_list | uniq -%}
75
+
76
+
77
+ {%- for url in css_list -%}
78
+ <link href="{{- url | replace: npm_cdn_key, npm_cdn | replace: github_cdn_key, github_cdn | relative_url -}}" type="text/css" rel="stylesheet">
79
+ {%- endfor -%}
80
+
81
+ {%- for url in js_list -%}
82
+ <script src="{{- url | replace: npm_cdn_key, npm_cdn | replace: github_cdn_key, github_cdn | relative_url -}}" type="text/javascript" defer></script>
83
+ {%- endfor -%}
84
+
85
+ {%- for url in mjs_list -%}
86
+ <script src="{{- url | replace: npm_cdn_key, npm_cdn | replace: github_cdn_key, github_cdn | relative_url -}}" type="module" ></script>
87
+ {%- endfor -%}
@@ -1,10 +1,10 @@
1
- {%- assign accent_color_hue = page.accent_color_hue | default: layout.accent_color_hue | default: site.accent_color_hue | default: false -%}
2
- {%- assign accent_color_saturation = page.accent_color_saturation | default: layout.accent_color_saturation | default: site.accent_color_saturation | default: false -%}
3
- {%- if accent_color_hue or accent_color_saturation -%}
4
- <style>
5
- :root[data-accent-color="custom"] {
6
- --db-accent-color-h: {{accent_color_hue|default:"220"}};
7
- --db-accent-color-s: {{accent_color_saturation|default:"50%"}};
8
- }
9
- </style>
10
- {%- endif -%}
1
+ {%- assign accent_color_hue = page.accent_color_hue | default: layout.accent_color_hue | default: site.accent_color_hue | default: false -%}
2
+ {%- assign accent_color_saturation = page.accent_color_saturation | default: layout.accent_color_saturation | default: site.accent_color_saturation | default: false -%}
3
+ {%- if accent_color_hue or accent_color_saturation -%}
4
+ <style>
5
+ :root[data-accent-color="custom"] {
6
+ --db-accent-color-h: {{accent_color_hue|default:"220"}};
7
+ --db-accent-color-s: {{accent_color_saturation|default:"50%"}};
8
+ }
9
+ </style>
10
+ {%- endif -%}
@@ -1,116 +1,116 @@
1
- {
2
- function init() {
3
- let items = [...document.querySelectorAll('pre')]
4
- .filter(pre => {
5
- return pre.childElementCount == 1
6
- && pre.children[0].tagName == 'CODE'
7
- && pre.children[0].childElementCount == 0;
8
- })
9
- .map((pre, index) => {
10
- let name = pre.children[0].className.replace('language-', '');
11
- let text = pre.children[0].textContent;
12
- let newNode = document.createElement('div');
13
- newNode.className = `js-code js-code--${name}`;
14
- newNode.setAttribute('style', pre.getAttribute('style') || "");
15
- pre.after(newNode);
16
- return {
17
- node: pre,
18
- name,
19
- text,
20
- output: newNode,
21
- id: `js-pre${index}`,
22
- }
23
- });
24
-
25
- items.forEach(render);
26
-
27
- if (items.some(x => x.success && x.name == 'mathjax')) {
28
- MathJax.startup.document.clear();
29
- MathJax.startup.document.updateDocument();
30
- }
31
- }
32
-
33
- function render(item) {
34
- if (item.name == 'chart' && typeof Chart !== 'undefined') {
35
- renderChart(item);
36
- } else if (item.name == 'flowchart' && typeof flowchart !== 'undefined') {
37
- renderFlowchart(item);
38
- } else if ((item.name == 'katex' || item.name == 'math') && typeof katex !== 'undefined') {
39
- renderKatex(item);
40
- } else if ((item.name == 'mathjax' || item.name == 'math') && typeof MathJax !== 'undefined') {
41
- renderMathjax(item);
42
- } else if (item.name == 'mermaid' && typeof mermaid !== 'undefined') {
43
- renderMermaid(item);
44
- }
45
-
46
- if (item.error) {
47
- item.output.innerHTML = `<p style="color:red;">Error: ${item.error}</p>`;
48
- } else if (item.success) {
49
- item.node.style.display = 'none';
50
- }
51
- }
52
-
53
-
54
- function renderChart(item) {
55
- let json;
56
- try {
57
- json = JSON.parse(item.text);
58
- } catch (error) {
59
- item.error = 'Invalid JSON syntax.';
60
- return;
61
- }
62
-
63
- let canvas = document.createElement('canvas');
64
- item.output.append(canvas);
65
- try {
66
- new Chart(canvas, json);
67
- item.success = true;
68
- } catch (error) {
69
- item.error = 'Invalid Chart syntax.';
70
- console.error(error);
71
- }
72
- }
73
-
74
- function renderFlowchart(item) {
75
- try {
76
- let diagram = flowchart.parse(item.text);
77
- diagram.drawSVG(item.output);
78
- item.success = true;
79
- } catch (error) {
80
- item.error = 'Invalid flowchart syntax.';
81
- console.error(error);
82
- }
83
- }
84
-
85
- function renderKatex(item) {
86
- try {
87
- katex.render(item.text, item.output, { displayMode: true });
88
- item.success = true;
89
- } catch (error) {
90
- item.error = 'Invalid Katex syntax.';
91
- console.error(error);
92
- }
93
- }
94
-
95
- function renderMathjax(item) {
96
- try {
97
- item.output.append(MathJax.tex2chtml(item.text));
98
- item.success = true;
99
- } catch (error) {
100
- item.error = 'Invalid Mathjax syntax.';
101
- console.error(error);
102
- }
103
- }
104
-
105
- function renderMermaid(item) {
106
- try {
107
- item.output.innerHTML = mermaid.render(item.id, item.text);
108
- item.success = true;
109
- } catch (error) {
110
- item.error = 'Invalid mermaid syntax.';
111
- console.error(error);
112
- }
113
- }
114
-
115
- window.addEventListener('load', init);
116
- }
1
+ {
2
+ function init() {
3
+ let items = [...document.querySelectorAll('pre')]
4
+ .filter(pre => {
5
+ return pre.childElementCount == 1
6
+ && pre.children[0].tagName == 'CODE'
7
+ && pre.children[0].childElementCount == 0;
8
+ })
9
+ .map((pre, index) => {
10
+ let name = pre.children[0].className.replace('language-', '');
11
+ let text = pre.children[0].textContent;
12
+ let newNode = document.createElement('div');
13
+ newNode.className = `js-code js-code--${name}`;
14
+ newNode.setAttribute('style', pre.getAttribute('style') || "");
15
+ pre.after(newNode);
16
+ return {
17
+ node: pre,
18
+ name,
19
+ text,
20
+ output: newNode,
21
+ id: `js-pre${index}`,
22
+ }
23
+ });
24
+
25
+ items.forEach(render);
26
+
27
+ if (items.some(x => x.success && x.name == 'mathjax')) {
28
+ MathJax.startup.document.clear();
29
+ MathJax.startup.document.updateDocument();
30
+ }
31
+ }
32
+
33
+ function render(item) {
34
+ if (item.name == 'chart' && typeof Chart !== 'undefined') {
35
+ renderChart(item);
36
+ } else if (item.name == 'flowchart' && typeof flowchart !== 'undefined') {
37
+ renderFlowchart(item);
38
+ } else if ((item.name == 'katex' || item.name == 'math') && typeof katex !== 'undefined') {
39
+ renderKatex(item);
40
+ } else if ((item.name == 'mathjax' || item.name == 'math') && typeof MathJax !== 'undefined') {
41
+ renderMathjax(item);
42
+ } else if (item.name == 'mermaid' && typeof mermaid !== 'undefined') {
43
+ renderMermaid(item);
44
+ }
45
+
46
+ if (item.error) {
47
+ item.output.innerHTML = `<p style="color:red;">Error: ${item.error}</p>`;
48
+ } else if (item.success) {
49
+ item.node.style.display = 'none';
50
+ }
51
+ }
52
+
53
+
54
+ function renderChart(item) {
55
+ let json;
56
+ try {
57
+ json = JSON.parse(item.text);
58
+ } catch (error) {
59
+ item.error = 'Invalid JSON syntax.';
60
+ return;
61
+ }
62
+
63
+ let canvas = document.createElement('canvas');
64
+ item.output.append(canvas);
65
+ try {
66
+ new Chart(canvas, json);
67
+ item.success = true;
68
+ } catch (error) {
69
+ item.error = 'Invalid Chart syntax.';
70
+ console.error(error);
71
+ }
72
+ }
73
+
74
+ function renderFlowchart(item) {
75
+ try {
76
+ let diagram = flowchart.parse(item.text);
77
+ diagram.drawSVG(item.output);
78
+ item.success = true;
79
+ } catch (error) {
80
+ item.error = 'Invalid flowchart syntax.';
81
+ console.error(error);
82
+ }
83
+ }
84
+
85
+ function renderKatex(item) {
86
+ try {
87
+ katex.render(item.text, item.output, { displayMode: true });
88
+ item.success = true;
89
+ } catch (error) {
90
+ item.error = 'Invalid Katex syntax.';
91
+ console.error(error);
92
+ }
93
+ }
94
+
95
+ function renderMathjax(item) {
96
+ try {
97
+ item.output.append(MathJax.tex2chtml(item.text));
98
+ item.success = true;
99
+ } catch (error) {
100
+ item.error = 'Invalid Mathjax syntax.';
101
+ console.error(error);
102
+ }
103
+ }
104
+
105
+ function renderMermaid(item) {
106
+ try {
107
+ item.output.innerHTML = mermaid.render(item.id, item.text);
108
+ item.success = true;
109
+ } catch (error) {
110
+ item.error = 'Invalid mermaid syntax.';
111
+ console.error(error);
112
+ }
113
+ }
114
+
115
+ window.addEventListener('load', init);
116
+ }