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,119 +1,119 @@
1
- .l-typography {
2
- --db-cell-padding: .6rem .8rem;
3
- --db-cell-bold-border: 2px;
4
- --db-cell-border-row: var(--db-border-color);
5
- --db-cell-border-column: var(--db-border-color);
6
-
7
- table:not(.rouge-table) {
8
- border: 1px solid var(--db-border-color);
9
- border-collapse: separate;
10
- border-radius: $border-radius-object;
11
- border-spacing: 0;
12
- margin-top: 1rem;
13
- margin-bottom: 1rem;
14
- overflow: hidden;
15
- width: 100%;
16
-
17
- th, td {
18
- padding: var(--db-cell-padding);
19
- border-bottom: 1px solid var(--db-cell-border-row);
20
- border-right: 1px solid var(--db-cell-border-column);
21
- }
22
-
23
- > *:last-child > tr:last-child > * {
24
- border-bottom: none;
25
- }
26
-
27
- > * > tr > *:last-child {
28
- border-right: none;
29
- }
30
-
31
- > *:not(:last-child) > tr:last-child {
32
- position : relative;
33
-
34
- &::after {
35
- content: '';
36
- position: absolute;
37
- bottom: 0;
38
- left: 0;
39
- height: 0;
40
- width: 100%;
41
- border-bottom: var(--db-cell-bold-border) solid var(--db-border-color);
42
- }
43
- }
44
-
45
- + .h-table--combined {
46
- margin-top: calc(-1rem - 1px) !important;
47
- border-top: none !important;
48
- border-top-left-radius: 0 !important;
49
- border-top-right-radius: 0 !important;
50
- }
51
- }
52
-
53
- }
54
-
55
- .h-table--small {
56
- --db-cell-padding: .2rem .4rem;
57
- font-size: 90%;
58
- }
59
-
60
- .h-table--row {
61
- --db-cell-border-column: transparent;
62
- }
63
-
64
- .h-table--column {
65
- --db-cell-border-row: transparent;
66
- --db-cell-bold-border: 1px;
67
- }
68
-
69
- .h-table--grid {
70
- --db-cell-border-row: var(--db-border-color);
71
- --db-cell-border-column: var(--db-border-color);
72
- }
73
-
74
- .h-table--striped {
75
- > tbody:first-child > tr:nth-child(even),
76
- > tbody:not(:first-child) > tr:nth-child(odd) {
77
- background-color: var(--db-highlight-color-hover);
78
- }
79
- }
80
-
81
- .h-table--hover:not(.h-table--striped) {
82
- > tbody > tr:hover {
83
- background-color: var(--db-highlight-color-hover);
84
- }
85
- }
86
-
87
- .h-table--hover.h-table--column {
88
- // todo
89
- td:hover {
90
- }
91
- }
92
-
93
- .h-table--left {
94
- text-align: left;
95
- }
96
-
97
- .h-table--center {
98
- text-align: center;
99
- }
100
-
101
- .h-table--right {
102
- text-align: right;
103
- }
104
-
105
- .h-table--justify {
106
- text-align: justify;
107
- }
108
-
109
- .h-table--top td {
110
- vertical-align: top;
111
- }
112
-
113
- .h-table--middle td {
114
- vertical-align: middle;
115
- }
116
-
117
- .h-table--bottom td {
118
- vertical-align: bottom;
119
- }
1
+ .l-typography {
2
+ --db-cell-padding: .6rem .8rem;
3
+ --db-cell-bold-border: 2px;
4
+ --db-cell-border-row: var(--db-border-color);
5
+ --db-cell-border-column: var(--db-border-color);
6
+
7
+ table:not(.rouge-table) {
8
+ border: 1px solid var(--db-border-color);
9
+ border-collapse: separate;
10
+ border-radius: $border-radius-object;
11
+ border-spacing: 0;
12
+ margin-top: 1rem;
13
+ margin-bottom: 1rem;
14
+ overflow: hidden;
15
+ width: 100%;
16
+
17
+ th, td {
18
+ padding: var(--db-cell-padding);
19
+ border-bottom: 1px solid var(--db-cell-border-row);
20
+ border-right: 1px solid var(--db-cell-border-column);
21
+ }
22
+
23
+ > *:last-child > tr:last-child > * {
24
+ border-bottom: none;
25
+ }
26
+
27
+ > * > tr > *:last-child {
28
+ border-right: none;
29
+ }
30
+
31
+ > *:not(:last-child) > tr:last-child {
32
+ position : relative;
33
+
34
+ &::after {
35
+ content: '';
36
+ position: absolute;
37
+ bottom: 0;
38
+ left: 0;
39
+ height: 0;
40
+ width: 100%;
41
+ border-bottom: var(--db-cell-bold-border) solid var(--db-border-color);
42
+ }
43
+ }
44
+
45
+ + .h-table--combined {
46
+ margin-top: calc(-1rem - 1px) !important;
47
+ border-top: none !important;
48
+ border-top-left-radius: 0 !important;
49
+ border-top-right-radius: 0 !important;
50
+ }
51
+ }
52
+
53
+ }
54
+
55
+ .h-table--small {
56
+ --db-cell-padding: .2rem .4rem;
57
+ font-size: 90%;
58
+ }
59
+
60
+ .h-table--row {
61
+ --db-cell-border-column: transparent;
62
+ }
63
+
64
+ .h-table--column {
65
+ --db-cell-border-row: transparent;
66
+ --db-cell-bold-border: 1px;
67
+ }
68
+
69
+ .h-table--grid {
70
+ --db-cell-border-row: var(--db-border-color);
71
+ --db-cell-border-column: var(--db-border-color);
72
+ }
73
+
74
+ .h-table--striped {
75
+ > tbody:first-child > tr:nth-child(even),
76
+ > tbody:not(:first-child) > tr:nth-child(odd) {
77
+ background-color: var(--db-highlight-color-hover);
78
+ }
79
+ }
80
+
81
+ .h-table--hover:not(.h-table--striped) {
82
+ > tbody > tr:hover {
83
+ background-color: var(--db-highlight-color-hover);
84
+ }
85
+ }
86
+
87
+ .h-table--hover.h-table--column {
88
+ // todo
89
+ td:hover {
90
+ }
91
+ }
92
+
93
+ .h-table--left {
94
+ text-align: left;
95
+ }
96
+
97
+ .h-table--center {
98
+ text-align: center;
99
+ }
100
+
101
+ .h-table--right {
102
+ text-align: right;
103
+ }
104
+
105
+ .h-table--justify {
106
+ text-align: justify;
107
+ }
108
+
109
+ .h-table--top td {
110
+ vertical-align: top;
111
+ }
112
+
113
+ .h-table--middle td {
114
+ vertical-align: middle;
115
+ }
116
+
117
+ .h-table--bottom td {
118
+ vertical-align: bottom;
119
+ }
@@ -1,108 +1,103 @@
1
- .l-typography {
2
- p {
3
- margin: .5rem 0;
4
- line-height: 1.5em;
5
- }
6
-
7
- ol, ul {
8
- margin-left: 2em;
9
- margin-top: .5rem;
10
- margin-bottom: .5rem;
11
-
12
- ol, ul {
13
- margin-top: 0;
14
- margin-bottom: 0;
15
- }
16
- }
17
- li {
18
- line-height: 1.5em;
19
- margin: .25rem 0;
20
- &::marker {
21
- color: var(--db-text-color-important);
22
- }
23
-
24
- > p {
25
- margin: .25rem 0;
26
- &:first-child {
27
- margin-top: 0;
28
- }
29
- &:last-child {
30
- margin-bottom: 0;
31
- }
32
- }
33
- }
34
-
35
- dl {
36
- line-height: 1.5em;
37
- }
38
- dt {
39
- font-weight: bold;
40
- margin: .25rem 0;
41
- }
42
- dd {
43
- margin: .25rem 0 .25rem 2rem;
44
- }
45
-
46
- a {
47
- color: revert;
48
-
49
- &:hover {
50
- color: revert;
51
- text-decoration: revert;
52
- }
53
- }
54
-
55
- .highlight code {
56
- background-color: var(--db-surface-color);
57
- border: 1px solid var(--db-border-color);
58
- max-width: 100%;
59
- overflow-x: auto;
60
- border-radius: $border-radius-object;
61
- margin: 1rem 0;
62
-
63
- line-height: 1.5em;
64
- padding: .5em 1rem;
65
-
66
- display: block;
67
-
68
- &::before {
69
- content: ' ';
70
- color: white;
71
- }
72
- }
73
-
74
- code.language-plaintext {
75
- padding: .2rem .4em;
76
- margin: 0 .2rem;
77
- font-size: .9em;
78
- background-color: var(--db-surface-color);
79
- border-radius: $border-radius-object;
80
- white-space: nowrap;
81
- }
82
-
83
- hr {
84
- border-top: 1px solid var(--db-border-color);
85
- border-width: 1px 0 0 0;
86
- margin: 1em 2em;
87
- }
88
-
89
- blockquote {
90
- margin: .5rem 2rem;
91
- color: var(--db-text-color-inactive);
92
- border-left: 0.25em solid var(--db-border-color);
93
- padding: .25rem 0 .25rem .5rem;
94
- > * {
95
- &:first-child {
96
- margin-top: 0;
97
- }
98
- &:last-child {
99
- margin-bottom: 0;
100
- }
101
- }
102
- }
103
-
104
- p:lang(zh) {
105
- text-indent: 2em;
106
- }
107
-
108
- }
1
+ .l-typography {
2
+ p {
3
+ margin: .5rem 0;
4
+ line-height: 1.5em;
5
+ }
6
+
7
+ ol, ul {
8
+ margin-left: 2em;
9
+ margin-top: .5rem;
10
+ margin-bottom: .5rem;
11
+
12
+ ol, ul {
13
+ margin-top: 0;
14
+ margin-bottom: 0;
15
+ }
16
+ }
17
+ li {
18
+ line-height: 1.5em;
19
+ margin: .25rem 0;
20
+ &::marker {
21
+ color: var(--db-text-color-important);
22
+ }
23
+
24
+ > p {
25
+ margin: .25rem 0;
26
+ &:first-child {
27
+ margin-top: 0;
28
+ }
29
+ &:last-child {
30
+ margin-bottom: 0;
31
+ }
32
+ }
33
+ }
34
+
35
+ dl {
36
+ line-height: 1.5em;
37
+ }
38
+ dt {
39
+ font-weight: bold;
40
+ margin: .25rem 0;
41
+ }
42
+ dd {
43
+ margin: .25rem 0 .25rem 2rem;
44
+ }
45
+
46
+ a {
47
+ color: revert;
48
+
49
+ &:hover {
50
+ color: revert;
51
+ text-decoration: revert;
52
+ }
53
+ }
54
+
55
+ .highlight code {
56
+ background-color: var(--db-surface-color);
57
+ border: 1px solid var(--db-border-color);
58
+ max-width: 100%;
59
+ overflow-x: auto;
60
+ border-radius: $border-radius-object;
61
+ margin: 1rem 0;
62
+
63
+ line-height: 1.5em;
64
+ padding: .5em 1rem;
65
+
66
+ display: block;
67
+ }
68
+
69
+ code.language-plaintext {
70
+ padding: .2rem .4em;
71
+ margin: 0 .2rem;
72
+ font-size: .9em;
73
+ background-color: var(--db-surface-color);
74
+ border-radius: $border-radius-object;
75
+ white-space: nowrap;
76
+ }
77
+
78
+ hr {
79
+ border-top: 1px solid var(--db-border-color);
80
+ border-width: 1px 0 0 0;
81
+ margin: 1em 2em;
82
+ }
83
+
84
+ blockquote {
85
+ margin: .5rem 2rem;
86
+ color: var(--db-text-color-inactive);
87
+ border-left: 0.25em solid var(--db-border-color);
88
+ padding: .25rem 0 .25rem .5rem;
89
+ > * {
90
+ &:first-child {
91
+ margin-top: 0;
92
+ }
93
+ &:last-child {
94
+ margin-bottom: 0;
95
+ }
96
+ }
97
+ }
98
+
99
+ p:lang(zh) {
100
+ text-indent: 2em;
101
+ }
102
+
103
+ }
@@ -1,35 +1,35 @@
1
- .u-thinscrollbar {
2
- overflow-y: scroll;
3
-
4
- // entire scrollbar
5
- &::-webkit-scrollbar {
6
- width: 4px;
7
- background-color: transparent;
8
- }
9
-
10
- // handle
11
- &::-webkit-scrollbar-thumb {
12
- border-radius: $border-radius-object;
13
- background-color: transparent;
14
- }
15
-
16
- // track bar
17
- &::-webkit-scrollbar-track {
18
- display: none;
19
- }
20
-
21
- // arrow buttons
22
- &::-webkit-scrollbar-button {
23
- display: none;
24
- }
25
-
26
- &:hover {
27
- &::-webkit-scrollbar-thumb {
28
- background-color: hsl(var(--db-accent-color-h), var(--db-accent-color-s), 80%);
29
-
30
- &:hover {
31
- background-color: hsl(var(--db-accent-color-h), var(--db-accent-color-s), 70%);
32
- }
33
- }
34
- }
35
- }
1
+ .u-thinscrollbar {
2
+ overflow-y: scroll;
3
+
4
+ // entire scrollbar
5
+ &::-webkit-scrollbar {
6
+ width: 4px;
7
+ background-color: transparent;
8
+ }
9
+
10
+ // handle
11
+ &::-webkit-scrollbar-thumb {
12
+ border-radius: $border-radius-object;
13
+ background-color: transparent;
14
+ }
15
+
16
+ // track bar
17
+ &::-webkit-scrollbar-track {
18
+ display: none;
19
+ }
20
+
21
+ // arrow buttons
22
+ &::-webkit-scrollbar-button {
23
+ display: none;
24
+ }
25
+
26
+ &:hover {
27
+ &::-webkit-scrollbar-thumb {
28
+ background-color: hsl(var(--db-accent-color-h), var(--db-accent-color-s), 80%);
29
+
30
+ &:hover {
31
+ background-color: hsl(var(--db-accent-color-h), var(--db-accent-color-s), 70%);
32
+ }
33
+ }
34
+ }
35
+ }
@@ -1,6 +1,6 @@
1
- ---
2
- # Only the main Sass file needs front matter (the dashes are enough)
3
- ---
4
- @charset "utf-8";
5
-
6
- @import "databook";
1
+ ---
2
+ # Only the main Sass file needs front matter (the dashes are enough)
3
+ ---
4
+ @charset "utf-8";
5
+
6
+ @import "databook";
@@ -1,8 +1,8 @@
1
- ---
2
- ---
3
-
4
- document.documentElement.classList.add('js-loaded');
5
-
6
- {% include js/codes.js %}
7
-
8
- {% include js/scrollspy.js %}
1
+ ---
2
+ ---
3
+
4
+ document.documentElement.classList.add('js-loaded');
5
+
6
+ {% include js/codes.js %}
7
+
8
+ {% include js/scrollspy.js %}
@@ -1,47 +1,47 @@
1
- function query(json) {
2
- let params = new URLSearchParams(location.search);
3
- let keywords = params.get('q').split(' ').filter(x => x.length > 0);
4
- if (keywords.length == 0) return [];
5
- let reg = new RegExp( keywords.join('|'), 'i');
6
-
7
- let results = [];
8
- for (let item of json) {
9
- if (item.title && reg.test(item.title)) {
10
- results.push(item);
11
- break;
12
- }
13
- if (item.content && reg.test(item.content)) {
14
- results.push(item);
15
- break;
16
- }
17
- }
18
-
19
- return results;
20
- }
21
-
22
- function render(results) {
23
- let resultTemplate = document.querySelector(".js-search-result").innerHTML;
24
- let resultText = resultTemplate.replace('{0}', results.length);
25
- document.querySelector('.c-title__meta').innerHTML = resultText;
26
-
27
- let html = ``;
28
- html += `<div class="c-blog-list">`;
29
- for(let item of results) {
30
- html += `
31
- <div class="c-blog-list__item">
32
- <div class="c-blog-list__title">
33
- <a class="c-blog-list__link" href="${item.url}">${item.title}</a>
34
- </div>
35
- <div class="c-blog-list__content">${item.content?.slice(0, 256) || ''}</div>
36
- </div>
37
- `;
38
- }
39
- html += `</div>`;
40
-
41
- document.querySelector('.js-search').innerHTML = html;
42
- }
43
-
44
- fetch("/assets/search.json")
45
- .then(response => response.json())
46
- .then(query)
47
- .then(render);
1
+ function query(json) {
2
+ let params = new URLSearchParams(location.search);
3
+ let keywords = params.get('q').split(' ').filter(x => x.length > 0);
4
+ if (keywords.length == 0) return [];
5
+ let reg = new RegExp( keywords.join('|'), 'i');
6
+
7
+ let results = [];
8
+ for (let item of json) {
9
+ if (item.title && reg.test(item.title)) {
10
+ results.push(item);
11
+ break;
12
+ }
13
+ if (item.content && reg.test(item.content)) {
14
+ results.push(item);
15
+ break;
16
+ }
17
+ }
18
+
19
+ return results;
20
+ }
21
+
22
+ function render(results) {
23
+ let resultTemplate = document.querySelector(".js-search-result").innerHTML;
24
+ let resultText = resultTemplate.replace('{0}', results.length);
25
+ document.querySelector('.c-title__meta').innerHTML = resultText;
26
+
27
+ let html = ``;
28
+ html += `<div class="c-blog-list">`;
29
+ for(let item of results) {
30
+ html += `
31
+ <div class="c-blog-list__item">
32
+ <div class="c-blog-list__title">
33
+ <a class="c-blog-list__link" href="${item.url}">${item.title}</a>
34
+ </div>
35
+ <div class="c-blog-list__content">${item.content?.slice(0, 256) || ''}</div>
36
+ </div>
37
+ `;
38
+ }
39
+ html += `</div>`;
40
+
41
+ document.querySelector('.js-search').innerHTML = html;
42
+ }
43
+
44
+ fetch("/assets/search.json")
45
+ .then(response => response.json())
46
+ .then(query)
47
+ .then(render);
@@ -1,9 +1,9 @@
1
- ---
2
- ---
3
- {%- capture version -%}
4
- {%- include version -%}
5
- {%- endcapture -%}
6
-
7
- {
8
- "version": "{{- version | strip | strip_newlines -}}"
9
- }
1
+ ---
2
+ ---
3
+ {%- capture version -%}
4
+ {%- include version -%}
5
+ {%- endcapture -%}
6
+
7
+ {
8
+ "version": "{{- version | strip | strip_newlines -}}"
9
+ }