jekyll-theme-doodle 5.1.9 → 5.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb7883ecaae0f182f8068c610a96a1e0b0693094a9c72fbfe6c217fd9d6db664
4
- data.tar.gz: 8929366066eb7e901899dd32f74ec2f17fbb6cb8d4ff3f81ed9aac22c9b894c9
3
+ metadata.gz: 18a9a55074a8a22ed0b3e3bb3fa0e24a749217a71118ce4a8a864d4b07d54c6b
4
+ data.tar.gz: b8653371ee46f39f9cc01f78df94b7d04a36b99ba36c82baff4a3b4a03f60348
5
5
  SHA512:
6
- metadata.gz: f1164ea9426b7412592b4cffef94295da6e89c2aab08cfa61260d94dce3eeffd0d3749880f97f20acd53920cf78d79bed9811f120482496e74996b61f124ba0c
7
- data.tar.gz: 272b3b39b923c6f0d0f70604a98fb6712af42fdfd4170ed846db38461e92f03e624e25a731208aacb4d37e5531343141a5193a95ec8108e89337855472fd6eb1
6
+ metadata.gz: 833120d18cae14e8744d74357111c8d5bf8c8416485501e64725beeb4d0d19579b25a97112464a9730b1459d94f2cddc353d9c953065b4eb76b82efb71793381
7
+ data.tar.gz: 0b885e10752f19e9d1e0045ca4b35374dbef5900b514aea2eaf762f7167e63d42ea38bb2e9749b2bc3ec6745c74a608b0190f1b2181a5a19036a224b21ee7485
data/README.md CHANGED
@@ -17,9 +17,9 @@
17
17
 
18
18
  ## Features
19
19
 
20
- - dark mode
21
- - 5 color schemes
22
- - pinned posts
20
+ - automatic table of contents generation
21
+ - dark mode with 5 color schemes
22
+ - pinned/featured posts at top of home page
23
23
  - handwriting fonts
24
24
  - google analytics support
25
25
 
data/_layouts/post.html CHANGED
@@ -1,35 +1,52 @@
1
1
  ---
2
2
  layout: default
3
3
  ---
4
+
4
5
  <div class="wrapper">
5
- <article class="post h-entry" itemscope itemtype="http://schema.org/BlogPosting">
6
+ <article
7
+ class="post h-entry"
8
+ itemscope
9
+ itemtype="http://schema.org/BlogPosting"
10
+ >
6
11
  <header class="post-header">
7
- <h1 class="post-title p-name" itemprop="name headline">{{ page.title | escape }}</h1>
12
+ <h1 class="post-title p-name" itemprop="name headline">
13
+ {{ page.title | escape }}
14
+ </h1>
8
15
  {%- if page.image -%}
9
- <img src="{{- page.image | relative_url -}}" alt="" class="featured-image">
16
+ <img
17
+ src="{{- page.image | relative_url -}}"
18
+ alt=""
19
+ class="featured-image"
20
+ />
10
21
  {%- endif -%}
11
22
  <p class="post-meta">
12
- <time class="dt-published" datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">
13
- {%- assign date_format = site.minima.date_format | default: '%b %-d, %Y' -%}
14
- {{ page.date | date: date_format }}
23
+ <time
24
+ class="dt-published"
25
+ datetime="{{ page.date | date_to_xmlschema }}"
26
+ itemprop="datePublished"
27
+ >
28
+ {%- assign date_format = site.minima.date_format | default: '%b %-d,
29
+ %Y' -%} {{ page.date | date: date_format }}
15
30
  </time>
16
- {%- if page.author -%}
17
-
18
- <span itemprop="author" itemscope itemtype="http://schema.org/Person"
19
- ><span class="p-author h-card" itemprop="name">{{ page.author }}</span></span
20
- >
31
+ {%- if page.author -%}
32
+ <span itemprop="author" itemscope itemtype="http://schema.org/Person"
33
+ ><span class="p-author h-card" itemprop="name"
34
+ >{{ page.author }}</span
35
+ ></span
36
+ >
21
37
  {%- endif -%}
22
38
  </p>
39
+ <div id="toc">
40
+ </div>
23
41
  </header>
24
-
42
+
25
43
  <div class="post-content e-content" itemprop="articleBody">
26
44
  {{ content }}
27
45
  </div>
28
-
29
- {%- if site.disqus.shortname -%}
30
- {%- include disqus_comments.html -%}
31
- {%- endif -%}
32
-
46
+
47
+ {%- if site.disqus.shortname -%} {%- include disqus_comments.html -%} {%-
48
+ endif -%}
49
+
33
50
  <a class="u-url" href="{{ page.url | relative_url }}" hidden></a>
34
51
  </article>
35
52
  </div>
@@ -182,6 +182,8 @@ blockquote {
182
182
  }
183
183
  @include media-query($on-palm) {
184
184
  padding-left: $spacing-unit/2;
185
+ padding-left: 0px;
186
+ padding-right: 0px;
185
187
  }
186
188
  }
187
189
 
@@ -2,6 +2,8 @@
2
2
  padding: $spacing-unit 0;
3
3
  @include media-query($on-palm) {
4
4
  padding-bottom: 100px;
5
+ padding-left: 10px;
6
+ padding-right: 10px
5
7
  }
6
8
  }
7
9
 
@@ -36,6 +36,9 @@
36
36
  @include media-query($on-laptop) {
37
37
  @include relative-font-size(2.25);
38
38
  }
39
+ @include media-query($on-palm) {
40
+ margin: 12px;
41
+ }
39
42
  }
40
43
  .post {
41
44
  background: var(--md-sys-color-surface);
@@ -0,0 +1,41 @@
1
+ #toc {
2
+ &::-webkit-scrollbar {
3
+ display: none;
4
+ }
5
+
6
+ /* Hide scrollbar for IE, Edge and Firefox */
7
+ -ms-overflow-style: none; /* IE and Edge */
8
+ scrollbar-width: none; /* Firefox */
9
+ @media screen and (min-width: 1440px) {
10
+ position: fixed;
11
+ right: 12px;
12
+ top: 0px;
13
+ display: flex;
14
+ flex-direction: column;
15
+ align-items: center;
16
+ justify-content: center;
17
+ width: calc(100vw - 1230px);
18
+
19
+ height: 100vh;
20
+ overflow-y: scroll;
21
+ }
22
+ }
23
+ .toc {
24
+ list-style-type: none;
25
+ margin-left: 8px;
26
+ a {
27
+ color: var(--md-sys-color-tertiary);
28
+ }
29
+ }
30
+ .toc-H1 {
31
+ font-size: 17px;
32
+ }
33
+
34
+ .toc-H2 {
35
+ padding-left: 14px;
36
+ font-size: 16px;
37
+ }
38
+ .toc-H3 {
39
+ padding-left: 30px;
40
+ font-size: 16px;
41
+ }
data/_sass/minima.scss CHANGED
@@ -46,6 +46,6 @@ $on-laptop: 800px !default;
46
46
 
47
47
  // Import partials.
48
48
  @import "minima/fonts", "minima/theme", "minima/base", "minima/header",
49
- "minima/page", "minima/posts", "minima/syntax-highlighting",
49
+ "minima/page", "minima/posts","minima/toc", "minima/syntax-highlighting",
50
50
  "minima/navigation-bar", "minima/pinned-post", "minima/theme-selector",
51
51
  "minima/footer";
@@ -39,4 +39,33 @@
39
39
  root.className = activeMode;
40
40
  window.localStorage.setItem("theme", activeMode);
41
41
  });
42
+
43
+ document.addEventListener("DOMContentLoaded", function () {
44
+ const toc = document.getElementById("toc");
45
+ if (toc) {
46
+ const content = document.querySelector(".post");
47
+ const headings = content.querySelectorAll("h1, h2, h3");
48
+
49
+ const ul = document.createElement("ul");
50
+ ul.className = "toc";
51
+
52
+ if (headings.length > 0) {
53
+ const title = document.createElement("h3");
54
+ title.innerText = "Table of contents";
55
+ toc.appendChild(title);
56
+
57
+ headings.forEach((heading) => {
58
+ const li = document.createElement("li");
59
+ const a = document.createElement("a");
60
+ a.href = "#" + heading.id;
61
+ a.textContent = heading.textContent;
62
+ li.appendChild(a);
63
+ li.className = `toc-${heading.tagName}`;
64
+ ul.appendChild(li);
65
+ });
66
+
67
+ toc.appendChild(ul);
68
+ }
69
+ }
70
+ });
42
71
  })();
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-doodle
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.9
4
+ version: 5.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gul Noor
@@ -82,6 +82,7 @@ files:
82
82
  - _sass/minima/_syntax-highlighting.scss
83
83
  - _sass/minima/_theme-selector.scss
84
84
  - _sass/minima/_theme.scss
85
+ - _sass/minima/_toc.scss
85
86
  - assets/main.scss
86
87
  - assets/minima-social-icons.svg
87
88
  - assets/theme-assets/js/theme.js