Browse Source

Update 5 files

- /_config.yml
- /assets/css/style.scss
- /assets/js/main.js
- /_layouts/default.html
- /_layouts/post.html
mayx 7 tháng trước cách đây
mục cha
commit
9f2bed804e
5 tập tin đã thay đổi với 24 bổ sung4 xóa
  1. 7 0
      _config.yml
  2. 1 1
      _layouts/default.html
  3. 0 2
      _layouts/post.html
  4. 15 0
      assets/css/style.scss
  5. 1 1
      assets/js/main.js

+ 7 - 0
_config.yml

@@ -7,6 +7,13 @@ description: Mayx's Home Page
 timezone: Asia/Shanghai
 excerpt_separator: <!--more-->
 paginate: 7
+kramdown:
+  syntax_highlighter_opts:
+    span:
+      line_numbers: false
+    block:
+      line_numbers: true
+      start_line: 1
 plugins:
   - jekyll-sitemap
   - jekyll-feed

+ 1 - 1
_layouts/default.html

@@ -129,7 +129,7 @@
     <!-- <![endif]-->
     <footer>
       <p>
-        <small>Made with ❤ by Mayx<br />Last updated at <script>document.write(lastUpdated.toLocaleString());</script><br /> 总字数:{% include_cached word_count.html %} - 文章数:{{ site.posts.size }} - <a href="{{ site.feed.path | relative_url }}" >Atom</a> - <a href="{{ "/README.html" | relative_url }}" >About</a></small>
+        <small>Made with ❤ by Mayx<br />Last updated at {{ site.time | date: "%F %T" }}<br /> 总字数:{% include_cached word_count.html %} - 文章数:{{ site.posts.size }} - <a href="{{ site.feed.path | relative_url }}" >Atom</a> - <a href="{{ "/README.html" | relative_url }}" >About</a></small>
       </p>
     </footer>
   </div>

+ 0 - 2
_layouts/post.html

@@ -26,7 +26,6 @@ layout: default
 
 <hr />
 {% if page.layout != "encrypt" %}
-<!--[if !IE]> -->
 <b>AI摘要</b>
 <p id="ai-output">{% assign ai_cache = site.data.ai-cache[page.url] %}{% if ai_cache %}{{ ai_cache }}{% else %}正在生成中……{% endif %}</p>
 {% unless ai_cache %}
@@ -72,7 +71,6 @@ layout: default
 </script>
 {% endunless %}
 <hr />
-<!-- <![endif]-->
 {% endif %}
 
 {% include toc.html html=content sanitize=true h_max=3 %}

+ 15 - 0
assets/css/style.scss

@@ -99,4 +99,19 @@ div.highlight button:active,
 div.highlight button:focus,
 div.highlight button:hover {
     opacity: 1
+}
+
+table.rouge-table {
+    margin: 0;
+}
+
+td.rouge-gutter,
+td.rouge-code {
+    padding: 0;
+    border-bottom: none;
+}
+
+pre.lineno {
+    padding: 0 10px 0 0;
+    border: none;
 }

+ 1 - 1
assets/js/main.js

@@ -88,7 +88,7 @@ codeBlocks.forEach(function (codeBlock) {
     codeBlock.append(copyButton);
 
     copyButton.addEventListener('click', function () {
-        var code = codeBlock.querySelector('pre code').innerText.trim();
+        var code = codeBlock.querySelector('.rouge-code pre').innerText.trim();
         window.navigator.clipboard.writeText(code)
             .then(() => {
                 copyButton.innerText = '✅';