From dc5c8af69bfbab72724b468dfd6def5c5da60b70 Mon Sep 17 00:00:00 2001 From: linchaolong Date: Mon, 16 Sep 2024 23:06:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E7=AB=A0=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=9B=AE=E5=BD=95=E7=B4=A2=E5=BC=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/css/custom.css | 0 hugo.toml | 3 + public/404.html | 2 +- public/about/index.html | 18 +++- public/categories/index.html | 2 +- ...d7d6ea16684353b267ad3f4385e180cc91a06b.css | 1 + ...dbd58adbdcbcc1d430e6d4a1f0384df4d59832.css | 1 + public/index.html | 2 +- public/js/toc.js | 72 ++++++++++++++++ public/page/2/index.html | 2 +- .../index.html" | 18 +++- .../index.html" | 18 +++- public/posts/index.html | 2 +- .../index.html" | 18 +++- .../index.html" | 18 +++- .../index.html" | 18 +++- .../index.html" | 18 +++- public/posts/page/2/index.html | 2 +- .../index.html" | 18 +++- .../index.html" | 18 +++- .../index.html" | 18 +++- .../index.html" | 18 +++- .../index.html" | 18 +++- .../index.html" | 18 +++- .../index.html" | 18 +++- .../index.html" | 18 +++- .../index.html" | 18 +++- .../index.html" | 18 +++- public/tags/index.html | 2 +- ...s_95e4f47594ba319c9acdf486feed3945.content | 2 +- ...scss_95e4f47594ba319c9acdf486feed3945.json | 2 +- themes/m10c/assets/css/_extra.scss | 82 +++++++++++++++++++ themes/m10c/layouts/_default/single.html | 16 +++- themes/m10c/static/js/toc.js | 72 ++++++++++++++++ 34 files changed, 527 insertions(+), 44 deletions(-) create mode 100644 assets/css/custom.css create mode 100644 public/css/main.min.08e876a0f4aeb92fb7ca4e4c12d7d6ea16684353b267ad3f4385e180cc91a06b.css create mode 100644 public/css/main.min.1b0bf2b31cb0f514c537ceb35ddbd58adbdcbcc1d430e6d4a1f0384df4d59832.css create mode 100644 public/js/toc.js create mode 100644 themes/m10c/static/js/toc.js diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..e69de29 diff --git a/hugo.toml b/hugo.toml index 8aa6d05..b2d395e 100644 --- a/hugo.toml +++ b/hugo.toml @@ -26,3 +26,6 @@ theme = "m10c" [params.style] primaryColor = "#87CEFA" + +[params] + customCSS = ["css/custom.css"] diff --git a/public/404.html b/public/404.html index 8f95de5..c85435d 100644 --- a/public/404.html +++ b/public/404.html @@ -8,7 +8,7 @@ - + diff --git a/public/about/index.html b/public/about/index.html index 0b79dd3..422bc30 100644 --- a/public/about/index.html +++ b/public/about/index.html @@ -8,7 +8,7 @@ - + @@ -65,9 +65,23 @@

About

-
+ + + + + + + + + + + + + diff --git a/public/categories/index.html b/public/categories/index.html index d89950d..8f4953a 100644 --- a/public/categories/index.html +++ b/public/categories/index.html @@ -8,7 +8,7 @@ - + diff --git a/public/css/main.min.08e876a0f4aeb92fb7ca4e4c12d7d6ea16684353b267ad3f4385e180cc91a06b.css b/public/css/main.min.08e876a0f4aeb92fb7ca4e4c12d7d6ea16684353b267ad3f4385e180cc91a06b.css new file mode 100644 index 0000000..5528e58 --- /dev/null +++ b/public/css/main.min.08e876a0f4aeb92fb7ca4e4c12d7d6ea16684353b267ad3f4385e180cc91a06b.css @@ -0,0 +1 @@ +@charset "UTF-8";*{box-sizing:border-box}html{line-height:1.6}body{margin:0;font-family:sans-serif;background:#353b43;color:#afbac4}h1,h2,h3,h4,h5,h6{color:#fff}a{color:#87cefa;transition:color .35s;text-decoration:none}a:hover{color:#fff}code{font-family:monospace,monospace;font-size:1em;color:rgba(175,186,196,.8);text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-text-size-adjust:100%;-webkit-text-size-adjust:100%}pre{font-size:1rem;line-height:1.2em;margin:0;overflow:auto}pre code{font-size:.8em}::selection{background:rgba(175,186,196,.25)}::-moz-selection{background:rgba(175,186,196,.25)}.app-header{padding:2.5em;background:#242930;text-align:center}.app-header-avatar{width:15rem;height:15rem;border-radius:100%;border:.5rem solid #87cefa}.app-container{padding:2.5rem}.app-header-social{display:flex;align-items:center;justify-content:center;font-size:2em;color:#fff}.app-header-social a:not(:last-child){margin-right:.4em}.app-header-title{color:#fff;display:block;font-size:2em;margin:.67em 0;font-weight:700}@media(min-width:940px){.app-header{position:fixed;top:0;left:0;width:20rem;min-height:100vh}.app-container{max-width:65rem;margin-left:20rem}}.error-404{text-align:center}.error-404-title{text-transform:uppercase}.icon{display:inline-block;width:1em;height:1em;margin-top:-.125em}.pagination{display:block;list-style:none;padding:0;font-size:.8em;text-align:center;margin:3em 0}.page-item{display:inline-block}.page-item .page-link{display:flex;align-items:center;justify-content:center;width:1.8rem;height:1.8rem}.page-item.active .page-link{color:#fff;border-radius:2em;background:#87cefa}.post-title{color:#fff}.post-meta>div{display:flex;align-items:center;flex-wrap:wrap;gap:.2em;font-size:.8em}.post-meta>div>.icon{margin-right:.4em}.post-content>pre,.post-content .highlight{margin:1em 0}.post-content>pre,.post-content .highlight>pre,.post-content .highlight>div{border-left:.4em solid rgba(135,206,250,.8);padding:1em}.post-content blockquote{border-left:.4em solid rgba(135,206,250,.8);margin:1em 0;padding:.5em 1em;background:#242930}.post-content blockquote p{margin:.5em 0}.post-content img{max-width:100%}.posts-list{padding:0}.posts-list-item{list-style:none;padding:.4em 0}.posts-list-item:not(:last-child){border-bottom:1px dashed rgba(255,255,255,.3)}.posts-list-item-description{display:flex;align-items:center;font-size:.8em}.posts-list-item-description>.icon{margin-right:.4em}.posts-list-item-separator{margin:0 .4em}.tag{display:inline-block;margin-right:.2em;padding:0 .6em;font-size:.9em;border-radius:.2em;white-space:nowrap;background:rgba(255,255,255,.1);transition:color .35s,background .35s}.tag:hover{transition:color .25s,background .05s;background:rgba(255,255,255,.3)}.tags-list{padding:0}.tags-list-item{display:flex;align-items:center;list-style:none;padding:.4em 0}.tags-list-item>.icon{margin-right:.4em}.tags-list-item:not(:last-child){border-bottom:1px dashed rgba(255,255,255,.3)}@media(min-width:450px){.tags-list{display:flex;flex-wrap:wrap}.tags-list-item{width:calc(50% - 1em)}.tags-list-item:nth-child(even){margin-left:1em}.tags-list-item:nth-last-child(2){border:none}}img{display:block;margin:0;max-width:100%;text-align:left}p img{width:65%;margin-bottom:1rem}.toc-container{position:fixed;top:20%;right:-300px;width:250px;max-height:60%;overflow-y:auto;background-color:#fff;box-shadow:-2px 0 5px rgba(0,0,0,.1);border-left:1px solid #ddd;padding:15px;transition:right .3s ease-in-out;z-index:999}.toc-container.visible{right:0}.toc-container ul{list-style-type:none;padding-left:0}.toc-container li{margin-bottom:8px}.toc-container a{text-decoration:none;color:#007bff}.toc-container a:hover{text-decoration:underline}.toc-item.h1{margin-left:0}.toc-item.h2{margin-left:10px}.toc-item.h3{margin-left:20px}.toc-toggle{position:fixed;bottom:20px;right:20px;width:50px;height:50px;background-color:#007bff;color:#fff;border:none;border-radius:50%;font-size:24px;cursor:pointer;z-index:1000}.toc-toggle:focus{outline:none}.toc-toggle:hover{background-color:#0056b3}.hidden{display:none} \ No newline at end of file diff --git a/public/css/main.min.1b0bf2b31cb0f514c537ceb35ddbd58adbdcbcc1d430e6d4a1f0384df4d59832.css b/public/css/main.min.1b0bf2b31cb0f514c537ceb35ddbd58adbdcbcc1d430e6d4a1f0384df4d59832.css new file mode 100644 index 0000000..1817d6a --- /dev/null +++ b/public/css/main.min.1b0bf2b31cb0f514c537ceb35ddbd58adbdcbcc1d430e6d4a1f0384df4d59832.css @@ -0,0 +1 @@ +@charset "UTF-8";*{box-sizing:border-box}html{line-height:1.6}body{margin:0;font-family:sans-serif;background:#353b43;color:#afbac4}h1,h2,h3,h4,h5,h6{color:#fff}a{color:#87cefa;transition:color .35s;text-decoration:none}a:hover{color:#fff}code{font-family:monospace,monospace;font-size:1em;color:rgba(175,186,196,.8);text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-text-size-adjust:100%;-webkit-text-size-adjust:100%}pre{font-size:1rem;line-height:1.2em;margin:0;overflow:auto}pre code{font-size:.8em}::selection{background:rgba(175,186,196,.25)}::-moz-selection{background:rgba(175,186,196,.25)}.app-header{padding:2.5em;background:#242930;text-align:center}.app-header-avatar{width:15rem;height:15rem;border-radius:100%;border:.5rem solid #87cefa}.app-container{padding:2.5rem}.app-header-social{display:flex;align-items:center;justify-content:center;font-size:2em;color:#fff}.app-header-social a:not(:last-child){margin-right:.4em}.app-header-title{color:#fff;display:block;font-size:2em;margin:.67em 0;font-weight:700}@media(min-width:940px){.app-header{position:fixed;top:0;left:0;width:20rem;min-height:100vh}.app-container{max-width:65rem;margin-left:20rem}}.error-404{text-align:center}.error-404-title{text-transform:uppercase}.icon{display:inline-block;width:1em;height:1em;margin-top:-.125em}.pagination{display:block;list-style:none;padding:0;font-size:.8em;text-align:center;margin:3em 0}.page-item{display:inline-block}.page-item .page-link{display:flex;align-items:center;justify-content:center;width:1.8rem;height:1.8rem}.page-item.active .page-link{color:#fff;border-radius:2em;background:#87cefa}.post-title{color:#fff}.post-meta>div{display:flex;align-items:center;flex-wrap:wrap;gap:.2em;font-size:.8em}.post-meta>div>.icon{margin-right:.4em}.post-content>pre,.post-content .highlight{margin:1em 0}.post-content>pre,.post-content .highlight>pre,.post-content .highlight>div{border-left:.4em solid rgba(135,206,250,.8);padding:1em}.post-content blockquote{border-left:.4em solid rgba(135,206,250,.8);margin:1em 0;padding:.5em 1em;background:#242930}.post-content blockquote p{margin:.5em 0}.post-content img{max-width:100%}.posts-list{padding:0}.posts-list-item{list-style:none;padding:.4em 0}.posts-list-item:not(:last-child){border-bottom:1px dashed rgba(255,255,255,.3)}.posts-list-item-description{display:flex;align-items:center;font-size:.8em}.posts-list-item-description>.icon{margin-right:.4em}.posts-list-item-separator{margin:0 .4em}.tag{display:inline-block;margin-right:.2em;padding:0 .6em;font-size:.9em;border-radius:.2em;white-space:nowrap;background:rgba(255,255,255,.1);transition:color .35s,background .35s}.tag:hover{transition:color .25s,background .05s;background:rgba(255,255,255,.3)}.tags-list{padding:0}.tags-list-item{display:flex;align-items:center;list-style:none;padding:.4em 0}.tags-list-item>.icon{margin-right:.4em}.tags-list-item:not(:last-child){border-bottom:1px dashed rgba(255,255,255,.3)}@media(min-width:450px){.tags-list{display:flex;flex-wrap:wrap}.tags-list-item{width:calc(50% - 1em)}.tags-list-item:nth-child(even){margin-left:1em}.tags-list-item:nth-last-child(2){border:none}}img{display:block;margin:0;max-width:100%;text-align:left}p img{width:65%;margin-bottom:1rem}.toc-toggle{position:fixed;bottom:20px;right:20px;background-color:#007bff;color:#fff;border:none;border-radius:50%;padding:15px;font-size:24px;cursor:pointer;z-index:1000}.toc-container{position:fixed;right:20px;bottom:80px;width:250px;max-height:400px;overflow-y:auto;background-color:#f9f9f9;box-shadow:0 4px 8px rgba(0,0,0,.1);border-radius:5px;padding:10px;z-index:999}.hidden{display:none}.toc-container a{text-decoration:none;color:#007bff;display:block;padding:5px 0}.toc-container a:hover{text-decoration:underline} \ No newline at end of file diff --git a/public/index.html b/public/index.html index eba60e3..810bf61 100644 --- a/public/index.html +++ b/public/index.html @@ -8,7 +8,7 @@ - + diff --git a/public/js/toc.js b/public/js/toc.js new file mode 100644 index 0000000..8d016e0 --- /dev/null +++ b/public/js/toc.js @@ -0,0 +1,72 @@ +// 等待 DOM 加载完成 +document.addEventListener('DOMContentLoaded', function () { + const tocToggle = document.getElementById('toc-toggle'); + const tocContainer = document.getElementById('toc'); + const contentArea = document.querySelector('.post-content'); // 根据你的内容区域的类名调整 + + // 生成目录函数 + function generateTOC() { + const headings = contentArea.querySelectorAll('h1, h2, h3'); + console.log("Headings found:", headings); // 输出找到的标题元素 + if (headings.length === 0) { + // 如果没有找到标题,隐藏浮动按钮 + tocToggle.style.display = 'none'; + return; + } + + const tocList = document.createElement('ul'); + + headings.forEach(function (heading) { + if (!heading.id) { + // 如果标题没有 id,生成一个 + heading.id = heading.textContent.trim().toLowerCase().replace(/\s+/g, '-').replace(/[^\w\-]/g, ''); + } + + const tocItem = document.createElement('li'); + tocItem.classList.add('toc-item', heading.tagName.toLowerCase()); + + const tocLink = document.createElement('a'); + tocLink.href = `#${heading.id}`; + tocLink.textContent = heading.textContent; + + tocItem.appendChild(tocLink); + tocList.appendChild(tocItem); + }); + + tocContainer.appendChild(tocList); + } + + // 页面加载时生成目录 + generateTOC(); + + // 切换目录的显示与隐藏 + tocToggle.addEventListener('click', function () { + console.log("TOC toggle clicked"); // 点击按钮时输出到控制台 + // 先检查当前是否是隐藏状态 + if (tocContainer.classList.contains("hidden")) { + tocContainer.classList.remove("hidden"); + tocContainer.classList.add("visible"); + } else { + tocContainer.classList.remove("visible"); + tocContainer.classList.add("hidden"); + } + }); + + // 点击目录项时平滑滚动到对应位置 + tocContainer.addEventListener('click', function (event) { + if (event.target.tagName.toLowerCase() === 'a') { + event.preventDefault(); + const targetId = event.target.getAttribute('href').substring(1); + const targetHeading = document.getElementById(targetId); + if (targetHeading) { + window.scrollTo({ + top: targetHeading.offsetTop - 20, // 根据需要调整偏移量 + behavior: 'smooth' + }); + // 点击后隐藏目录 + tocContainer.classList.remove("visible"); + tocContainer.classList.add("hidden"); + } + } + }); +}); diff --git a/public/page/2/index.html b/public/page/2/index.html index 3a0a1ca..e783eca 100644 --- a/public/page/2/index.html +++ b/public/page/2/index.html @@ -8,7 +8,7 @@ - + diff --git "a/public/posts/0\346\210\220\346\234\254\351\200\232\350\277\207hugo\345\222\214github-pages\346\220\255\345\273\272\345\215\232\345\256\242/index.html" "b/public/posts/0\346\210\220\346\234\254\351\200\232\350\277\207hugo\345\222\214github-pages\346\220\255\345\273\272\345\215\232\345\256\242/index.html" index 274f977..246aca1 100644 --- "a/public/posts/0\346\210\220\346\234\254\351\200\232\350\277\207hugo\345\222\214github-pages\346\220\255\345\273\272\345\215\232\345\256\242/index.html" +++ "b/public/posts/0\346\210\220\346\234\254\351\200\232\350\277\207hugo\345\222\214github-pages\346\220\255\345\273\272\345\215\232\345\256\242/index.html" @@ -8,7 +8,7 @@ - + @@ -268,9 +268,23 @@

0成本通过Hugo和GitHub Pages搭建博客

-
+ + + + + + + + + + + + + diff --git "a/public/posts/android\346\272\220\347\240\201\345\257\274\345\205\245android-studio/index.html" "b/public/posts/android\346\272\220\347\240\201\345\257\274\345\205\245android-studio/index.html" index 2cd7f95..e523f62 100644 --- "a/public/posts/android\346\272\220\347\240\201\345\257\274\345\205\245android-studio/index.html" +++ "b/public/posts/android\346\272\220\347\240\201\345\257\274\345\205\245android-studio/index.html" @@ -8,7 +8,7 @@ - + @@ -154,9 +154,23 @@

导入android studio

-
+ + + + + + + + + + + + + diff --git a/public/posts/index.html b/public/posts/index.html index db216df..5718a4a 100644 --- a/public/posts/index.html +++ b/public/posts/index.html @@ -8,7 +8,7 @@ - + diff --git "a/public/posts/lineageos\345\210\267\346\234\272\346\225\231\347\250\213/index.html" "b/public/posts/lineageos\345\210\267\346\234\272\346\225\231\347\250\213/index.html" index 521eb47..a17678e 100644 --- "a/public/posts/lineageos\345\210\267\346\234\272\346\225\231\347\250\213/index.html" +++ "b/public/posts/lineageos\345\210\267\346\234\272\346\225\231\347\250\213/index.html" @@ -8,7 +8,7 @@ - + @@ -207,9 +207,23 @@

使用LineageOS Recovery刷 + + + + + + + + + + + + + diff --git "a/public/posts/lineageos\346\272\220\347\240\201\344\270\213\350\275\275\345\222\214\347\274\226\350\257\221xiaomi-mi-6xwayne/index.html" "b/public/posts/lineageos\346\272\220\347\240\201\344\270\213\350\275\275\345\222\214\347\274\226\350\257\221xiaomi-mi-6xwayne/index.html" index d178a8d..0b0f7bb 100644 --- "a/public/posts/lineageos\346\272\220\347\240\201\344\270\213\350\275\275\345\222\214\347\274\226\350\257\221xiaomi-mi-6xwayne/index.html" +++ "b/public/posts/lineageos\346\272\220\347\240\201\344\270\213\350\275\275\345\222\214\347\274\226\350\257\221xiaomi-mi-6xwayne/index.html" @@ -8,7 +8,7 @@ - + @@ -512,9 +512,23 @@

刷机

+ + + + + + + + + + + + + diff --git "a/public/posts/linux\344\270\213\344\273\243\347\220\206\350\256\276\347\275\256/index.html" "b/public/posts/linux\344\270\213\344\273\243\347\220\206\350\256\276\347\275\256/index.html" index 91f8732..4ec12d6 100644 --- "a/public/posts/linux\344\270\213\344\273\243\347\220\206\350\256\276\347\275\256/index.html" +++ "b/public/posts/linux\344\270\213\344\273\243\347\220\206\350\256\276\347\275\256/index.html" @@ -8,7 +8,7 @@ - + @@ -182,9 +182,23 @@

4. 配置环境变量

+ + + + + + + + + + + + + diff --git "a/public/posts/magiskboot\347\274\226\350\257\221\350\247\243\345\214\205\346\211\223\345\214\205boot.img/index.html" "b/public/posts/magiskboot\347\274\226\350\257\221\350\247\243\345\214\205\346\211\223\345\214\205boot.img/index.html" index 60e9d69..a8d6665 100644 --- "a/public/posts/magiskboot\347\274\226\350\257\221\350\247\243\345\214\205\346\211\223\345\214\205boot.img/index.html" +++ "b/public/posts/magiskboot\347\274\226\350\257\221\350\247\243\345\214\205\346\211\223\345\214\205boot.img/index.html" @@ -8,7 +8,7 @@ - + @@ -203,9 +203,23 @@

使用 magiskboot 解 + + + + + + + + + + + + + diff --git a/public/posts/page/2/index.html b/public/posts/page/2/index.html index f861102..0ba1f4a 100644 --- a/public/posts/page/2/index.html +++ b/public/posts/page/2/index.html @@ -8,7 +8,7 @@ - + diff --git "a/public/posts/windows\344\270\213\345\210\233\345\273\272ftp\346\234\215\345\212\241\345\231\250\345\256\236\347\216\260\346\226\207\344\273\266\345\205\261\344\272\253/index.html" "b/public/posts/windows\344\270\213\345\210\233\345\273\272ftp\346\234\215\345\212\241\345\231\250\345\256\236\347\216\260\346\226\207\344\273\266\345\205\261\344\272\253/index.html" index 28682cc..88e0c31 100644 --- "a/public/posts/windows\344\270\213\345\210\233\345\273\272ftp\346\234\215\345\212\241\345\231\250\345\256\236\347\216\260\346\226\207\344\273\266\345\205\261\344\272\253/index.html" +++ "b/public/posts/windows\344\270\213\345\210\233\345\273\272ftp\346\234\215\345\212\241\345\231\250\345\256\236\347\216\260\346\226\207\344\273\266\345\205\261\344\272\253/index.html" @@ -8,7 +8,7 @@ - + @@ -164,9 +164,23 @@

1. 查看目录和文件 + + + + + + + + + + + + + diff --git "a/public/posts/\344\275\277\347\224\250-release-key-\345\257\271-lineageos-\350\277\233\350\241\214\347\274\226\350\257\221\345\222\214\347\255\276\345\220\215/index.html" "b/public/posts/\344\275\277\347\224\250-release-key-\345\257\271-lineageos-\350\277\233\350\241\214\347\274\226\350\257\221\345\222\214\347\255\276\345\220\215/index.html" index 3e53dbf..a30eb70 100644 --- "a/public/posts/\344\275\277\347\224\250-release-key-\345\257\271-lineageos-\350\277\233\350\241\214\347\274\226\350\257\221\345\222\214\347\255\276\345\220\215/index.html" +++ "b/public/posts/\344\275\277\347\224\250-release-key-\345\257\271-lineageos-\350\277\233\350\241\214\347\274\226\350\257\221\345\222\214\347\255\276\345\220\215/index.html" @@ -8,7 +8,7 @@ - + @@ -388,9 +388,23 @@

生成 release key

+ + + + + + + + + + + + + diff --git "a/public/posts/\344\277\256\346\224\271android\347\263\273\347\273\237ro.debuggable\344\275\277\345\205\250\345\261\200\345\217\257\350\260\203\350\257\225/index.html" "b/public/posts/\344\277\256\346\224\271android\347\263\273\347\273\237ro.debuggable\344\275\277\345\205\250\345\261\200\345\217\257\350\260\203\350\257\225/index.html" index c666dfb..97f37fb 100644 --- "a/public/posts/\344\277\256\346\224\271android\347\263\273\347\273\237ro.debuggable\344\275\277\345\205\250\345\261\200\345\217\257\350\260\203\350\257\225/index.html" +++ "b/public/posts/\344\277\256\346\224\271android\347\263\273\347\273\237ro.debuggable\344\275\277\345\205\250\345\261\200\345\217\257\350\260\203\350\257\225/index.html" @@ -8,7 +8,7 @@ - + @@ -276,9 +276,23 @@

修改android系统ro.debuggable使全局可调试

+ + + + + + + + + + + + + diff --git "a/public/posts/\345\260\217\347\261\2635c\350\247\243\351\231\244bl\351\224\201\345\210\267\346\234\272root/index.html" "b/public/posts/\345\260\217\347\261\2635c\350\247\243\351\231\244bl\351\224\201\345\210\267\346\234\272root/index.html" index b2aae15..3d1e247 100644 --- "a/public/posts/\345\260\217\347\261\2635c\350\247\243\351\231\244bl\351\224\201\345\210\267\346\234\272root/index.html" +++ "b/public/posts/\345\260\217\347\261\2635c\350\247\243\351\231\244bl\351\224\201\345\210\267\346\234\272root/index.html" @@ -8,7 +8,7 @@ - + @@ -148,9 +148,23 @@

使用Magisk进行root

+ + + + + + + + + + + + + diff --git "a/public/posts/\345\260\217\347\261\263\346\211\213\346\234\272\350\247\243\351\231\244bl\351\224\201\345\210\267\346\234\272root/index.html" "b/public/posts/\345\260\217\347\261\263\346\211\213\346\234\272\350\247\243\351\231\244bl\351\224\201\345\210\267\346\234\272root/index.html" index c4c242c..854ea6d 100644 --- "a/public/posts/\345\260\217\347\261\263\346\211\213\346\234\272\350\247\243\351\231\244bl\351\224\201\345\210\267\346\234\272root/index.html" +++ "b/public/posts/\345\260\217\347\261\263\346\211\213\346\234\272\350\247\243\351\231\244bl\351\224\201\345\210\267\346\234\272root/index.html" @@ -8,7 +8,7 @@ - + @@ -154,9 +154,23 @@

使用Magisk进行root

+ + + + + + + + + + + + + diff --git "a/public/posts/\346\234\211\351\201\223\344\272\221docx\350\275\254\346\215\242markdown\345\257\274\345\205\245hugo\345\217\221\345\270\203\345\210\260github-page\345\244\232\345\271\263\345\217\260\345\217\221\345\270\203\351\200\202\351\205\215/index.html" "b/public/posts/\346\234\211\351\201\223\344\272\221docx\350\275\254\346\215\242markdown\345\257\274\345\205\245hugo\345\217\221\345\270\203\345\210\260github-page\345\244\232\345\271\263\345\217\260\345\217\221\345\270\203\351\200\202\351\205\215/index.html" index db249d7..19c8902 100644 --- "a/public/posts/\346\234\211\351\201\223\344\272\221docx\350\275\254\346\215\242markdown\345\257\274\345\205\245hugo\345\217\221\345\270\203\345\210\260github-page\345\244\232\345\271\263\345\217\260\345\217\221\345\270\203\351\200\202\351\205\215/index.html" +++ "b/public/posts/\346\234\211\351\201\223\344\272\221docx\350\275\254\346\215\242markdown\345\257\274\345\205\245hugo\345\217\221\345\270\203\345\210\260github-page\345\244\232\345\271\263\345\217\260\345\217\221\345\270\203\351\200\202\351\205\215/index.html" @@ -8,7 +8,7 @@ - + @@ -682,9 +682,23 @@

有道云docx转换markdown,导入hugo发布到github + + + + + + + + + + + + + diff --git "a/public/posts/\347\274\226\350\257\221lineageos\346\250\241\346\213\237\345\231\250\351\225\234\345\203\217\345\257\274\345\207\272\345\210\260androidstudio/index.html" "b/public/posts/\347\274\226\350\257\221lineageos\346\250\241\346\213\237\345\231\250\351\225\234\345\203\217\345\257\274\345\207\272\345\210\260androidstudio/index.html" index 6986539..c059593 100644 --- "a/public/posts/\347\274\226\350\257\221lineageos\346\250\241\346\213\237\345\231\250\351\225\234\345\203\217\345\257\274\345\207\272\345\210\260androidstudio/index.html" +++ "b/public/posts/\347\274\226\350\257\221lineageos\346\250\241\346\213\237\345\231\250\351\225\234\345\203\217\345\257\274\345\207\272\345\210\260androidstudio/index.html" @@ -8,7 +8,7 @@ - + @@ -360,9 +360,23 @@

导出用于 Android Studio/ + + + + + + + + + + + + + diff --git "a/public/posts/\347\274\226\350\257\221\350\207\252\345\256\232\344\271\211linux\345\206\205\346\240\270\344\275\277wsl\346\224\257\346\214\201\350\256\277\351\227\256windows\344\270\213usb\350\256\276\345\244\207/index.html" "b/public/posts/\347\274\226\350\257\221\350\207\252\345\256\232\344\271\211linux\345\206\205\346\240\270\344\275\277wsl\346\224\257\346\214\201\350\256\277\351\227\256windows\344\270\213usb\350\256\276\345\244\207/index.html" index e20d9e7..0fd911f 100644 --- "a/public/posts/\347\274\226\350\257\221\350\207\252\345\256\232\344\271\211linux\345\206\205\346\240\270\344\275\277wsl\346\224\257\346\214\201\350\256\277\351\227\256windows\344\270\213usb\350\256\276\345\244\207/index.html" +++ "b/public/posts/\347\274\226\350\257\221\350\207\252\345\256\232\344\271\211linux\345\206\205\346\240\270\344\275\277wsl\346\224\257\346\214\201\350\256\277\351\227\256windows\344\270\213usb\350\256\276\345\244\207/index.html" @@ -8,7 +8,7 @@ - + @@ -234,9 +234,23 @@

5.1 编译自定义Linux内 + + + + + + + + + + + + + diff --git "a/public/posts/\350\215\243\350\200\200magicbook-x14-\346\211\251\345\256\2711tb\345\233\272\346\200\201/index.html" "b/public/posts/\350\215\243\350\200\200magicbook-x14-\346\211\251\345\256\2711tb\345\233\272\346\200\201/index.html" index fe84619..826ab1d 100644 --- "a/public/posts/\350\215\243\350\200\200magicbook-x14-\346\211\251\345\256\2711tb\345\233\272\346\200\201/index.html" +++ "b/public/posts/\350\215\243\350\200\200magicbook-x14-\346\211\251\345\256\2711tb\345\233\272\346\200\201/index.html" @@ -8,7 +8,7 @@ - + @@ -188,9 +188,23 @@

重新分配磁盘空间< + + + + + + + + + + + + + diff --git "a/public/posts/\350\247\243\345\206\263lineageos\346\217\220\347\244\272\347\275\221\347\273\234\345\217\227\351\231\220\351\227\256\351\242\230/index.html" "b/public/posts/\350\247\243\345\206\263lineageos\346\217\220\347\244\272\347\275\221\347\273\234\345\217\227\351\231\220\351\227\256\351\242\230/index.html" index ac389f2..6e52fc9 100644 --- "a/public/posts/\350\247\243\345\206\263lineageos\346\217\220\347\244\272\347\275\221\347\273\234\345\217\227\351\231\220\351\227\256\351\242\230/index.html" +++ "b/public/posts/\350\247\243\345\206\263lineageos\346\217\220\347\244\272\347\275\221\347\273\234\345\217\227\351\231\220\351\227\256\351\242\230/index.html" @@ -8,7 +8,7 @@ - + @@ -130,9 +130,23 @@

1. 通过adb修改

+ + + + + + + + + + + + + diff --git a/public/tags/index.html b/public/tags/index.html index 9871ce5..821d9b3 100644 --- a/public/tags/index.html +++ b/public/tags/index.html @@ -8,7 +8,7 @@ - + diff --git a/resources/_gen/assets/css/main.scss_95e4f47594ba319c9acdf486feed3945.content b/resources/_gen/assets/css/main.scss_95e4f47594ba319c9acdf486feed3945.content index c118acb..5528e58 100644 --- a/resources/_gen/assets/css/main.scss_95e4f47594ba319c9acdf486feed3945.content +++ b/resources/_gen/assets/css/main.scss_95e4f47594ba319c9acdf486feed3945.content @@ -1 +1 @@ -*{box-sizing:border-box}html{line-height:1.6}body{margin:0;font-family:sans-serif;background:#353b43;color:#afbac4}h1,h2,h3,h4,h5,h6{color:#fff}a{color:#87cefa;transition:color .35s;text-decoration:none}a:hover{color:#fff}code{font-family:monospace,monospace;font-size:1em;color:rgba(175,186,196,.8);text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-text-size-adjust:100%;-webkit-text-size-adjust:100%}pre{font-size:1rem;line-height:1.2em;margin:0;overflow:auto}pre code{font-size:.8em}::selection{background:rgba(175,186,196,.25)}::-moz-selection{background:rgba(175,186,196,.25)}.app-header{padding:2.5em;background:#242930;text-align:center}.app-header-avatar{width:15rem;height:15rem;border-radius:100%;border:.5rem solid #87cefa}.app-container{padding:2.5rem}.app-header-social{display:flex;align-items:center;justify-content:center;font-size:2em;color:#fff}.app-header-social a:not(:last-child){margin-right:.4em}.app-header-title{color:#fff;display:block;font-size:2em;margin:.67em 0;font-weight:700}@media(min-width:940px){.app-header{position:fixed;top:0;left:0;width:20rem;min-height:100vh}.app-container{max-width:65rem;margin-left:20rem}}.error-404{text-align:center}.error-404-title{text-transform:uppercase}.icon{display:inline-block;width:1em;height:1em;margin-top:-.125em}.pagination{display:block;list-style:none;padding:0;font-size:.8em;text-align:center;margin:3em 0}.page-item{display:inline-block}.page-item .page-link{display:flex;align-items:center;justify-content:center;width:1.8rem;height:1.8rem}.page-item.active .page-link{color:#fff;border-radius:2em;background:#87cefa}.post-title{color:#fff}.post-meta>div{display:flex;align-items:center;flex-wrap:wrap;gap:.2em;font-size:.8em}.post-meta>div>.icon{margin-right:.4em}.post-content>pre,.post-content .highlight{margin:1em 0}.post-content>pre,.post-content .highlight>pre,.post-content .highlight>div{border-left:.4em solid rgba(135,206,250,.8);padding:1em}.post-content blockquote{border-left:.4em solid rgba(135,206,250,.8);margin:1em 0;padding:.5em 1em;background:#242930}.post-content blockquote p{margin:.5em 0}.post-content img{max-width:100%}.posts-list{padding:0}.posts-list-item{list-style:none;padding:.4em 0}.posts-list-item:not(:last-child){border-bottom:1px dashed rgba(255,255,255,.3)}.posts-list-item-description{display:flex;align-items:center;font-size:.8em}.posts-list-item-description>.icon{margin-right:.4em}.posts-list-item-separator{margin:0 .4em}.tag{display:inline-block;margin-right:.2em;padding:0 .6em;font-size:.9em;border-radius:.2em;white-space:nowrap;background:rgba(255,255,255,.1);transition:color .35s,background .35s}.tag:hover{transition:color .25s,background .05s;background:rgba(255,255,255,.3)}.tags-list{padding:0}.tags-list-item{display:flex;align-items:center;list-style:none;padding:.4em 0}.tags-list-item>.icon{margin-right:.4em}.tags-list-item:not(:last-child){border-bottom:1px dashed rgba(255,255,255,.3)}@media(min-width:450px){.tags-list{display:flex;flex-wrap:wrap}.tags-list-item{width:calc(50% - 1em)}.tags-list-item:nth-child(even){margin-left:1em}.tags-list-item:nth-last-child(2){border:none}}img{display:block;margin:0;max-width:100%;text-align:left}p img{width:65%;margin-bottom:1rem} \ No newline at end of file +@charset "UTF-8";*{box-sizing:border-box}html{line-height:1.6}body{margin:0;font-family:sans-serif;background:#353b43;color:#afbac4}h1,h2,h3,h4,h5,h6{color:#fff}a{color:#87cefa;transition:color .35s;text-decoration:none}a:hover{color:#fff}code{font-family:monospace,monospace;font-size:1em;color:rgba(175,186,196,.8);text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-text-size-adjust:100%;-webkit-text-size-adjust:100%}pre{font-size:1rem;line-height:1.2em;margin:0;overflow:auto}pre code{font-size:.8em}::selection{background:rgba(175,186,196,.25)}::-moz-selection{background:rgba(175,186,196,.25)}.app-header{padding:2.5em;background:#242930;text-align:center}.app-header-avatar{width:15rem;height:15rem;border-radius:100%;border:.5rem solid #87cefa}.app-container{padding:2.5rem}.app-header-social{display:flex;align-items:center;justify-content:center;font-size:2em;color:#fff}.app-header-social a:not(:last-child){margin-right:.4em}.app-header-title{color:#fff;display:block;font-size:2em;margin:.67em 0;font-weight:700}@media(min-width:940px){.app-header{position:fixed;top:0;left:0;width:20rem;min-height:100vh}.app-container{max-width:65rem;margin-left:20rem}}.error-404{text-align:center}.error-404-title{text-transform:uppercase}.icon{display:inline-block;width:1em;height:1em;margin-top:-.125em}.pagination{display:block;list-style:none;padding:0;font-size:.8em;text-align:center;margin:3em 0}.page-item{display:inline-block}.page-item .page-link{display:flex;align-items:center;justify-content:center;width:1.8rem;height:1.8rem}.page-item.active .page-link{color:#fff;border-radius:2em;background:#87cefa}.post-title{color:#fff}.post-meta>div{display:flex;align-items:center;flex-wrap:wrap;gap:.2em;font-size:.8em}.post-meta>div>.icon{margin-right:.4em}.post-content>pre,.post-content .highlight{margin:1em 0}.post-content>pre,.post-content .highlight>pre,.post-content .highlight>div{border-left:.4em solid rgba(135,206,250,.8);padding:1em}.post-content blockquote{border-left:.4em solid rgba(135,206,250,.8);margin:1em 0;padding:.5em 1em;background:#242930}.post-content blockquote p{margin:.5em 0}.post-content img{max-width:100%}.posts-list{padding:0}.posts-list-item{list-style:none;padding:.4em 0}.posts-list-item:not(:last-child){border-bottom:1px dashed rgba(255,255,255,.3)}.posts-list-item-description{display:flex;align-items:center;font-size:.8em}.posts-list-item-description>.icon{margin-right:.4em}.posts-list-item-separator{margin:0 .4em}.tag{display:inline-block;margin-right:.2em;padding:0 .6em;font-size:.9em;border-radius:.2em;white-space:nowrap;background:rgba(255,255,255,.1);transition:color .35s,background .35s}.tag:hover{transition:color .25s,background .05s;background:rgba(255,255,255,.3)}.tags-list{padding:0}.tags-list-item{display:flex;align-items:center;list-style:none;padding:.4em 0}.tags-list-item>.icon{margin-right:.4em}.tags-list-item:not(:last-child){border-bottom:1px dashed rgba(255,255,255,.3)}@media(min-width:450px){.tags-list{display:flex;flex-wrap:wrap}.tags-list-item{width:calc(50% - 1em)}.tags-list-item:nth-child(even){margin-left:1em}.tags-list-item:nth-last-child(2){border:none}}img{display:block;margin:0;max-width:100%;text-align:left}p img{width:65%;margin-bottom:1rem}.toc-container{position:fixed;top:20%;right:-300px;width:250px;max-height:60%;overflow-y:auto;background-color:#fff;box-shadow:-2px 0 5px rgba(0,0,0,.1);border-left:1px solid #ddd;padding:15px;transition:right .3s ease-in-out;z-index:999}.toc-container.visible{right:0}.toc-container ul{list-style-type:none;padding-left:0}.toc-container li{margin-bottom:8px}.toc-container a{text-decoration:none;color:#007bff}.toc-container a:hover{text-decoration:underline}.toc-item.h1{margin-left:0}.toc-item.h2{margin-left:10px}.toc-item.h3{margin-left:20px}.toc-toggle{position:fixed;bottom:20px;right:20px;width:50px;height:50px;background-color:#007bff;color:#fff;border:none;border-radius:50%;font-size:24px;cursor:pointer;z-index:1000}.toc-toggle:focus{outline:none}.toc-toggle:hover{background-color:#0056b3}.hidden{display:none} \ No newline at end of file diff --git a/resources/_gen/assets/css/main.scss_95e4f47594ba319c9acdf486feed3945.json b/resources/_gen/assets/css/main.scss_95e4f47594ba319c9acdf486feed3945.json index 720750c..28d25e6 100644 --- a/resources/_gen/assets/css/main.scss_95e4f47594ba319c9acdf486feed3945.json +++ b/resources/_gen/assets/css/main.scss_95e4f47594ba319c9acdf486feed3945.json @@ -1 +1 @@ -{"Target":"css/main.min.1130dbc316c46ebce5c0974972593128dc11ce9c223a91c1f73ca557000541bc.css","MediaType":"text/css","Data":{"Integrity":"sha256-ETDbwxbEbrzlwJdJclkxKNwRzpwiOpHB9zylVwAFQbw="}} \ No newline at end of file +{"Target":"css/main.min.08e876a0f4aeb92fb7ca4e4c12d7d6ea16684353b267ad3f4385e180cc91a06b.css","MediaType":"text/css","Data":{"Integrity":"sha256-COh2oPSuuS+3yk5MEtfW6hZoQ1OyZ60/Q4XhgMyRoGs="}} \ No newline at end of file diff --git a/themes/m10c/assets/css/_extra.scss b/themes/m10c/assets/css/_extra.scss index 71bf3c1..d8ecaad 100644 --- a/themes/m10c/assets/css/_extra.scss +++ b/themes/m10c/assets/css/_extra.scss @@ -12,3 +12,85 @@ p img { width: 65%; margin-bottom: 1rem; } + + +/* TOC 容器样式 */ +.toc-container { + position: fixed; + top: 20%; + right: -300px; /* 初始位置在屏幕外 */ + width: 250px; + max-height: 60%; + overflow-y: auto; + background-color: #ffffff; + box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1); + border-left: 1px solid #ddd; + padding: 15px; + transition: right 0.3s ease-in-out; + z-index: 999; +} + +.toc-container.visible { + right: 0; /* 显示时滑入屏幕 */ +} + +/* 目录列表样式 */ +.toc-container ul { + list-style-type: none; + padding-left: 0; +} + +.toc-container li { + margin-bottom: 8px; +} + +.toc-container a { + text-decoration: none; + color: #007bff; +} + +.toc-container a:hover { + text-decoration: underline; +} + +/* 不同级别标题的缩进 */ +.toc-item.h1 { + margin-left: 0; +} + +.toc-item.h2 { + margin-left: 10px; +} + +.toc-item.h3 { + margin-left: 20px; +} + +/* 浮动按钮样式 */ +.toc-toggle { + position: fixed; + bottom: 20px; + right: 20px; + width: 50px; + height: 50px; + background-color: #007bff; + color: white; + border: none; + border-radius: 50%; + font-size: 24px; + cursor: pointer; + z-index: 1000; +} + +.toc-toggle:focus { + outline: none; +} + +.toc-toggle:hover { + background-color: #0056b3; +} + +/* 隐藏目录 */ +.hidden { + display: none; +} diff --git a/themes/m10c/layouts/_default/single.html b/themes/m10c/layouts/_default/single.html index 30da500..80f8e5c 100644 --- a/themes/m10c/layouts/_default/single.html +++ b/themes/m10c/layouts/_default/single.html @@ -30,6 +30,20 @@

{{ .Title }}

+ + + + + + + + + + + + + {{ end }} diff --git a/themes/m10c/static/js/toc.js b/themes/m10c/static/js/toc.js new file mode 100644 index 0000000..8d016e0 --- /dev/null +++ b/themes/m10c/static/js/toc.js @@ -0,0 +1,72 @@ +// 等待 DOM 加载完成 +document.addEventListener('DOMContentLoaded', function () { + const tocToggle = document.getElementById('toc-toggle'); + const tocContainer = document.getElementById('toc'); + const contentArea = document.querySelector('.post-content'); // 根据你的内容区域的类名调整 + + // 生成目录函数 + function generateTOC() { + const headings = contentArea.querySelectorAll('h1, h2, h3'); + console.log("Headings found:", headings); // 输出找到的标题元素 + if (headings.length === 0) { + // 如果没有找到标题,隐藏浮动按钮 + tocToggle.style.display = 'none'; + return; + } + + const tocList = document.createElement('ul'); + + headings.forEach(function (heading) { + if (!heading.id) { + // 如果标题没有 id,生成一个 + heading.id = heading.textContent.trim().toLowerCase().replace(/\s+/g, '-').replace(/[^\w\-]/g, ''); + } + + const tocItem = document.createElement('li'); + tocItem.classList.add('toc-item', heading.tagName.toLowerCase()); + + const tocLink = document.createElement('a'); + tocLink.href = `#${heading.id}`; + tocLink.textContent = heading.textContent; + + tocItem.appendChild(tocLink); + tocList.appendChild(tocItem); + }); + + tocContainer.appendChild(tocList); + } + + // 页面加载时生成目录 + generateTOC(); + + // 切换目录的显示与隐藏 + tocToggle.addEventListener('click', function () { + console.log("TOC toggle clicked"); // 点击按钮时输出到控制台 + // 先检查当前是否是隐藏状态 + if (tocContainer.classList.contains("hidden")) { + tocContainer.classList.remove("hidden"); + tocContainer.classList.add("visible"); + } else { + tocContainer.classList.remove("visible"); + tocContainer.classList.add("hidden"); + } + }); + + // 点击目录项时平滑滚动到对应位置 + tocContainer.addEventListener('click', function (event) { + if (event.target.tagName.toLowerCase() === 'a') { + event.preventDefault(); + const targetId = event.target.getAttribute('href').substring(1); + const targetHeading = document.getElementById(targetId); + if (targetHeading) { + window.scrollTo({ + top: targetHeading.offsetTop - 20, // 根据需要调整偏移量 + behavior: 'smooth' + }); + // 点击后隐藏目录 + tocContainer.classList.remove("visible"); + tocContainer.classList.add("hidden"); + } + } + }); +});