sobekyll 0.1.1 → 0.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: 3ae308da243d4e11ec69d0f11d50ea2cccd21492775e9766a377f3f4d34bf63f
4
- data.tar.gz: '095b6fb5753621ce960dfcce8b6df01aab2977b37824bf1b16b10859e255e14d'
3
+ metadata.gz: afaf1e10b98dcbeb133c4dfaa254c1ded4a2eb5a2aa4afe0a283e824f08738d7
4
+ data.tar.gz: 5436927751f8bc2ffe95672af0179ef5e5101101cbaf672a00cd6e893d3d4aad
5
5
  SHA512:
6
- metadata.gz: f7b6aa9058a47804c1dd107c62402507d9ec1f0c860c116dcc7c0770ac01df6cb857d7750bc93ecb503320e85486a6bf742409d5fae1329c9dcc5e3acb9a9ee6
7
- data.tar.gz: b56a922c81afa5a21860bf527a56ed20fed4fd9c9b0a6d13fefab569153fb293146c98296acd87a2010be4b8a8273dcc2619a2ec4ebb9a4004e876c359c551ab
6
+ metadata.gz: 23eb872ebc64db620f3f227f6c7155b6a0d3e394d3bcb3414fa3c334a9d455229392f7085a6297898514c87511c55358b2dcec62493afa3db2dbedf2fc22d22f
7
+ data.tar.gz: 3f0e102bdb65f69bf39a2245764d7309666826e63c37e115f086ba5ce4325c931c11bb24360b61e3a9706f80a01a7f708d962cb97112d59c4094ef6ccc4ba30a
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
1
  /site
2
2
  Gemfile.lock
3
- sobekyll-*.*.*.gem
3
+ sobekyll-*.*.*.gem
4
+ **/*.DS_Store
data/Gemfile CHANGED
@@ -1,8 +1,8 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem "jekyll", "~> 4.3.0" # 指定 Jekyll 的版本
3
+ gem "jekyll", "~> 3.10.0" # 指定 Jekyll 的版本
4
4
  gem "webrick", "~> 1.7" # 解决 Jekyll serve 在某些环境下的依赖问题
5
5
  gem 'rouge'
6
6
  gem "jekyll-paginate"
7
-
8
- gem "sobekyll", path: "."
7
+ # gem 'jekyll-tagging'
8
+ gem 'jekyll-archives'
data/_config.yml CHANGED
@@ -1,7 +1,6 @@
1
1
  title: "Sobekyll"
2
2
  description: "A custom Jekyll theme"
3
3
  baseurl: "" # 设置为空或指定子目录路径
4
- author: "Your Name"
5
4
 
6
5
  plugins:
7
6
  - jekyll-paginate
@@ -0,0 +1,3 @@
1
+ <footer style="max-width: 100%; padding: 24px;">
2
+ Powered by <a href="https://sobekyll.github.io/">Sobekyll</a>, based on <a href="https://jekyllrb.com/">Jekyll</a> and <a href="https://soberjs.com/">SoberJS</a>.
3
+ </footer>
@@ -0,0 +1,32 @@
1
+ <s-appbar>
2
+ <s-icon-button slot="navigation" onclick="document.querySelector('#drawer').toggle()">
3
+ <s-icon type="menu"></s-icon>
4
+ </s-icon-button>
5
+ <!-- onclick="window.open('{{ site.url }}', '_self')" -->
6
+ <a class="app-bar-title" slot="headline" href="/"> {{ site.title }} </a>
7
+
8
+ {% if site.tags and site.tags.size > 0 %}
9
+ <s-popup-menu slot="action">
10
+ <s-button type="text" slot="trigger" class="app-bar-action">
11
+ Tags
12
+ <s-icon type="arrow_drop_down" slot="end"></s-icon>
13
+ </s-button>
14
+ {% for tag in site.tags %}
15
+ <s-popup-menu-item onclick="selfOpen('/tag/{{ tag[0] | slugify }}')">{{ tag[0] }}</s-popup-menu-item>
16
+ {% endfor %}
17
+ </s-popup-menu>
18
+ {% endif %}
19
+
20
+ {% if site.categories and site.categories.size > 0 %}
21
+ <s-popup-menu slot="action">
22
+ <s-button type="text" slot="trigger" class="app-bar-action">
23
+ Categories
24
+ <s-icon type="arrow_drop_down" slot="end"></s-icon>
25
+ </s-button>
26
+
27
+ {% for category in site.categories %}
28
+ <s-popup-menu-item onclick="selfOpen('/category/{{ category[0] | slugify }}')">{{ category[0] }}</s-popup-menu-item>
29
+ {% endfor %}
30
+ </s-popup-menu>
31
+ {% endif %}
32
+ </s-appbar>
@@ -1,17 +1,12 @@
1
1
  <li class="post-item">
2
2
  <h3><a class="post-item-title" href="{{ post.url | relative_url }}">{{ post.title }}</a></h3>
3
3
  <div class="post-excerpt">
4
- {{ post.excerpt }}
4
+ <div class="markdown-body" style="background-color: transparent; min-height: 0px;">
5
+ {{ post.excerpt }}
6
+ </div>
5
7
  </div>
6
8
  <p class="post-meta">
7
- <s-icon style="width: 20px; height: 20px;">
8
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960">
9
- <path
10
- d="M200-80q-33 0-56.5-23.5T120-160v-560q0-33 23.5-56.5T200-800h40v-80h80v80h320v-80h80v80h40q33 0 56.5 23.5T840-720v560q0 33-23.5 56.5T760-80H200Zm0-80h560v-400H200v400Zm0-480h560v-80H200v80Zm0 0v-80 80Zm280 240q-17 0-28.5-11.5T440-440q0-17 11.5-28.5T480-480q17 0 28.5 11.5T520-440q0 17-11.5 28.5T480-400Zm-160 0q-17 0-28.5-11.5T280-440q0-17 11.5-28.5T320-480q17 0 28.5 11.5T360-440q0 17-11.5 28.5T320-400Zm320 0q-17 0-28.5-11.5T600-440q0-17 11.5-28.5T640-480q17 0 28.5 11.5T680-440q0 17-11.5 28.5T640-400ZM480-240q-17 0-28.5-11.5T440-280q0-17 11.5-28.5T480-320q17 0 28.5 11.5T520-280q0 17-11.5 28.5T480-240Zm-160 0q-17 0-28.5-11.5T280-280q0-17 11.5-28.5T320-320q17 0 28.5 11.5T360-280q0 17-11.5 28.5T320-240Zm320 0q-17 0-28.5-11.5T600-280q0-17 11.5-28.5T640-320q17 0 28.5 11.5T680-280q0 17-11.5 28.5T640-240Z">
11
- </path>
12
- </svg>
13
- </s-icon>
14
- <small> {{ post.date | date: "%B %d, %Y" }} </small>
9
+ {% include time.html date=post.date %}
15
10
  {% if post.tags and post.tags.size > 0 %}
16
11
  <s-icon style="width: 20px; height: 20px; margin-left: 8px;">
17
12
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960">
@@ -21,7 +16,7 @@
21
16
  </svg>
22
17
  </s-icon>
23
18
  {% for tag in post.tags %}
24
- {{ tag }}
19
+ <a href="/tag/{{ tag | slugify }}">{{ tag }}</a>
25
20
  {% endfor %}
26
21
  {% endif %}
27
22
 
@@ -32,7 +27,7 @@
32
27
  </svg>
33
28
  </s-icon>
34
29
  {% for category in post.categories %}
35
- {{ category }}
30
+ <a href="/category/{{ category | slugify }}">{{ category }}</a>
36
31
  {% endfor %}
37
32
  {% endif %}
38
33
  </p>
@@ -0,0 +1,42 @@
1
+ <s-scroll-view slot="start" style="height: 100%;">
2
+ <div>
3
+ {% if site.author %}
4
+ <div class="author">
5
+ <img class="author-avatar" src="{{ site.author.avatar }}">
6
+ <span class="author-name">{{ site.author.name }}</span>
7
+ </div>
8
+ {% endif %}
9
+ {% if site.menus %}
10
+ <s-divider style="padding: 0px; margin: 0px;"></s-divider>
11
+ {% for menu in site.menus %}
12
+ <s-menu style="width: 100%;">
13
+ {% if menu.title %}
14
+ <div slot="label">{{ menu.title }}</div>
15
+ {% endif %}
16
+ {% if menu.items %}
17
+ {% for item in menu.items %}
18
+ <s-menu-item onclick="window.open('{{ item.url }}')">
19
+ {% if item.icon %}
20
+ <s-icon slot="start">
21
+ {{ item.icon }}
22
+ </s-icon>
23
+ {% elsif item.img %}
24
+ <img slot="start" src="{{ item.img }}" style="width: 32px; height: 32px; object-fit: cover;">
25
+ {% endif %}
26
+
27
+ {{ item.title }}
28
+ {% if item.menu %}
29
+ <s-menu slot="menu">
30
+ {% for subItem in item.menu %}
31
+ <s-menu-item> {{ subItem.title }} </s-menu-item>
32
+ {% endfor %}
33
+ </s-menu>
34
+ {% endif %}
35
+ </s-menu-item>
36
+ {% endfor %}
37
+ {% endif %}
38
+ </s-menu>
39
+ {% endfor %}
40
+ {% endif %}
41
+ </div>
42
+ </s-scroll-view>
@@ -0,0 +1,23 @@
1
+ <s-icon style="width: 20px; height: 20px;">
2
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960">
3
+ <path
4
+ d="M200-80q-33 0-56.5-23.5T120-160v-560q0-33 23.5-56.5T200-800h40v-80h80v80h320v-80h80v80h40q33 0 56.5 23.5T840-720v560q0 33-23.5 56.5T760-80H200Zm0-80h560v-400H200v400Zm0-480h560v-80H200v80Zm0 0v-80 80Zm280 240q-17 0-28.5-11.5T440-440q0-17 11.5-28.5T480-480q17 0 28.5 11.5T520-440q0 17-11.5 28.5T480-400Zm-160 0q-17 0-28.5-11.5T280-440q0-17 11.5-28.5T320-480q17 0 28.5 11.5T360-440q0 17-11.5 28.5T320-400Zm320 0q-17 0-28.5-11.5T600-440q0-17 11.5-28.5T640-480q17 0 28.5 11.5T680-440q0 17-11.5 28.5T640-400ZM480-240q-17 0-28.5-11.5T440-280q0-17 11.5-28.5T480-320q17 0 28.5 11.5T520-280q0 17-11.5 28.5T480-240Zm-160 0q-17 0-28.5-11.5T280-280q0-17 11.5-28.5T320-320q17 0 28.5 11.5T360-280q0 17-11.5 28.5T320-240Zm320 0q-17 0-28.5-11.5T600-280q0-17 11.5-28.5T640-320q17 0 28.5 11.5T680-280q0 17-11.5 28.5T640-240Z">
5
+ </path>
6
+ </svg>
7
+ </s-icon>
8
+ <small>
9
+ {% assign today = site.time | date: "%Y-%m-%d" %}
10
+ {% assign post_date = include.date | date: "%Y-%m-%d" %}
11
+
12
+ {% if today == post_date %}
13
+ Today
14
+ {% elsif today == post_date | date: "%Y-%m-%d" | minus: 1 %}
15
+ Yesterday
16
+ {% else %}
17
+ {% if include.date | date: "%Y" == site.time | date: "%Y" %}
18
+ {{ include.date | date: "%B %d" }}
19
+ {% else %}
20
+ {{ include.date | date: "%B %d, %Y" }}
21
+ {% endif %}
22
+ {% endif %}
23
+ </small>
@@ -0,0 +1,11 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+
5
+ <h1>{{ page.type | capitalize }}: {{ page.title }}</h1>
6
+
7
+ <ul style="list-style: none; padding: 0; margin: 0; flex: 1;">
8
+ {% for post in page.posts %}
9
+ {% include post-item.html post=post %}
10
+ {% endfor %}
11
+ </ul>
@@ -4,73 +4,30 @@
4
4
  <head>
5
5
  <meta charset="UTF-8">
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+
7
8
  <title>{{ page.title | default: site.title }}</title>
8
- <link rel="stylesheet" href="{{ '/assets/css/style.css' | relative_url }}">
9
- <link rel="stylesheet" href="{{ '/assets/css/rouge-github-auto.css' | relative_url }}">
9
+ <link rel="stylesheet" href="{% if site.theme_assets %}{{ site.theme_assets | absolute_url }}/css/style.css{% else %}{{ '/assets/css/style.css' | absolute_url }}{% endif %}">
10
+ <link rel="stylesheet" href="{% if site.theme_assets %}{{ site.theme_assets | absolute_url }}/css/rouge-github-auto.css{% else %}{{ '/assets/css/rouge-github-auto.css' | relative_url }}{% endif %}">
11
+ <link rel="stylesheet" href="{% if site.theme_assets %}{{ site.theme_assets | absolute_url }}/css/github-markdown.css{% else %}{{ '/assets/css/github-markdown.css' | relative_url }}{% endif %}">
12
+
10
13
  <script src="https://unpkg.com/sober@0.6.8/dist/sober.min.js"></script>
11
14
 
12
- <script src="{{ '/assets/js/sobekyll.js' }}"></script>
15
+ <script src="{% if site.theme_assets %}{{ site.theme_assets | absolute_url }}/js/sobekyll.js{% else %}{{ '/assets/js/sobekyll.js' | relative_url }}{% endif %}"></script>
13
16
  </head>
14
17
 
15
18
  <body>
16
19
  <s-page theme="auto">
17
20
  <s-drawer id="drawer">
18
- <div slot="start">
19
- <div style="width: 100%; height: 200px; background-color: aqua;">
20
-
21
- </div>
22
- <s-menu style="max-width: 280px">
23
- <div slot="label">控制台</div>
24
- <s-menu-item checked="true">
25
- <s-icon slot="start" type="home"></s-icon>
26
- 选项1
27
- </s-menu-item>
28
- <s-menu-item>
29
- <s-icon slot="start" type="search"></s-icon>
30
- 选项2
31
- <s-icon slot="end" type="add"></s-icon>
32
- </s-menu-item>
33
- <s-menu-item>
34
- <s-icon slot="start" type="light_mode"></s-icon>
35
- 选项3
36
- </s-menu-item>
37
- <s-menu-item>
38
- <s-icon slot="start" type="favorite"></s-icon>
39
- 选项4
40
- <s-menu slot="menu">
41
- <s-menu-item> 选项1 </s-menu-item>
42
- <s-menu-item> 选项2 </s-menu-item>
43
- </s-menu>
44
- </s-menu-item>
45
- <s-menu-item>
46
- <s-icon slot="start" type="add"></s-icon>
47
- 选项5
48
- </s-menu-item>
49
- </s-menu>
50
- <s-menu style="max-width: 280px">
51
- <div slot="label">其他</div>
52
- <s-menu-item> 选项6 </s-menu-item>
53
- <s-menu-item> 选项7 </s-menu-item>
54
- </s-menu>
55
- </div>
21
+ {% include slide-panel.html %}
56
22
  <main>
57
- <s-appbar>
58
- <s-icon-button slot="navigation" onclick="document.querySelector('#drawer').toggle()">
59
- <s-icon type="menu"></s-icon>
60
- </s-icon-button>
61
- <!-- onclick="window.open('{{ site.url }}', '_self')" -->
62
- <a class="app-bar-title" slot="headline" href="{{ site.url }}" > {{ site.title }} </a>
63
- </s-appbar>
23
+ {% include header.html %}
64
24
  <s-scroll-view>
65
- <div style="height: 100%; display: flex; flex-direction: column;">
25
+ <div class="contentWrapper">
66
26
  <div class="content">
67
27
  {{ content }}
68
28
  </div>
69
- <footer>
70
- <p>&copy; {{ site.author }} - {{ site.time | date: '%Y' }}</p>
71
- </footer>
29
+ {% include footer.html %}
72
30
  </div>
73
-
74
31
  </s-scroll-view>
75
32
  </main>
76
33
  </s-drawer>
@@ -0,0 +1,41 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+
5
+ <ul style="list-style: none; padding: 0; margin: 0; flex: 1;">
6
+ {% for post in paginator.posts %}
7
+ {% include post-item.html post=post %}
8
+ {% endfor %}
9
+ </ul>
10
+
11
+ <div class="pagination">
12
+ {% if paginator.previous_page %}
13
+ <s-icon-button>
14
+ <s-icon type="chevron_left" onclick="selfOpen('{{ paginator.previous_page_path }}')"></s-icon>
15
+ </s-icon-button>
16
+ {% endif %}
17
+
18
+ {% if paginator.total_pages > 3 %}
19
+ <div class="pagination-indexing">
20
+ {% for page in (1..paginator.total_pages) %}
21
+ {% assign page_link = paginator.base_path | append: '/' %}
22
+ {% if page != 1 %}
23
+ {% assign page_link = page_link | append: 'page' | append: page %}
24
+ {% endif %}
25
+ {% if page == paginator.page %}
26
+ <span style="margin: 8px; font-weight: bolder;">{{ page }}</span>
27
+ {% else %}
28
+ <s-ripple style="border-radius: 4px;" onclick="selfOpen('{{ page_link }}')">
29
+ <span style="margin: 8px;">{{ page }}</span>
30
+ </s-ripple>
31
+ {% endif %}
32
+ {% endfor %}
33
+ </div>
34
+ {% endif %}
35
+
36
+ {% if paginator.next_page %}
37
+ <s-icon-button>
38
+ <s-icon type="chevron_right" onclick="selfOpen('{{ paginator.next_page_path }}')"></s-icon>
39
+ </s-icon-button>
40
+ {% endif %}
41
+ </div>
data/_layouts/post.html CHANGED
@@ -2,24 +2,19 @@
2
2
  layout: default
3
3
  ---
4
4
  <article>
5
- <h1>{{ page.title }}</h1>
5
+ <h1 style="margin-block-start: 0; margin-block-end: 0;">{{ page.title }}</h1>
6
6
  <p class="post-meta">
7
- <s-icon style="width: 20px; height: 20px;">
8
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960">
9
- <path
10
- d="M200-80q-33 0-56.5-23.5T120-160v-560q0-33 23.5-56.5T200-800h40v-80h80v80h320v-80h80v80h40q33 0 56.5 23.5T840-720v560q0 33-23.5 56.5T760-80H200Zm0-80h560v-400H200v400Zm0-480h560v-80H200v80Zm0 0v-80 80Zm280 240q-17 0-28.5-11.5T440-440q0-17 11.5-28.5T480-480q17 0 28.5 11.5T520-440q0 17-11.5 28.5T480-400Zm-160 0q-17 0-28.5-11.5T280-440q0-17 11.5-28.5T320-480q17 0 28.5 11.5T360-440q0 17-11.5 28.5T320-400Zm320 0q-17 0-28.5-11.5T600-440q0-17 11.5-28.5T640-480q17 0 28.5 11.5T680-440q0 17-11.5 28.5T640-400ZM480-240q-17 0-28.5-11.5T440-280q0-17 11.5-28.5T480-320q17 0 28.5 11.5T520-280q0 17-11.5 28.5T480-240Zm-160 0q-17 0-28.5-11.5T280-280q0-17 11.5-28.5T320-320q17 0 28.5 11.5T360-280q0 17-11.5 28.5T320-240Zm320 0q-17 0-28.5-11.5T600-280q0-17 11.5-28.5T640-320q17 0 28.5 11.5T680-280q0 17-11.5 28.5T640-240Z">
11
- </path>
12
- </svg>
13
- </s-icon>
14
- <small> {{ page.date | date: "%B %d, %Y" }} </small>
7
+ {% include time.html date=page.date %}
15
8
  </p>
16
9
 
17
10
  <div class="post-content">
18
- {{ content }}
11
+ <div class="markdown-body" style="background-color: transparent; min-height: 0px;">
12
+ {{ content }}
13
+ </div>
19
14
  </div>
20
15
 
21
16
  <p class="post-meta">
22
- {% if page.tags and post.tags.size > 0 %}
17
+ {% if page.tags and page.tags.size > 0 %}
23
18
  <s-icon style="width: 20px; height: 20px;">
24
19
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960">
25
20
  <path
@@ -28,12 +23,12 @@ layout: default
28
23
  </svg>
29
24
  </s-icon>
30
25
  {% for tag in page.tags %}
31
- {{ tag }}
26
+ <a href="/tag/{{ tag | slugify }}">{{ tag }}</a>
32
27
  {% endfor %}
33
28
  <space style="margin-right: 8px;"></space>
34
29
  {% endif %}
35
30
 
36
- {% if page.categories and post.categories.size > 0 %}
31
+ {% if page.categories and page.categories.size > 0 %}
37
32
  <s-icon style="width: 20px; height: 20px;">
38
33
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960">
39
34
  <path
@@ -42,7 +37,7 @@ layout: default
42
37
  </svg>
43
38
  </s-icon>
44
39
  {% for category in page.categories %}
45
- {{ category }}
40
+ <a href="/category/{{ category | slugify }}">{{ category }}</a>
46
41
  {% endfor %}
47
42
  {% endif %}
48
43
  </p>
data/_sass/_base.scss CHANGED
@@ -1,13 +1,13 @@
1
1
  body {
2
- font-family: Arial, sans-serif;
3
- line-height: 1.6;
4
- background-color: #f4f4f9;
5
- color: #333;
6
- }
7
- header {
8
- background: #444;
9
- color: #fff;
10
- padding: 10px 0;
11
- text-align: center;
12
- }
13
-
2
+ font-family: Arial, sans-serif;
3
+ line-height: 1.6;
4
+ background-color: #f4f4f9;
5
+ color: #333;
6
+ }
7
+
8
+ header {
9
+ background: #444;
10
+ color: #fff;
11
+ padding: 10px 0;
12
+ text-align: center;
13
+ }