jekyll-text-theme 1.4.3 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -6
  3. data/_data/locale.yml +21 -3
  4. data/_data/variables.yml +31 -0
  5. data/_includes/{blog → components}/article-data.html +4 -2
  6. data/_includes/{info → components}/follow-me.html +1 -1
  7. data/_includes/{blog → components}/footer.html +1 -1
  8. data/_includes/components/header.html +42 -0
  9. data/_includes/{blog → components}/license.html +0 -0
  10. data/_includes/{blog → components}/tags.html +5 -6
  11. data/_includes/icon/clear.svg +3 -0
  12. data/_includes/icon/link.svg +1 -0
  13. data/_includes/icon/omit.svg +1 -0
  14. data/_includes/icon/search.svg +3 -0
  15. data/_includes/icon/{mail.svg → social/mail.svg} +0 -0
  16. data/_includes/scripts/all.html +244 -0
  17. data/_includes/scripts/common.html +30 -0
  18. data/_includes/scripts/data.html +27 -0
  19. data/_includes/scripts/home.html +26 -0
  20. data/_includes/scripts/page-post.html +32 -0
  21. data/_includes/scripts/post.html +183 -0
  22. data/_includes/scripts/utils.html +180 -0
  23. data/_includes/snippets/get-lang.html +2 -2
  24. data/_includes/snippets/get-sources.html +5 -0
  25. data/_includes/utils/chart.html +17 -0
  26. data/_includes/utils/comment-disqus.html +0 -3
  27. data/_includes/utils/comment-gitalk.html +15 -12
  28. data/_includes/utils/google-analytics.html +6 -8
  29. data/_includes/utils/mathjax.html +10 -4
  30. data/_includes/utils/mermaid.html +5 -4
  31. data/_layouts/all.html +10 -131
  32. data/_layouts/base.html +38 -0
  33. data/_layouts/error-404.html +1 -1
  34. data/_layouts/home.html +81 -68
  35. data/_layouts/page.html +3 -3
  36. data/_layouts/post.html +32 -172
  37. data/_sass/animate/_fade-in-down.scss +10 -0
  38. data/_sass/animate/_fade-in.scss +8 -0
  39. data/_sass/colors/{_colors.chocolate.scss → _chocolate.scss} +9 -3
  40. data/_sass/colors/{_colors.dark.scss → _dark.scss} +10 -3
  41. data/_sass/colors/{_colors.default.scss → _default.scss} +10 -4
  42. data/_sass/colors/{_colors.forest.scss → _forest.scss} +9 -3
  43. data/_sass/colors/{_colors.ocean.scss → _ocean.scss} +9 -3
  44. data/_sass/colors/{_colors.orange.scss → _orange.scss} +9 -3
  45. data/_sass/common/_classes.scss +15 -0
  46. data/_sass/{settings → common}/_highlighting.scss +0 -12
  47. data/_sass/common/_reset.scss +171 -0
  48. data/_sass/common/_variables.scss +64 -0
  49. data/_sass/common/classes/_animation.scss +4 -0
  50. data/_sass/common/classes/_clearfix.scss +7 -0
  51. data/_sass/{mixins → common/classes}/_flex.scss +0 -0
  52. data/_sass/common/classes/_link.scss +161 -0
  53. data/_sass/common/classes/_media.scss +18 -0
  54. data/_sass/common/classes/_shadow.scss +14 -0
  55. data/_sass/common/classes/_shape.scss +19 -0
  56. data/_sass/common/classes/_space.scss +40 -0
  57. data/_sass/common/classes/_split-line.scss +24 -0
  58. data/_sass/common/classes/_transform.scss +4 -0
  59. data/_sass/common/classes/_transition.scss +4 -0
  60. data/_sass/common/classes/_user-select.scss +6 -0
  61. data/_sass/common/components/_button.scss +72 -0
  62. data/_sass/components/_article.content.extra.scss +41 -0
  63. data/_sass/components/_article.content.scss +127 -69
  64. data/_sass/components/_article.data.scss +11 -11
  65. data/_sass/components/_follow-me.scss +27 -34
  66. data/_sass/components/_footer.scss +4 -4
  67. data/_sass/components/_header.scss +35 -22
  68. data/_sass/components/_license.scss +7 -7
  69. data/_sass/components/_main.scss +23 -0
  70. data/_sass/components/_pagination.scss +12 -0
  71. data/_sass/components/_tags.scss +30 -15
  72. data/_sass/components/_toc.scss +32 -19
  73. data/_sass/layout/_all.scss +82 -0
  74. data/_sass/layout/_default.scss +19 -0
  75. data/_sass/{blog/_page.error-404.scss → layout/_error-404.scss} +1 -1
  76. data/_sass/layout/_home.scss +61 -0
  77. data/_sass/layout/_post.scss +80 -0
  78. data/assets/css/blog.scss +29 -34
  79. data/assets/images/logo/logo.svg +1 -1
  80. metadata +56 -38
  81. data/_includes/blog/header.html +0 -56
  82. data/_layouts/blog-base.html +0 -36
  83. data/_layouts/blog-default.html +0 -7
  84. data/_sass/base/_animate.scss +0 -19
  85. data/_sass/base/_base.scss +0 -83
  86. data/_sass/base/_image&icon.scss +0 -23
  87. data/_sass/base/_links.scss +0 -73
  88. data/_sass/base/_text.scss +0 -56
  89. data/_sass/blog/_layout.base.scss +0 -3
  90. data/_sass/blog/_layout.default.scss +0 -21
  91. data/_sass/blog/_layout.post.scss +0 -68
  92. data/_sass/blog/_page.all.scss +0 -35
  93. data/_sass/blog/_page.index.scss +0 -50
  94. data/_sass/components/_wrapper.scss +0 -29
  95. data/_sass/mixins/_link.scss +0 -67
  96. data/_sass/mixins/_media.scss +0 -12
  97. data/_sass/mixins/_prefix.scss +0 -14
  98. data/_sass/mixins/_shape.scss +0 -19
  99. data/_sass/settings/_base.scss +0 -12
  100. data/_sass/settings/_colors.scss +0 -9
  101. data/_sass/settings/_font.scss +0 -32
@@ -0,0 +1,19 @@
1
+ @mixin round($length: default) {
2
+ @if $length == default {
3
+ $length: map-get($shape, round-length);
4
+ }
5
+ width: $length;
6
+ height: $length;
7
+ border-radius: 50%;
8
+ }
9
+
10
+ @mixin round-rect($radius: default, $padding: default) {
11
+ @if $radius == default {
12
+ $radius: map-get($shape, round-rect-radius);
13
+ }
14
+ @if $padding == default {
15
+ $padding: 0;
16
+ }
17
+ padding: $padding;
18
+ border-radius: $radius;
19
+ }
@@ -0,0 +1,40 @@
1
+ @mixin horizontal-space($horizontal-space: default, $horizontal-item-vertical-space: default, $wrap: default) {
2
+ @if $horizontal-space == default {
3
+ $horizontal-space: map-get($base, horizontal-space);
4
+ }
5
+ @if $horizontal-item-vertical-space == default {
6
+ $horizontal-item-vertical-space: map-get($base, horizontal-item-vertical-space);
7
+ }
8
+ @if $wrap == default {
9
+ $wrap: wrap;
10
+ }
11
+ @include flexbox;
12
+ @include flex-wrap($wrap);
13
+ &>* {
14
+ @if $horizontal-item-vertical-space != none {
15
+ margin-top: $horizontal-item-vertical-space;
16
+ margin-bottom: $horizontal-item-vertical-space;
17
+ }
18
+ list-style-type: none;
19
+ margin-right: $horizontal-space;
20
+ &:last-child {
21
+ margin-right: 0;
22
+ }
23
+ }
24
+ }
25
+
26
+ @mixin vertical-space($vertical-space: default) {
27
+ @if $vertical-space == default {
28
+ $vertical-space: map-get($base, vertical-space);
29
+ }
30
+ @include flexbox;
31
+ @include flex-direction(column);
32
+ @include flex-wrap(wrap);
33
+ &>* {
34
+ list-style-type: none;
35
+ margin-bottom: $vertical-space;
36
+ &:last-child {
37
+ margin-bottom: 0;
38
+ }
39
+ }
40
+ }
@@ -0,0 +1,24 @@
1
+ @mixin split-line($direction: default, $width: default, $color: default) {
2
+ @if $direction == default {
3
+ $direction: top;
4
+ }
5
+ @if $color == default {
6
+ $color: $border-color-l;
7
+ }
8
+ @if $width == default {
9
+ $width: 1px;
10
+ }
11
+ border: 0 solid $color;
12
+ @if $direction == top {
13
+ border-top-width: $width;
14
+ }
15
+ @if $direction == right {
16
+ border-right-width: $width;
17
+ }
18
+ @if $direction == bottom {
19
+ border-bottom-width: $width;
20
+ }
21
+ @if $direction == left {
22
+ border-left-width: $width;
23
+ }
24
+ }
@@ -0,0 +1,4 @@
1
+ @mixin transform($value) {
2
+ -webkit-transform: $value;
3
+ transform: $value;
4
+ }
@@ -0,0 +1,4 @@
1
+ @mixin transition($value) {
2
+ -webkit-transition: $value;
3
+ transition: $value;
4
+ }
@@ -0,0 +1,6 @@
1
+ @mixin user-select($value) {
2
+ -webkit-user-select: $value;
3
+ -moz-user-select: $value;
4
+ -ms-user-select: $value;
5
+ user-select: $value;
6
+ }
@@ -0,0 +1,72 @@
1
+ %button {
2
+ font-weight: map-get($base, font-weight-bold);
3
+ line-height: 1;
4
+ box-sizing: border-box;
5
+ display: block;
6
+ cursor: pointer;
7
+ @include link-normal() {
8
+ text-decoration: none;
9
+ }
10
+ .not-touch &, & {
11
+ @include link-hover() {
12
+ text-decoration: none;
13
+ }
14
+ }
15
+ @include link-active() {
16
+ text-decoration: none;
17
+ }
18
+ @include link-focus() {
19
+ text-decoration: none;
20
+ }
21
+ @include link-colors($text-color-3, $main-color-3, $text-color-1, $main-color-1, $text-color-1, $main-color-1);
22
+ @include link-animation();
23
+ svg {
24
+ width: 1rem;
25
+ height: 1rem;
26
+ path {
27
+ @include link-animation();
28
+ }
29
+ }
30
+ &.inactive {
31
+ cursor: not-allowed;
32
+ @include link-normal() {
33
+ color: rgba($text-color-3, .2) !important;
34
+ background-color: $main-color-3 !important;
35
+ svg path {
36
+ fill: rgba($text-color-3, .2) !important;
37
+ }
38
+ }
39
+ @include link-emphasize() {
40
+ color: rgba($text-color-3, .2) !important;
41
+ background-color: $main-color-3 !important;
42
+ svg path {
43
+ fill: rgba($text-color-3, .2) !important;
44
+ }
45
+ }
46
+ }
47
+ }
48
+
49
+ %floating-action {
50
+ @include box-shadow(2);
51
+ &:hover {
52
+ @include box-shadow(3);
53
+ }
54
+ }
55
+
56
+ .round-button {
57
+ @extend %button;
58
+ @include round;
59
+ @include flexbox;
60
+ @include justify-content(center);
61
+ @include align-items(center);
62
+ }
63
+
64
+ .floating-action-round-button {
65
+ @extend .round-button;
66
+ @extend %floating-action;
67
+ }
68
+
69
+ .pill-button {
70
+ @extend %button;
71
+ @include round-rect(2rem, .4rem .6rem);
72
+ }
@@ -0,0 +1,41 @@
1
+ .m-article-content {
2
+ p.success {
3
+ @include round-rect(default, .5rem 1rem);
4
+ background-color: mix($green, $background-color, 10%);
5
+ border: 1px solid $green;
6
+ }
7
+
8
+ p.info {
9
+ @include round-rect(default, .5rem 1rem);
10
+ background-color: mix($blue, $background-color, 10%);
11
+ border: 1px solid $blue;
12
+ }
13
+
14
+ p.warning {
15
+ @include round-rect(default, .5rem 1rem);
16
+ background-color: mix($yellow, $background-color, 10%);
17
+ border: 1px solid $yellow;
18
+ }
19
+
20
+ p.error {
21
+ @include round-rect(default, .5rem 1rem);
22
+ background-color: mix($red, $background-color, 10%);
23
+ border: 1px solid $red;
24
+ }
25
+
26
+ img.shadow, .shadow > img {
27
+ @include box-shadow(3);
28
+ }
29
+
30
+ img.border, .border > img {
31
+ border: 1px solid $border-color-l;
32
+ }
33
+
34
+ img.rounded, .rounded > img {
35
+ border-radius: map-get($shape, round-rect-radius);
36
+ }
37
+
38
+ img.circle, .circle > img {
39
+ border-radius: 50%;
40
+ }
41
+ }
@@ -1,102 +1,170 @@
1
1
  .m-article-content {
2
2
  word-wrap: break-word;
3
- line-height: $article-line-height;
4
- h1,
5
- h2,
6
- h3,
7
- h4,
8
- h5,
9
- h6 {
10
- margin: $content-gap * 2 0 $content-gap * .5 0;
3
+ line-height: map-get($base, line-height-large);
4
+ @include block-elements() {
5
+ margin: map-get($base, vertical-space-large) 0;
6
+ }
7
+ @include heading-elements() {
8
+ position: relative;
9
+ margin-top: map-get($base, vertical-space-large) * 1.5;
10
+ & > .anchor {
11
+ @include link-text-colors($border-color, $main-color-1, $main-color-1);
12
+ margin-left: .2rem;
13
+ visibility: hidden;
14
+ text-decoration: none;
15
+ opacity: 0;
16
+ & > svg {
17
+ width: map-get($base, font-size);
18
+ height: map-get($base, font-size);
19
+ margin-bottom: - .2 * map-get($base, font-size);
20
+ }
21
+ }
22
+ &:hover {
23
+ & > .anchor {
24
+ visibility: visible;
25
+ opacity: 1;
26
+ cursor: pointer;
27
+ }
28
+ }
11
29
  }
12
30
  h1,
13
31
  h2 {
14
- padding: 0 0 $base-font-size * .3 0;
15
- border: 0 dashed $border-color;
16
- border-bottom-width: 2px;
17
- margin-bottom: $content-gap;
32
+ @include split-line(bottom);
18
33
  }
19
- p {
20
- margin: $content-gap 0;
34
+ hr {
35
+ border: none;
36
+ &::before {
37
+ content: '...';
38
+ font-size: map-get($base, font-size-h3);
39
+ color: $text-color-l;
40
+ display: block;
41
+ letter-spacing: .8em;
42
+ text-align: center;
43
+ }
21
44
  }
22
45
  blockquote {
23
- padding: 0 0 0 $spacing-unit / 2;
24
- border: 0 solid $border-color;
25
- border-left-width: 4px;
26
- margin: $content-gap 0;
27
- font-size: $small-font-size;
46
+ padding-left: 1rem;
47
+ @include split-line(left, 4px, $border-color);
48
+ font-size: map-get($base, font-size-sub);
28
49
  color: $text-color-l;
29
50
  p {
30
- margin: $content-gap * .5 0;
51
+ margin: map-get($base, vertical-space) 0;
31
52
  }
32
- > :last-child {
53
+ &>:last-child {
33
54
  margin-bottom: 0;
34
55
  }
35
56
  }
36
57
  img:not(.emoji) {
37
58
  max-width: 100%;
38
- max-height: 600px;
59
+ max-height: 37rem;
39
60
  vertical-align: middle;
40
61
  }
41
62
  .emoji {
42
63
  display: inline-block;
43
64
  vertical-align: text-bottom;
44
- width: $base-font-size * $article-line-height * .7;
45
- height: $base-font-size * $article-line-height * .7;
65
+ width: map-get($base, line-height-large) * .7rem;
66
+ height: map-get($base, line-height-large) * .7rem;
67
+ }
68
+ .footnotes {
69
+ @include split-line();
70
+ margin-top: map-get($base, vertical-space-large) * 2;
46
71
  }
47
72
  code {
48
- @include round-rect($round-rect-radius, $base-font-size * .2 $base-font-size * .5);
73
+ @include round-rect(default, .2rem .5rem);
74
+ background-color: $text-background-color;
49
75
  span {
50
76
  padding: 0;
51
77
  margin: 0;
52
78
  }
53
79
  }
54
- div.highlighter-rouge, figure, pre {
55
- margin: $content-gap 0;
56
- }
57
- code.language-mermaid {
58
- background-color: $background-color;
59
- }
60
80
  pre {
61
- display: block;
62
81
  overflow: auto;
63
82
  -webkit-overflow-scrolling: touch;
64
- border-radius: $round-rect-radius;
65
83
  &>code {
66
- padding-top: $code-font-size * 1.5;
67
- padding-bottom: $code-font-size * 1.3;
68
- font-size: $code-font-size;
84
+ padding: 0;
85
+ background-color: transparent;
69
86
  word-wrap: normal;
87
+ &.language-mermaid, &.language-chart {
88
+ display: none;
89
+ &[data-processed] {
90
+ display: block;
91
+ }
92
+ }
93
+ }
94
+ }
95
+ .highlighter-rouge>.highlight, figure.highlight {
96
+ &>pre {
97
+ @include round-rect(default, 1rem 0 1rem 1rem);
70
98
  margin: 0;
71
- display: block;
72
- line-height: $code-line-height;
99
+ background-color: $text-background-color;
100
+ &>code {
101
+ display: block;
102
+ }
73
103
  }
74
104
  }
75
- figure {
105
+ figure.highlight {
76
106
  &:before {
77
107
  content: attr(data-lang);
78
108
  display: block;
79
- border-top-left-radius: $round-rect-radius;
80
- border-top-right-radius: $round-rect-radius;
81
- padding: $code-font-size / 2 $code-font-size $code-font-size / 2 0;
109
+ border-top-left-radius: map-get($shape, round-rect-radius);
110
+ border-top-right-radius: map-get($shape, round-rect-radius);
111
+ padding: .5rem 1rem .5rem 0;
82
112
  color: $decorate-color;
83
- font-weight: $bold-font-weight;
84
- font-size: $base-font-size;
113
+ background-color: $text-background-color;
114
+ font-weight: map-get($base, font-weight-bold);
85
115
  text-align: right;
86
116
  text-transform: uppercase;
87
117
  }
88
118
  &>pre {
89
- margin: 0;
119
+ padding-top: 0;
90
120
  border-top-left-radius: 0;
91
121
  border-top-right-radius: 0;
92
122
  &>code {
93
- padding-top: 0;
123
+ &>.rouge-table {
124
+ width: auto;
125
+ margin: 0 0 -1rem -1rem;
126
+ tbody, tr, td {
127
+ border: none;
128
+ padding-top: 0;
129
+ padding-bottom: 0;
130
+ }
131
+ &>tbody {
132
+ @include flexbox;
133
+ &>tr {
134
+ width: 100%;
135
+ @include flexbox;
136
+ &>.code {
137
+ padding: 0 0 1rem .5rem;
138
+ overflow: auto;
139
+ -webkit-overflow-scrolling: touch;
140
+ }
141
+ }
142
+ }
143
+ tbody td {
144
+ &.gl {
145
+ padding-left: 1rem;
146
+ }
147
+ &>pre {
148
+ @include round-rect(0);
149
+ display: block;
150
+ overflow: visible;
151
+ margin: 0;
152
+ &.lineno {
153
+ color: $text-color-l;
154
+ @include user-select(none);
155
+ }
156
+ }
157
+ }
158
+ }
94
159
  }
95
160
  }
96
161
  }
97
- ul,
98
- ol {
99
- margin: $content-gap 0 $content-gap $spacing-unit;
162
+ ul, ol {
163
+ margin-left: 1.5rem;
164
+ ul, ol {
165
+ margin-top: 0;
166
+ margin-bottom: 0;
167
+ }
100
168
  li {
101
169
  margin: 0;
102
170
  p {
@@ -105,19 +173,17 @@
105
173
  }
106
174
  }
107
175
  dl {
108
- margin: $content-gap 0;
109
- dt,
110
- dd {
176
+ dt, dd {
111
177
  margin: 0;
112
178
  p {
113
179
  margin: 0;
114
180
  }
115
181
  }
116
182
  dt {
117
- font-weight: $bold-font-weight;
183
+ font-weight: map-get($base, font-weight-bold);
118
184
  }
119
185
  dd {
120
- margin-left: 2em;
186
+ margin-left: 2rem;
121
187
  }
122
188
  }
123
189
  table {
@@ -125,24 +191,16 @@
125
191
  width: 100%;
126
192
  overflow-x: auto;
127
193
  -webkit-overflow-scrolling: touch;
128
- margin: $content-gap 0;
129
194
  border-collapse: collapse;
130
- th,
131
- td {
132
- border: 1px solid $border-color;
133
- padding: $base-font-size * .5;
195
+ thead, tfoot {
196
+ background-color: $text-background-color;
134
197
  }
135
- thead,
136
- tbody {
137
- border: 1px solid $border-color;
198
+ th, td {
199
+ border: 1px solid $border-color-l;
200
+ padding: .5rem;
138
201
  }
139
- tbody>tr:nth-child(even) {
140
- background-color: $text-background-color;
202
+ th {
203
+ font-weight: map-get($base, font-weight-bold);
141
204
  }
142
205
  }
143
- hr {
144
- border: 0 dashed $border-color;
145
- border-top-width: 2px;
146
- margin: $base-font-size 0;
147
- }
148
206
  }