Site updated: 2026-12-02 17:11:55
This commit is contained in:
1 parent
114bbbd7d9
commit
4528eda421
248 files changed
+3792
-1064
No files matched your search
@@ -60,7 +60,7 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
</head><body itemscope itemtype="http://schema.org/WebPage"><div id="loading"><div class="cat"><div class="body"></div><div class="head"><div class="face"></div></div><div class="foot"><div class="tummy-end"></div><div class="bottom"></div><div class="legs left"></div><div class="legs right"></div></div><div class="paw"><div class="hands left"></div><div class="hands right"></div></div></div></div><div id="container"><header id="header" itemscope itemtype="http://schema.org/WPHeader"><div class="inner"><div id="brand"><div class="pjax"><h1 itemprop="name headline">分类于"Centos"的文章</h1></div></div><nav id="nav"><div class="inner"><div class="toggle"><div class="lines" aria-label="切换导航栏"><span class="line"></span> <span class="line"></span> <span class="line"></span></div></div><ul class="menu"><li class="item title"><a href="/" rel="start">☆∵∴Hito∴∵★</a></li></ul><ul class="right"><li class="item theme"><i class="ic i-sun"></i></li><li class="item search"><i class="ic i-search"></i></li></ul></div></nav></div><div id="imgs" class="pjax"><ul><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?932264"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?975781"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?688836"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?823322"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?717971"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?585469"></li></ul></div></header><div id="waves"><svg class="waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto"><defs><path id="gentle-wave" d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z"/></defs><g class="parallax"><use xlink:href="#gentle-wave" x="48" y="0"/><use xlink:href="#gentle-wave" x="48" y="3"/><use xlink:href="#gentle-wave" x="48" y="5"/><use xlink:href="#gentle-wave" x="48" y="7"/></g></svg></div><main><div class="inner"><div id="main" class="pjax"><div class="collapse wrap"><h2 class="item header"><a href="/categories">全部</a> <small>/</small> <a href="/categories/Linux/">Linux</a> <small>/</small> Centos <small>分类</small></h2><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2023-10-28T19:26:00+08:00" content="2023-10-28">10-28</time></div><div class="title"><a href="/2023/10/28/Centos%E6%8C%82%E8%BD%BD%E6%96%B0%E7%A1%AC%E7%9B%98/" itemprop="url"><span itemprop="name">Centos挂载新硬盘</span></a></div></article></div></div><div id="sidebar"><div class="inner"><div class="panels"><div class="inner"><div class="contents panel pjax" data-title="文章目录"></div><div class="related panel pjax" data-title="系列文章"></div><div class="overview panel" data-title="站点概览"><div class="author" itemprop="author" itemscope itemtype="http://schema.org/Person"><img class="image" itemprop="image" alt="Hito Li" data-src="/images/avatar.jpg"><p class="name" itemprop="name">Hito Li</p><div class="description" itemprop="description">天生我材必有用</div></div><nav class="state"><div class="item posts"><a href="/archives/"><span class="count">65</span> <span class="name">文章</span></a></div><div class="item categories"><a href="/categories/"><span class="count">23</span> <span class="name">分类</span></a></div><div class="item tags"><a href="/tags/"><span class="count">110</span> <span class="name">标签</span></a></div></nav><div class="social"><span class="exturl item weibo" data-url="aHR0cHM6Ly93ZWliby5jb20vdS8xMDYxNDYwNzQ1" title="https://weibo.com/u/1061460745"><i class="ic i-weibo"></i></span> <span class="exturl item douban" data-url="aHR0cHM6Ly93d3cuZG91YmFuLmNvbS9wZW9wbGUvMjU5Mzc2NTY0" title="https://www.douban.com/people/259376564"><i class="ic i-douban"></i></span> <span class="exturl item music" data-url="aHR0cHM6Ly9tdXNpYy4xNjMuY29tLyMvdXNlci9ob21lP2lkPTEwNTQ2NzQ2Mw==" title="https://music.163.com/#/user/home?id=105467463"><i class="ic i-cloud-music"></i></span> <a href="/about/me" title="about/me" class="item about"><i class="ic i-address-card"></i></a></div><ul class="menu"><li class="item"><a href="/" rel="section"><i class="ic i-home"></i>首页</a></li><li class="item dropdown"><a href="javascript:void(0);"><i class="ic i-feather"></i>文章</a><ul class="submenu"><li class="item"><a href="/archives/" rel="section"><i class="ic i-list-alt"></i>归档</a></li><li class="item"><a href="/categories/" rel="section"><i class="ic i-th"></i>Line truncated
|
||||
</head><body itemscope itemtype="http://schema.org/WebPage"><div id="loading"><div class="cat"><div class="body"></div><div class="head"><div class="face"></div></div><div class="foot"><div class="tummy-end"></div><div class="bottom"></div><div class="legs left"></div><div class="legs right"></div></div><div class="paw"><div class="hands left"></div><div class="hands right"></div></div></div></div><div id="container"><header id="header" itemscope itemtype="http://schema.org/WPHeader"><div class="inner"><div id="brand"><div class="pjax"><h1 itemprop="name headline">分类于"Centos"的文章</h1></div></div><nav id="nav"><div class="inner"><div class="toggle"><div class="lines" aria-label="切换导航栏"><span class="line"></span> <span class="line"></span> <span class="line"></span></div></div><ul class="menu"><li class="item title"><a href="/" rel="start">☆∵∴Hito∴∵★</a></li></ul><ul class="right"><li class="item theme"><i class="ic i-sun"></i></li><li class="item search"><i class="ic i-search"></i></li></ul></div></nav></div><div id="imgs" class="pjax"><ul><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?779055"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?242410"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?220060"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?164590"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?618987"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?98743"></li></ul></div></header><div id="waves"><svg class="waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto"><defs><path id="gentle-wave" d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z"/></defs><g class="parallax"><use xlink:href="#gentle-wave" x="48" y="0"/><use xlink:href="#gentle-wave" x="48" y="3"/><use xlink:href="#gentle-wave" x="48" y="5"/><use xlink:href="#gentle-wave" x="48" y="7"/></g></svg></div><main><div class="inner"><div id="main" class="pjax"><div class="collapse wrap"><h2 class="item header"><a href="/categories">全部</a> <small>/</small> <a href="/categories/Linux/">Linux</a> <small>/</small> Centos <small>分类</small></h2><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2023-10-28T19:26:00+08:00" content="2023-10-28">10-28</time></div><div class="title"><a href="/2023/10/28/Centos%E6%8C%82%E8%BD%BD%E6%96%B0%E7%A1%AC%E7%9B%98/" itemprop="url"><span itemprop="name">Centos挂载新硬盘</span></a></div></article></div></div><div id="sidebar"><div class="inner"><div class="panels"><div class="inner"><div class="contents panel pjax" data-title="文章目录"></div><div class="related panel pjax" data-title="系列文章"></div><div class="overview panel" data-title="站点概览"><div class="author" itemprop="author" itemscope itemtype="http://schema.org/Person"><img class="image" itemprop="image" alt="Hito Li" data-src="/images/avatar.jpg"><p class="name" itemprop="name">Hito Li</p><div class="description" itemprop="description">天生我材必有用</div></div><nav class="state"><div class="item posts"><a href="/archives/"><span class="count">65</span> <span class="name">文章</span></a></div><div class="item categories"><a href="/categories/"><span class="count">23</span> <span class="name">分类</span></a></div><div class="item tags"><a href="/tags/"><span class="count">110</span> <span class="name">标签</span></a></div></nav><div class="social"><span class="exturl item weibo" data-url="aHR0cHM6Ly93ZWliby5jb20vdS8xMDYxNDYwNzQ1" title="https://weibo.com/u/1061460745"><i class="ic i-weibo"></i></span> <span class="exturl item douban" data-url="aHR0cHM6Ly93d3cuZG91YmFuLmNvbS9wZW9wbGUvMjU5Mzc2NTY0" title="https://www.douban.com/people/259376564"><i class="ic i-douban"></i></span> <span class="exturl item music" data-url="aHR0cHM6Ly9tdXNpYy4xNjMuY29tLyMvdXNlci9ob21lP2lkPTEwNTQ2NzQ2Mw==" title="https://music.163.com/#/user/home?id=105467463"><i class="ic i-cloud-music"></i></span> <a href="/about/me" title="about/me" class="item about"><i class="ic i-address-card"></i></a></div><ul class="menu"><li class="item"><a href="/" rel="section"><i class="ic i-home"></i>首页</a></li><li class="item dropdown"><a href="javascript:void(0);"><i class="ic i-feather"></i>文章</a><ul class="submenu"><li class="item"><a href="/archives/" rel="section"><i class="ic i-list-alt"></i>归档</a></li><li class="item"><a href="/categories/" rel="section"><i class="ic i-th"></i>Line truncated
|
||||
// 侧栏「最新评论」:挂在 footer 的 .leancloud-recent-comment 容器(PJAX 不替换 footer,全局渲染一次即可)
|
||||
// 动态 import 加载 ESM 版 waline.js;普通 <script src> 会报 export 语法错误
|
||||
(async () => {
|
||||
@@ -98,7 +98,7 @@
|
||||
const el = document.querySelector('.leancloud-recent-comment');
|
||||
if (!el) return;
|
||||
const opts = (typeof AbortSignal !== 'undefined' && AbortSignal.timeout) ? { signal: AbortSignal.timeout(15000) } : {};
|
||||
fetch('https://comment.hitoli.com:8443/api/comment?type=recent&count=8&lang=zh-CN', opts)
|
||||
fetch('https://comment.hitoli.com:8443/api/comment?type=recent&count=20&lang=zh-CN', opts)
|
||||
.then(r => { if (!r.ok) throw new Error('HTTP ' + r.status); return r.json(); })
|
||||
.then(res => {
|
||||
const list = (res && res.data) || [];
|
||||
@@ -107,6 +107,17 @@
|
||||
const byId = {};
|
||||
list.forEach(c => { byId[c.objectId] = c; });
|
||||
const nickOf = (id) => (byId[id] && byId[id].nick) || '';
|
||||
// 点击跳转地址:优先自己的 url;为空则沿 pid 链向上找祖先的 url(老数据回复的 url 可能缺失);再兜底首页
|
||||
const urlOf = (c) => {
|
||||
let cur = c, seen = {};
|
||||
while (cur) {
|
||||
if (cur.url) return cur.url;
|
||||
if (seen[cur.objectId]) break; // 防环
|
||||
seen[cur.objectId] = true;
|
||||
cur = cur.pid ? byId[cur.pid] : null;
|
||||
}
|
||||
return '/';
|
||||
};
|
||||
const esc = (s) => String(s || '').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
||||
const itemHtml = (c, indent) => {
|
||||
const tmp = document.createElement('div');
|
||||
@@ -114,10 +125,10 @@
|
||||
// 去掉服务端已加的 "@昵称 ," 前缀(渲染成缩进层级后冗余)
|
||||
let text = (tmp.textContent || '').replace(/^\s*@\S+?\s*,\s*/, '').trim().replace(/\s+/g, ' ').slice(0, 60);
|
||||
const replyTag = indent ? '<span class="wl-reply-tag">↳ 回复 ' + esc(nickOf(c.pid)) + '</span>' : '';
|
||||
const link = c.url || c.path || '';
|
||||
const link = urlOf(c);
|
||||
return '<li class="wl-recent-item' + (indent ? ' wl-recent-child' : '') + '">'
|
||||
+ replyTag
|
||||
+ '<a href="' + link + '">' + esc(c.nick || '匿名') + '</a>:' + esc(text)
|
||||
+ '<a href="' + esc(link) + '">' + esc(c.nick || '匿名') + '</a>:' + esc(text)
|
||||
+ '</li>';
|
||||
};
|
||||
// 子评论紧跟在父评论后面输出(保持数据原有时间序)
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
</head><body itemscope itemtype="http://schema.org/WebPage"><div id="loading"><div class="cat"><div class="body"></div><div class="head"><div class="face"></div></div><div class="foot"><div class="tummy-end"></div><div class="bottom"></div><div class="legs left"></div><div class="legs right"></div></div><div class="paw"><div class="hands left"></div><div class="hands right"></div></div></div></div><div id="container"><header id="header" itemscope itemtype="http://schema.org/WPHeader"><div class="inner"><div id="brand"><div class="pjax"><h1 itemprop="name headline">分类于"Shell"的文章</h1></div></div><nav id="nav"><div class="inner"><div class="toggle"><div class="lines" aria-label="切换导航栏"><span class="line"></span> <span class="line"></span> <span class="line"></span></div></div><ul class="menu"><li class="item title"><a href="/" rel="start">☆∵∴Hito∴∵★</a></li></ul><ul class="right"><li class="item theme"><i class="ic i-sun"></i></li><li class="item search"><i class="ic i-search"></i></li></ul></div></nav></div><div id="imgs" class="pjax"><ul><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?870189"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?851583"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?932814"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?955443"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?502247"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?823400"></li></ul></div></header><div id="waves"><svg class="waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto"><defs><path id="gentle-wave" d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z"/></defs><g class="parallax"><use xlink:href="#gentle-wave" x="48" y="0"/><use xlink:href="#gentle-wave" x="48" y="3"/><use xlink:href="#gentle-wave" x="48" y="5"/><use xlink:href="#gentle-wave" x="48" y="7"/></g></svg></div><main><div class="inner"><div id="main" class="pjax"><div class="collapse wrap"><h2 class="item header"><a href="/categories">全部</a> <small>/</small> <a href="/categories/Linux/">Linux</a> <small>/</small> Shell <small>分类</small></h2><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2023-11-03T21:35:00+08:00" content="2023-11-03">11-03</time></div><div class="title"><a href="/2023/11/03/Linux%E4%B8%8B%E5%BF%AB%E9%80%9F%E9%83%A8%E7%BD%B2SpringBoot%E9%A1%B9%E7%9B%AE%E7%9A%84%E8%84%9A%E6%9C%AC/" itemprop="url"><span itemprop="name">Linux下快速部署SpringBoot项目的脚本</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-11-02T16:29:00+08:00" content="2022-11-02">11-02</time></div><div class="title"><a href="/2022/11/02/2-dev-null%E5%92%8C-dev-null-2-1%E5%92%8C2-1-dev-null%E7%9A%84%E5%8C%BA%E5%88%AB/" itemprop="url"><span itemprop="name">2>/dev/null和>/dev/null 2>&1和2>&1>/dev/null的区别</span></a></div></article></div></div><div id="sidebar"><div class="inner"><div class="panels"><div class="inner"><div class="contents panel pjax" data-title="文章目录"></div><div class="related panel pjax" data-title="系列文章"></div><div class="overview panel" data-title="站点概览"><div class="author" itemprop="author" itemscope itemtype="http://schema.org/Person"><img class="image" itemprop="image" alt="Hito Li" data-src="/images/avatar.jpg"><p class="name" itemprop="name">Hito Li</p><div class="description" itemprop="description">天生我材必有用</div></div><nav class="state"><div class="item posts"><a href="/archives/"><span class="count">65</span> <span class="name">文章</span></a></div><div class="item categories"><a href="/categories/"><span class="count">23</span> <span class="name">分类</span></a></div><div class="item tags"><a href="/tags/"><span class="count">110</span> <span class="name">标签</span></a></div></nav><div class="social"><span class="exturl item weibo" data-url="aHR0cHM6Ly93ZWliby5jb20vdS8xMDYxNDYwNzQ1" title="https://weibo.com/u/1061460745"><i class="ic i-weibo"></i></span> <span class="exturl item douban" data-url="aHR0cHM6Ly93d3cuZG91YmFuLmNvbS9wZW9wbGUvMjU5Mzc2NTY0" title="https://www.douban.com/people/259376564"><i class="ic i-douban"></i></span> <span class="exturl item music" data-url="aHR0cHM6Ly9tdXNpYy4xNjMuY29tLyMvdXNlci9ob21lP2lkPTEwNTQ2NzQ2Mw==" title="https://music.163.com/#/user/home?id=105467463"><i class="ic iLine truncated
|
||||
</head><body itemscope itemtype="http://schema.org/WebPage"><div id="loading"><div class="cat"><div class="body"></div><div class="head"><div class="face"></div></div><div class="foot"><div class="tummy-end"></div><div class="bottom"></div><div class="legs left"></div><div class="legs right"></div></div><div class="paw"><div class="hands left"></div><div class="hands right"></div></div></div></div><div id="container"><header id="header" itemscope itemtype="http://schema.org/WPHeader"><div class="inner"><div id="brand"><div class="pjax"><h1 itemprop="name headline">分类于"Shell"的文章</h1></div></div><nav id="nav"><div class="inner"><div class="toggle"><div class="lines" aria-label="切换导航栏"><span class="line"></span> <span class="line"></span> <span class="line"></span></div></div><ul class="menu"><li class="item title"><a href="/" rel="start">☆∵∴Hito∴∵★</a></li></ul><ul class="right"><li class="item theme"><i class="ic i-sun"></i></li><li class="item search"><i class="ic i-search"></i></li></ul></div></nav></div><div id="imgs" class="pjax"><ul><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?887650"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?39592"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?776291"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?963951"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?213511"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?584952"></li></ul></div></header><div id="waves"><svg class="waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto"><defs><path id="gentle-wave" d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z"/></defs><g class="parallax"><use xlink:href="#gentle-wave" x="48" y="0"/><use xlink:href="#gentle-wave" x="48" y="3"/><use xlink:href="#gentle-wave" x="48" y="5"/><use xlink:href="#gentle-wave" x="48" y="7"/></g></svg></div><main><div class="inner"><div id="main" class="pjax"><div class="collapse wrap"><h2 class="item header"><a href="/categories">全部</a> <small>/</small> <a href="/categories/Linux/">Linux</a> <small>/</small> Shell <small>分类</small></h2><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2023-11-03T21:35:00+08:00" content="2023-11-03">11-03</time></div><div class="title"><a href="/2023/11/03/Linux%E4%B8%8B%E5%BF%AB%E9%80%9F%E9%83%A8%E7%BD%B2SpringBoot%E9%A1%B9%E7%9B%AE%E7%9A%84%E8%84%9A%E6%9C%AC/" itemprop="url"><span itemprop="name">Linux下快速部署SpringBoot项目的脚本</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-11-02T16:29:00+08:00" content="2022-11-02">11-02</time></div><div class="title"><a href="/2022/11/02/2-dev-null%E5%92%8C-dev-null-2-1%E5%92%8C2-1-dev-null%E7%9A%84%E5%8C%BA%E5%88%AB/" itemprop="url"><span itemprop="name">2>/dev/null和>/dev/null 2>&1和2>&1>/dev/null的区别</span></a></div></article></div></div><div id="sidebar"><div class="inner"><div class="panels"><div class="inner"><div class="contents panel pjax" data-title="文章目录"></div><div class="related panel pjax" data-title="系列文章"></div><div class="overview panel" data-title="站点概览"><div class="author" itemprop="author" itemscope itemtype="http://schema.org/Person"><img class="image" itemprop="image" alt="Hito Li" data-src="/images/avatar.jpg"><p class="name" itemprop="name">Hito Li</p><div class="description" itemprop="description">天生我材必有用</div></div><nav class="state"><div class="item posts"><a href="/archives/"><span class="count">65</span> <span class="name">文章</span></a></div><div class="item categories"><a href="/categories/"><span class="count">23</span> <span class="name">分类</span></a></div><div class="item tags"><a href="/tags/"><span class="count">110</span> <span class="name">标签</span></a></div></nav><div class="social"><span class="exturl item weibo" data-url="aHR0cHM6Ly93ZWliby5jb20vdS8xMDYxNDYwNzQ1" title="https://weibo.com/u/1061460745"><i class="ic i-weibo"></i></span> <span class="exturl item douban" data-url="aHR0cHM6Ly93d3cuZG91YmFuLmNvbS9wZW9wbGUvMjU5Mzc2NTY0" title="https://www.douban.com/people/259376564"><i class="ic i-douban"></i></span> <span class="exturl item music" data-url="aHR0cHM6Ly9tdXNpYy4xNjMuY29tLyMvdXNlci9ob21lP2lkPTEwNTQ2NzQ2Mw==" title="https://music.163.com/#/user/home?id=105467463"><i class="ic i-Line truncated
|
||||
// 侧栏「最新评论」:挂在 footer 的 .leancloud-recent-comment 容器(PJAX 不替换 footer,全局渲染一次即可)
|
||||
// 动态 import 加载 ESM 版 waline.js;普通 <script src> 会报 export 语法错误
|
||||
(async () => {
|
||||
@@ -98,7 +98,7 @@
|
||||
const el = document.querySelector('.leancloud-recent-comment');
|
||||
if (!el) return;
|
||||
const opts = (typeof AbortSignal !== 'undefined' && AbortSignal.timeout) ? { signal: AbortSignal.timeout(15000) } : {};
|
||||
fetch('https://comment.hitoli.com:8443/api/comment?type=recent&count=8&lang=zh-CN', opts)
|
||||
fetch('https://comment.hitoli.com:8443/api/comment?type=recent&count=20&lang=zh-CN', opts)
|
||||
.then(r => { if (!r.ok) throw new Error('HTTP ' + r.status); return r.json(); })
|
||||
.then(res => {
|
||||
const list = (res && res.data) || [];
|
||||
@@ -107,6 +107,17 @@
|
||||
const byId = {};
|
||||
list.forEach(c => { byId[c.objectId] = c; });
|
||||
const nickOf = (id) => (byId[id] && byId[id].nick) || '';
|
||||
// 点击跳转地址:优先自己的 url;为空则沿 pid 链向上找祖先的 url(老数据回复的 url 可能缺失);再兜底首页
|
||||
const urlOf = (c) => {
|
||||
let cur = c, seen = {};
|
||||
while (cur) {
|
||||
if (cur.url) return cur.url;
|
||||
if (seen[cur.objectId]) break; // 防环
|
||||
seen[cur.objectId] = true;
|
||||
cur = cur.pid ? byId[cur.pid] : null;
|
||||
}
|
||||
return '/';
|
||||
};
|
||||
const esc = (s) => String(s || '').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
||||
const itemHtml = (c, indent) => {
|
||||
const tmp = document.createElement('div');
|
||||
@@ -114,10 +125,10 @@
|
||||
// 去掉服务端已加的 "@昵称 ," 前缀(渲染成缩进层级后冗余)
|
||||
let text = (tmp.textContent || '').replace(/^\s*@\S+?\s*,\s*/, '').trim().replace(/\s+/g, ' ').slice(0, 60);
|
||||
const replyTag = indent ? '<span class="wl-reply-tag">↳ 回复 ' + esc(nickOf(c.pid)) + '</span>' : '';
|
||||
const link = c.url || c.path || '';
|
||||
const link = urlOf(c);
|
||||
return '<li class="wl-recent-item' + (indent ? ' wl-recent-child' : '') + '">'
|
||||
+ replyTag
|
||||
+ '<a href="' + link + '">' + esc(c.nick || '匿名') + '</a>:' + esc(text)
|
||||
+ '<a href="' + esc(link) + '">' + esc(c.nick || '匿名') + '</a>:' + esc(text)
|
||||
+ '</li>';
|
||||
};
|
||||
// 子评论紧跟在父评论后面输出(保持数据原有时间序)
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
</head><body itemscope itemtype="http://schema.org/WebPage"><div id="loading"><div class="cat"><div class="body"></div><div class="head"><div class="face"></div></div><div class="foot"><div class="tummy-end"></div><div class="bottom"></div><div class="legs left"></div><div class="legs right"></div></div><div class="paw"><div class="hands left"></div><div class="hands right"></div></div></div></div><div id="container"><header id="header" itemscope itemtype="http://schema.org/WPHeader"><div class="inner"><div id="brand"><div class="pjax"><h1 itemprop="name headline">分类于"Linux"的文章</h1></div></div><nav id="nav"><div class="inner"><div class="toggle"><div class="lines" aria-label="切换导航栏"><span class="line"></span> <span class="line"></span> <span class="line"></span></div></div><ul class="menu"><li class="item title"><a href="/" rel="start">☆∵∴Hito∴∵★</a></li></ul><ul class="right"><li class="item theme"><i class="ic i-sun"></i></li><li class="item search"><i class="ic i-search"></i></li></ul></div></nav></div><div id="imgs" class="pjax"><ul><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?337840"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?618886"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?28673"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?334565"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?465723"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?850316"></li></ul></div></header><div id="waves"><svg class="waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto"><defs><path id="gentle-wave" d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z"/></defs><g class="parallax"><use xlink:href="#gentle-wave" x="48" y="0"/><use xlink:href="#gentle-wave" x="48" y="3"/><use xlink:href="#gentle-wave" x="48" y="5"/><use xlink:href="#gentle-wave" x="48" y="7"/></g></svg></div><main><div class="inner"><div id="main" class="pjax"><div class="collapse wrap"><h2 class="item header"><a href="/categories">全部</a> <small>/</small> Linux <small>分类</small></h2><h3 class="item section"><a href="/categories/Linux/Shell/">Shell</a> <small>( 2 )</small></h3><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2023-11-03T21:35:00+08:00" content="2023-11-03">11-03</time></div><div class="title"><a href="/2023/11/03/Linux%E4%B8%8B%E5%BF%AB%E9%80%9F%E9%83%A8%E7%BD%B2SpringBoot%E9%A1%B9%E7%9B%AE%E7%9A%84%E8%84%9A%E6%9C%AC/" itemprop="url"><span itemprop="name">Linux下快速部署SpringBoot项目的脚本</span></a></div></article><h3 class="item section"><a href="/categories/Linux/Centos/">Centos</a> <small>( 1 )</small></h3><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2023-10-28T19:26:00+08:00" content="2023-10-28">10-28</time></div><div class="title"><a href="/2023/10/28/Centos%E6%8C%82%E8%BD%BD%E6%96%B0%E7%A1%AC%E7%9B%98/" itemprop="url"><span itemprop="name">Centos挂载新硬盘</span></a></div></article><h3 class="item section"><a href="/categories/Linux/%E6%9C%8D%E5%8A%A1/">服务</a> <small>/ </small><a href="/categories/Linux/%E6%9C%8D%E5%8A%A1/Nginx/">Nginx</a> <small>( 8 )</small></h3><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-11-30T17:05:00+08:00" content="2022-11-30">11-30</time></div><div class="title"><a href="/2022/11/30/%E5%B0%86nginx%E6%9B%BF%E6%8D%A2%E4%B8%BAtengine/" itemprop="url"><span itemprop="name">将nginx替换为tengine</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-11-30T16:35:00+08:00" content="2022-11-30">11-30</time></div><div class="title"><a href="/2022/11/30/Nginx%E5%8A%A8%E6%80%81%E8%A7%A3%E6%9E%90%E5%9F%9F%E5%90%8D%E6%96%B9%E6%A1%88/" itemprop="url"><span itemprop="name">Nginx动态解析域名方案</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-11-30T16:09:00+08:00" content="2022-11-30">11-30</time></div><div class="title"><a href="/2022/11/30/Nginx%E9%85%8D%E7%BD%AEstream%E8%B8%A9%E5%9D%91/" itemprop="url"><span itemprop="name">Nginx配置stream踩坑</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateLine truncated
|
||||
</head><body itemscope itemtype="http://schema.org/WebPage"><div id="loading"><div class="cat"><div class="body"></div><div class="head"><div class="face"></div></div><div class="foot"><div class="tummy-end"></div><div class="bottom"></div><div class="legs left"></div><div class="legs right"></div></div><div class="paw"><div class="hands left"></div><div class="hands right"></div></div></div></div><div id="container"><header id="header" itemscope itemtype="http://schema.org/WPHeader"><div class="inner"><div id="brand"><div class="pjax"><h1 itemprop="name headline">分类于"Linux"的文章</h1></div></div><nav id="nav"><div class="inner"><div class="toggle"><div class="lines" aria-label="切换导航栏"><span class="line"></span> <span class="line"></span> <span class="line"></span></div></div><ul class="menu"><li class="item title"><a href="/" rel="start">☆∵∴Hito∴∵★</a></li></ul><ul class="right"><li class="item theme"><i class="ic i-sun"></i></li><li class="item search"><i class="ic i-search"></i></li></ul></div></nav></div><div id="imgs" class="pjax"><ul><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?928281"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?858332"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?339478"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?335569"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?907968"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?441890"></li></ul></div></header><div id="waves"><svg class="waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto"><defs><path id="gentle-wave" d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z"/></defs><g class="parallax"><use xlink:href="#gentle-wave" x="48" y="0"/><use xlink:href="#gentle-wave" x="48" y="3"/><use xlink:href="#gentle-wave" x="48" y="5"/><use xlink:href="#gentle-wave" x="48" y="7"/></g></svg></div><main><div class="inner"><div id="main" class="pjax"><div class="collapse wrap"><h2 class="item header"><a href="/categories">全部</a> <small>/</small> Linux <small>分类</small></h2><h3 class="item section"><a href="/categories/Linux/Shell/">Shell</a> <small>( 2 )</small></h3><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2023-11-03T21:35:00+08:00" content="2023-11-03">11-03</time></div><div class="title"><a href="/2023/11/03/Linux%E4%B8%8B%E5%BF%AB%E9%80%9F%E9%83%A8%E7%BD%B2SpringBoot%E9%A1%B9%E7%9B%AE%E7%9A%84%E8%84%9A%E6%9C%AC/" itemprop="url"><span itemprop="name">Linux下快速部署SpringBoot项目的脚本</span></a></div></article><h3 class="item section"><a href="/categories/Linux/Centos/">Centos</a> <small>( 1 )</small></h3><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2023-10-28T19:26:00+08:00" content="2023-10-28">10-28</time></div><div class="title"><a href="/2023/10/28/Centos%E6%8C%82%E8%BD%BD%E6%96%B0%E7%A1%AC%E7%9B%98/" itemprop="url"><span itemprop="name">Centos挂载新硬盘</span></a></div></article><h3 class="item section"><a href="/categories/Linux/%E6%9C%8D%E5%8A%A1/">服务</a> <small>/ </small><a href="/categories/Linux/%E6%9C%8D%E5%8A%A1/Nginx/">Nginx</a> <small>( 8 )</small></h3><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-11-30T17:05:00+08:00" content="2022-11-30">11-30</time></div><div class="title"><a href="/2022/11/30/%E5%B0%86nginx%E6%9B%BF%E6%8D%A2%E4%B8%BAtengine/" itemprop="url"><span itemprop="name">将nginx替换为tengine</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-11-30T16:35:00+08:00" content="2022-11-30">11-30</time></div><div class="title"><a href="/2022/11/30/Nginx%E5%8A%A8%E6%80%81%E8%A7%A3%E6%9E%90%E5%9F%9F%E5%90%8D%E6%96%B9%E6%A1%88/" itemprop="url"><span itemprop="name">Nginx动态解析域名方案</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-11-30T16:09:00+08:00" content="2022-11-30">11-30</time></div><div class="title"><a href="/2022/11/30/Nginx%E9%85%8D%E7%BD%AEstream%E8%B8%A9%E5%9D%91/" itemprop="url"><span itemprop="name">Nginx配置stream踩坑</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="datLine truncated
|
||||
// 侧栏「最新评论」:挂在 footer 的 .leancloud-recent-comment 容器(PJAX 不替换 footer,全局渲染一次即可)
|
||||
// 动态 import 加载 ESM 版 waline.js;普通 <script src> 会报 export 语法错误
|
||||
(async () => {
|
||||
@@ -98,7 +98,7 @@
|
||||
const el = document.querySelector('.leancloud-recent-comment');
|
||||
if (!el) return;
|
||||
const opts = (typeof AbortSignal !== 'undefined' && AbortSignal.timeout) ? { signal: AbortSignal.timeout(15000) } : {};
|
||||
fetch('https://comment.hitoli.com:8443/api/comment?type=recent&count=8&lang=zh-CN', opts)
|
||||
fetch('https://comment.hitoli.com:8443/api/comment?type=recent&count=20&lang=zh-CN', opts)
|
||||
.then(r => { if (!r.ok) throw new Error('HTTP ' + r.status); return r.json(); })
|
||||
.then(res => {
|
||||
const list = (res && res.data) || [];
|
||||
@@ -107,6 +107,17 @@
|
||||
const byId = {};
|
||||
list.forEach(c => { byId[c.objectId] = c; });
|
||||
const nickOf = (id) => (byId[id] && byId[id].nick) || '';
|
||||
// 点击跳转地址:优先自己的 url;为空则沿 pid 链向上找祖先的 url(老数据回复的 url 可能缺失);再兜底首页
|
||||
const urlOf = (c) => {
|
||||
let cur = c, seen = {};
|
||||
while (cur) {
|
||||
if (cur.url) return cur.url;
|
||||
if (seen[cur.objectId]) break; // 防环
|
||||
seen[cur.objectId] = true;
|
||||
cur = cur.pid ? byId[cur.pid] : null;
|
||||
}
|
||||
return '/';
|
||||
};
|
||||
const esc = (s) => String(s || '').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
||||
const itemHtml = (c, indent) => {
|
||||
const tmp = document.createElement('div');
|
||||
@@ -114,10 +125,10 @@
|
||||
// 去掉服务端已加的 "@昵称 ," 前缀(渲染成缩进层级后冗余)
|
||||
let text = (tmp.textContent || '').replace(/^\s*@\S+?\s*,\s*/, '').trim().replace(/\s+/g, ' ').slice(0, 60);
|
||||
const replyTag = indent ? '<span class="wl-reply-tag">↳ 回复 ' + esc(nickOf(c.pid)) + '</span>' : '';
|
||||
const link = c.url || c.path || '';
|
||||
const link = urlOf(c);
|
||||
return '<li class="wl-recent-item' + (indent ? ' wl-recent-child' : '') + '">'
|
||||
+ replyTag
|
||||
+ '<a href="' + link + '">' + esc(c.nick || '匿名') + '</a>:' + esc(text)
|
||||
+ '<a href="' + esc(link) + '">' + esc(c.nick || '匿名') + '</a>:' + esc(text)
|
||||
+ '</li>';
|
||||
};
|
||||
// 子评论紧跟在父评论后面输出(保持数据原有时间序)
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
</head><body itemscope itemtype="http://schema.org/WebPage"><div id="loading"><div class="cat"><div class="body"></div><div class="head"><div class="face"></div></div><div class="foot"><div class="tummy-end"></div><div class="bottom"></div><div class="legs left"></div><div class="legs right"></div></div><div class="paw"><div class="hands left"></div><div class="hands right"></div></div></div></div><div id="container"><header id="header" itemscope itemtype="http://schema.org/WPHeader"><div class="inner"><div id="brand"><div class="pjax"><h1 itemprop="name headline">分类于"Linux"的文章</h1></div></div><nav id="nav"><div class="inner"><div class="toggle"><div class="lines" aria-label="切换导航栏"><span class="line"></span> <span class="line"></span> <span class="line"></span></div></div><ul class="menu"><li class="item title"><a href="/" rel="start">☆∵∴Hito∴∵★</a></li></ul><ul class="right"><li class="item theme"><i class="ic i-sun"></i></li><li class="item search"><i class="ic i-search"></i></li></ul></div></nav></div><div id="imgs" class="pjax"><ul><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?495173"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?907999"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?845423"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?564077"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?173025"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?896363"></li></ul></div></header><div id="waves"><svg class="waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto"><defs><path id="gentle-wave" d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z"/></defs><g class="parallax"><use xlink:href="#gentle-wave" x="48" y="0"/><use xlink:href="#gentle-wave" x="48" y="3"/><use xlink:href="#gentle-wave" x="48" y="5"/><use xlink:href="#gentle-wave" x="48" y="7"/></g></svg></div><main><div class="inner"><div id="main" class="pjax"><div class="collapse wrap"><h2 class="item header"><a href="/categories">全部</a> <small>/</small> Linux <small>分类</small></h2><h3 class="item section"><a href="/categories/Linux/%E6%9C%8D%E5%8A%A1/">服务</a> <small>/ </small><a href="/categories/Linux/%E6%9C%8D%E5%8A%A1/Nginx/">Nginx</a> <small>( 8 )</small></h3><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-10-06T23:46:00+08:00" content="2022-10-06">10-06</time></div><div class="title"><a href="/2022/10/06/Nginx%E9%85%8D%E7%BD%AEiframe%E8%AE%BF%E9%97%AE/" itemprop="url"><span itemprop="name">Nginx配置iframe访问</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-09-27T14:45:00+08:00" content="2022-09-27">09-27</time></div><div class="title"><a href="/2022/09/27/nginx%E8%B4%9F%E8%BD%BD%E5%9D%87%E8%A1%A1%E9%85%8D%E7%BD%AE/" itemprop="url"><span itemprop="name">nginx负载均衡配置</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-09-23T16:17:00+08:00" content="2022-09-23">09-23</time></div><div class="title"><a href="/2022/09/23/%E8%A7%A3%E5%86%B3%E5%9F%9F%E5%90%8Dip%E5%8F%98%E5%8A%A8%E5%90%8E%E9%9C%80%E8%A6%81%E9%87%8D%E5%90%AFnginx%E7%9A%84%E9%97%AE%E9%A2%98/" itemprop="url"><span itemprop="name">解决域名ip变动后需要重启nginx的问题</span></a></div></article></div><nav class="pagination"><div class="inner"><a class="extend prev" rel="prev" href="/categories/Linux/"><i class="ic i-angle-left" aria-label="上一页"></i></a><a class="page-number" href="/categories/Linux/">1</a><span class="page-number current">2</span></div></nav></div><div id="sidebar"><div class="inner"><div class="panels"><div class="inner"><div class="contents panel pjax" data-title="文章目录"></div><div class="related panel pjax" data-title="系列文章"></div><div class="overview panel" data-title="站点概览"><div class="author" itemprop="author" itemscope itemtype="http://schema.org/Person"><img class="image" itemprop="image" alt="Hito Li" data-src="/images/avatar.jpg"><p class="name" itemprop="name">Hito Li</p><div class="description" itemprop="description">天生我材必有用</div></div><nav class="state"><div class="item posts"><a href="/archives/"><span class="count">65</span> <span class="name">文章</span></a></div><div class="item categories"><a href="/categories/"><span class="count">23</span> <span cLine truncated
|
||||
</head><body itemscope itemtype="http://schema.org/WebPage"><div id="loading"><div class="cat"><div class="body"></div><div class="head"><div class="face"></div></div><div class="foot"><div class="tummy-end"></div><div class="bottom"></div><div class="legs left"></div><div class="legs right"></div></div><div class="paw"><div class="hands left"></div><div class="hands right"></div></div></div></div><div id="container"><header id="header" itemscope itemtype="http://schema.org/WPHeader"><div class="inner"><div id="brand"><div class="pjax"><h1 itemprop="name headline">分类于"Linux"的文章</h1></div></div><nav id="nav"><div class="inner"><div class="toggle"><div class="lines" aria-label="切换导航栏"><span class="line"></span> <span class="line"></span> <span class="line"></span></div></div><ul class="menu"><li class="item title"><a href="/" rel="start">☆∵∴Hito∴∵★</a></li></ul><ul class="right"><li class="item theme"><i class="ic i-sun"></i></li><li class="item search"><i class="ic i-search"></i></li></ul></div></nav></div><div id="imgs" class="pjax"><ul><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?746900"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?183810"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?821857"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?146641"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?366317"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?620102"></li></ul></div></header><div id="waves"><svg class="waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto"><defs><path id="gentle-wave" d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z"/></defs><g class="parallax"><use xlink:href="#gentle-wave" x="48" y="0"/><use xlink:href="#gentle-wave" x="48" y="3"/><use xlink:href="#gentle-wave" x="48" y="5"/><use xlink:href="#gentle-wave" x="48" y="7"/></g></svg></div><main><div class="inner"><div id="main" class="pjax"><div class="collapse wrap"><h2 class="item header"><a href="/categories">全部</a> <small>/</small> Linux <small>分类</small></h2><h3 class="item section"><a href="/categories/Linux/%E6%9C%8D%E5%8A%A1/">服务</a> <small>/ </small><a href="/categories/Linux/%E6%9C%8D%E5%8A%A1/Nginx/">Nginx</a> <small>( 8 )</small></h3><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-10-06T23:46:00+08:00" content="2022-10-06">10-06</time></div><div class="title"><a href="/2022/10/06/Nginx%E9%85%8D%E7%BD%AEiframe%E8%AE%BF%E9%97%AE/" itemprop="url"><span itemprop="name">Nginx配置iframe访问</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-09-27T14:45:00+08:00" content="2022-09-27">09-27</time></div><div class="title"><a href="/2022/09/27/nginx%E8%B4%9F%E8%BD%BD%E5%9D%87%E8%A1%A1%E9%85%8D%E7%BD%AE/" itemprop="url"><span itemprop="name">nginx负载均衡配置</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-09-23T16:17:00+08:00" content="2022-09-23">09-23</time></div><div class="title"><a href="/2022/09/23/%E8%A7%A3%E5%86%B3%E5%9F%9F%E5%90%8Dip%E5%8F%98%E5%8A%A8%E5%90%8E%E9%9C%80%E8%A6%81%E9%87%8D%E5%90%AFnginx%E7%9A%84%E9%97%AE%E9%A2%98/" itemprop="url"><span itemprop="name">解决域名ip变动后需要重启nginx的问题</span></a></div></article></div><nav class="pagination"><div class="inner"><a class="extend prev" rel="prev" href="/categories/Linux/"><i class="ic i-angle-left" aria-label="上一页"></i></a><a class="page-number" href="/categories/Linux/">1</a><span class="page-number current">2</span></div></nav></div><div id="sidebar"><div class="inner"><div class="panels"><div class="inner"><div class="contents panel pjax" data-title="文章目录"></div><div class="related panel pjax" data-title="系列文章"></div><div class="overview panel" data-title="站点概览"><div class="author" itemprop="author" itemscope itemtype="http://schema.org/Person"><img class="image" itemprop="image" alt="Hito Li" data-src="/images/avatar.jpg"><p class="name" itemprop="name">Hito Li</p><div class="description" itemprop="description">天生我材必有用</div></div><nav class="state"><div class="item posts"><a href="/archives/"><span class="count">65</span> <span class="name">文章</span></a></div><div class="item categories"><a href="/categories/"><span class="count">23</span> <span cLine truncated
|
||||
// 侧栏「最新评论」:挂在 footer 的 .leancloud-recent-comment 容器(PJAX 不替换 footer,全局渲染一次即可)
|
||||
// 动态 import 加载 ESM 版 waline.js;普通 <script src> 会报 export 语法错误
|
||||
(async () => {
|
||||
@@ -98,7 +98,7 @@
|
||||
const el = document.querySelector('.leancloud-recent-comment');
|
||||
if (!el) return;
|
||||
const opts = (typeof AbortSignal !== 'undefined' && AbortSignal.timeout) ? { signal: AbortSignal.timeout(15000) } : {};
|
||||
fetch('https://comment.hitoli.com:8443/api/comment?type=recent&count=8&lang=zh-CN', opts)
|
||||
fetch('https://comment.hitoli.com:8443/api/comment?type=recent&count=20&lang=zh-CN', opts)
|
||||
.then(r => { if (!r.ok) throw new Error('HTTP ' + r.status); return r.json(); })
|
||||
.then(res => {
|
||||
const list = (res && res.data) || [];
|
||||
@@ -107,6 +107,17 @@
|
||||
const byId = {};
|
||||
list.forEach(c => { byId[c.objectId] = c; });
|
||||
const nickOf = (id) => (byId[id] && byId[id].nick) || '';
|
||||
// 点击跳转地址:优先自己的 url;为空则沿 pid 链向上找祖先的 url(老数据回复的 url 可能缺失);再兜底首页
|
||||
const urlOf = (c) => {
|
||||
let cur = c, seen = {};
|
||||
while (cur) {
|
||||
if (cur.url) return cur.url;
|
||||
if (seen[cur.objectId]) break; // 防环
|
||||
seen[cur.objectId] = true;
|
||||
cur = cur.pid ? byId[cur.pid] : null;
|
||||
}
|
||||
return '/';
|
||||
};
|
||||
const esc = (s) => String(s || '').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
||||
const itemHtml = (c, indent) => {
|
||||
const tmp = document.createElement('div');
|
||||
@@ -114,10 +125,10 @@
|
||||
// 去掉服务端已加的 "@昵称 ," 前缀(渲染成缩进层级后冗余)
|
||||
let text = (tmp.textContent || '').replace(/^\s*@\S+?\s*,\s*/, '').trim().replace(/\s+/g, ' ').slice(0, 60);
|
||||
const replyTag = indent ? '<span class="wl-reply-tag">↳ 回复 ' + esc(nickOf(c.pid)) + '</span>' : '';
|
||||
const link = c.url || c.path || '';
|
||||
const link = urlOf(c);
|
||||
return '<li class="wl-recent-item' + (indent ? ' wl-recent-child' : '') + '">'
|
||||
+ replyTag
|
||||
+ '<a href="' + link + '">' + esc(c.nick || '匿名') + '</a>:' + esc(text)
|
||||
+ '<a href="' + esc(link) + '">' + esc(c.nick || '匿名') + '</a>:' + esc(text)
|
||||
+ '</li>';
|
||||
};
|
||||
// 子评论紧跟在父评论后面输出(保持数据原有时间序)
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
</head><body itemscope itemtype="http://schema.org/WebPage"><div id="loading"><div class="cat"><div class="body"></div><div class="head"><div class="face"></div></div><div class="foot"><div class="tummy-end"></div><div class="bottom"></div><div class="legs left"></div><div class="legs right"></div></div><div class="paw"><div class="hands left"></div><div class="hands right"></div></div></div></div><div id="container"><header id="header" itemscope itemtype="http://schema.org/WPHeader"><div class="inner"><div id="brand"><div class="pjax"><h1 itemprop="name headline">分类于"Nginx"的文章</h1></div></div><nav id="nav"><div class="inner"><div class="toggle"><div class="lines" aria-label="切换导航栏"><span class="line"></span> <span class="line"></span> <span class="line"></span></div></div><ul class="menu"><li class="item title"><a href="/" rel="start">☆∵∴Hito∴∵★</a></li></ul><ul class="right"><li class="item theme"><i class="ic i-sun"></i></li><li class="item search"><i class="ic i-search"></i></li></ul></div></nav></div><div id="imgs" class="pjax"><ul><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?992102"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?133952"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?209908"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?364846"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?582311"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?525689"></li></ul></div></header><div id="waves"><svg class="waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto"><defs><path id="gentle-wave" d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z"/></defs><g class="parallax"><use xlink:href="#gentle-wave" x="48" y="0"/><use xlink:href="#gentle-wave" x="48" y="3"/><use xlink:href="#gentle-wave" x="48" y="5"/><use xlink:href="#gentle-wave" x="48" y="7"/></g></svg></div><main><div class="inner"><div id="main" class="pjax"><div class="collapse wrap"><h2 class="item header"><a href="/categories">全部</a> <small>/</small> <a href="/categories/Linux/%E6%9C%8D%E5%8A%A1/">服务</a> <small>/</small> Nginx <small>分类</small></h2><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-11-30T17:05:00+08:00" content="2022-11-30">11-30</time></div><div class="title"><a href="/2022/11/30/%E5%B0%86nginx%E6%9B%BF%E6%8D%A2%E4%B8%BAtengine/" itemprop="url"><span itemprop="name">将nginx替换为tengine</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-11-30T16:35:00+08:00" content="2022-11-30">11-30</time></div><div class="title"><a href="/2022/11/30/Nginx%E5%8A%A8%E6%80%81%E8%A7%A3%E6%9E%90%E5%9F%9F%E5%90%8D%E6%96%B9%E6%A1%88/" itemprop="url"><span itemprop="name">Nginx动态解析域名方案</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-11-30T16:09:00+08:00" content="2022-11-30">11-30</time></div><div class="title"><a href="/2022/11/30/Nginx%E9%85%8D%E7%BD%AEstream%E8%B8%A9%E5%9D%91/" itemprop="url"><span itemprop="name">Nginx配置stream踩坑</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-11-08T10:05:00+08:00" content="2022-11-08">11-08</time></div><div class="title"><a href="/2022/11/08/Nginx%E9%85%8D%E7%BD%AE-%E5%8F%8D%E5%90%91%E4%BB%A3%E7%90%86/" itemprop="url"><span itemprop="name">Nginx配置-反向代理</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-10-14T17:13:00+08:00" content="2022-10-14">10-14</time></div><div class="title"><a href="/2022/10/14/nginx%E5%85%81%E8%AE%B8%E8%B7%A8%E5%9F%9F%E8%8E%B7%E5%8F%96cookies%E6%96%B9%E6%B3%95/" itemprop="url"><span itemprop="name">nginx允许跨域获取cookie的方法</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-10-06T23:46:00+08:00" content="2022-10-06">10-06</time></div><div class="title"><a href="/2022/10/06/Nginx%E9%85%8D%E7%BD%AEiframe%E8%AE%BF%E9%97%AE/" itemprop="url"><span itemprop="name">Nginx配置iframe访问</span></a></div></article><article class="item normal" itemscope itemtype="http://schLine truncated
|
||||
</head><body itemscope itemtype="http://schema.org/WebPage"><div id="loading"><div class="cat"><div class="body"></div><div class="head"><div class="face"></div></div><div class="foot"><div class="tummy-end"></div><div class="bottom"></div><div class="legs left"></div><div class="legs right"></div></div><div class="paw"><div class="hands left"></div><div class="hands right"></div></div></div></div><div id="container"><header id="header" itemscope itemtype="http://schema.org/WPHeader"><div class="inner"><div id="brand"><div class="pjax"><h1 itemprop="name headline">分类于"Nginx"的文章</h1></div></div><nav id="nav"><div class="inner"><div class="toggle"><div class="lines" aria-label="切换导航栏"><span class="line"></span> <span class="line"></span> <span class="line"></span></div></div><ul class="menu"><li class="item title"><a href="/" rel="start">☆∵∴Hito∴∵★</a></li></ul><ul class="right"><li class="item theme"><i class="ic i-sun"></i></li><li class="item search"><i class="ic i-search"></i></li></ul></div></nav></div><div id="imgs" class="pjax"><ul><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?884961"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?660950"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?898426"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?819007"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?628887"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?57077"></li></ul></div></header><div id="waves"><svg class="waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto"><defs><path id="gentle-wave" d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z"/></defs><g class="parallax"><use xlink:href="#gentle-wave" x="48" y="0"/><use xlink:href="#gentle-wave" x="48" y="3"/><use xlink:href="#gentle-wave" x="48" y="5"/><use xlink:href="#gentle-wave" x="48" y="7"/></g></svg></div><main><div class="inner"><div id="main" class="pjax"><div class="collapse wrap"><h2 class="item header"><a href="/categories">全部</a> <small>/</small> <a href="/categories/Linux/%E6%9C%8D%E5%8A%A1/">服务</a> <small>/</small> Nginx <small>分类</small></h2><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-11-30T17:05:00+08:00" content="2022-11-30">11-30</time></div><div class="title"><a href="/2022/11/30/%E5%B0%86nginx%E6%9B%BF%E6%8D%A2%E4%B8%BAtengine/" itemprop="url"><span itemprop="name">将nginx替换为tengine</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-11-30T16:35:00+08:00" content="2022-11-30">11-30</time></div><div class="title"><a href="/2022/11/30/Nginx%E5%8A%A8%E6%80%81%E8%A7%A3%E6%9E%90%E5%9F%9F%E5%90%8D%E6%96%B9%E6%A1%88/" itemprop="url"><span itemprop="name">Nginx动态解析域名方案</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-11-30T16:09:00+08:00" content="2022-11-30">11-30</time></div><div class="title"><a href="/2022/11/30/Nginx%E9%85%8D%E7%BD%AEstream%E8%B8%A9%E5%9D%91/" itemprop="url"><span itemprop="name">Nginx配置stream踩坑</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-11-08T10:05:00+08:00" content="2022-11-08">11-08</time></div><div class="title"><a href="/2022/11/08/Nginx%E9%85%8D%E7%BD%AE-%E5%8F%8D%E5%90%91%E4%BB%A3%E7%90%86/" itemprop="url"><span itemprop="name">Nginx配置-反向代理</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-10-14T17:13:00+08:00" content="2022-10-14">10-14</time></div><div class="title"><a href="/2022/10/14/nginx%E5%85%81%E8%AE%B8%E8%B7%A8%E5%9F%9F%E8%8E%B7%E5%8F%96cookies%E6%96%B9%E6%B3%95/" itemprop="url"><span itemprop="name">nginx允许跨域获取cookie的方法</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-10-06T23:46:00+08:00" content="2022-10-06">10-06</time></div><div class="title"><a href="/2022/10/06/Nginx%E9%85%8D%E7%BD%AEiframe%E8%AE%BF%E9%97%AE/" itemprop="url"><span itemprop="name">Nginx配置iframe访问</span></a></div></article><article class="item normal" itemscope itemtype="http://scheLine truncated
|
||||
// 侧栏「最新评论」:挂在 footer 的 .leancloud-recent-comment 容器(PJAX 不替换 footer,全局渲染一次即可)
|
||||
// 动态 import 加载 ESM 版 waline.js;普通 <script src> 会报 export 语法错误
|
||||
(async () => {
|
||||
@@ -98,7 +98,7 @@
|
||||
const el = document.querySelector('.leancloud-recent-comment');
|
||||
if (!el) return;
|
||||
const opts = (typeof AbortSignal !== 'undefined' && AbortSignal.timeout) ? { signal: AbortSignal.timeout(15000) } : {};
|
||||
fetch('https://comment.hitoli.com:8443/api/comment?type=recent&count=8&lang=zh-CN', opts)
|
||||
fetch('https://comment.hitoli.com:8443/api/comment?type=recent&count=20&lang=zh-CN', opts)
|
||||
.then(r => { if (!r.ok) throw new Error('HTTP ' + r.status); return r.json(); })
|
||||
.then(res => {
|
||||
const list = (res && res.data) || [];
|
||||
@@ -107,6 +107,17 @@
|
||||
const byId = {};
|
||||
list.forEach(c => { byId[c.objectId] = c; });
|
||||
const nickOf = (id) => (byId[id] && byId[id].nick) || '';
|
||||
// 点击跳转地址:优先自己的 url;为空则沿 pid 链向上找祖先的 url(老数据回复的 url 可能缺失);再兜底首页
|
||||
const urlOf = (c) => {
|
||||
let cur = c, seen = {};
|
||||
while (cur) {
|
||||
if (cur.url) return cur.url;
|
||||
if (seen[cur.objectId]) break; // 防环
|
||||
seen[cur.objectId] = true;
|
||||
cur = cur.pid ? byId[cur.pid] : null;
|
||||
}
|
||||
return '/';
|
||||
};
|
||||
const esc = (s) => String(s || '').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
||||
const itemHtml = (c, indent) => {
|
||||
const tmp = document.createElement('div');
|
||||
@@ -114,10 +125,10 @@
|
||||
// 去掉服务端已加的 "@昵称 ," 前缀(渲染成缩进层级后冗余)
|
||||
let text = (tmp.textContent || '').replace(/^\s*@\S+?\s*,\s*/, '').trim().replace(/\s+/g, ' ').slice(0, 60);
|
||||
const replyTag = indent ? '<span class="wl-reply-tag">↳ 回复 ' + esc(nickOf(c.pid)) + '</span>' : '';
|
||||
const link = c.url || c.path || '';
|
||||
const link = urlOf(c);
|
||||
return '<li class="wl-recent-item' + (indent ? ' wl-recent-child' : '') + '">'
|
||||
+ replyTag
|
||||
+ '<a href="' + link + '">' + esc(c.nick || '匿名') + '</a>:' + esc(text)
|
||||
+ '<a href="' + esc(link) + '">' + esc(c.nick || '匿名') + '</a>:' + esc(text)
|
||||
+ '</li>';
|
||||
};
|
||||
// 子评论紧跟在父评论后面输出(保持数据原有时间序)
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
</head><body itemscope itemtype="http://schema.org/WebPage"><div id="loading"><div class="cat"><div class="body"></div><div class="head"><div class="face"></div></div><div class="foot"><div class="tummy-end"></div><div class="bottom"></div><div class="legs left"></div><div class="legs right"></div></div><div class="paw"><div class="hands left"></div><div class="hands right"></div></div></div></div><div id="container"><header id="header" itemscope itemtype="http://schema.org/WPHeader"><div class="inner"><div id="brand"><div class="pjax"><h1 itemprop="name headline">分类于"服务"的文章</h1></div></div><nav id="nav"><div class="inner"><div class="toggle"><div class="lines" aria-label="切换导航栏"><span class="line"></span> <span class="line"></span> <span class="line"></span></div></div><ul class="menu"><li class="item title"><a href="/" rel="start">☆∵∴Hito∴∵★</a></li></ul><ul class="right"><li class="item theme"><i class="ic i-sun"></i></li><li class="item search"><i class="ic i-search"></i></li></ul></div></nav></div><div id="imgs" class="pjax"><ul><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?627388"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?461887"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?447870"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?237656"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?217788"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?518742"></li></ul></div></header><div id="waves"><svg class="waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto"><defs><path id="gentle-wave" d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z"/></defs><g class="parallax"><use xlink:href="#gentle-wave" x="48" y="0"/><use xlink:href="#gentle-wave" x="48" y="3"/><use xlink:href="#gentle-wave" x="48" y="5"/><use xlink:href="#gentle-wave" x="48" y="7"/></g></svg></div><main><div class="inner"><div id="main" class="pjax"><div class="collapse wrap"><h2 class="item header"><a href="/categories">全部</a> <small>/</small> <a href="/categories/Linux/">Linux</a> <small>/</small> 服务 <small>分类</small></h2><h3 class="item section"><a href="/categories/Linux/%E6%9C%8D%E5%8A%A1/Nginx/">Nginx</a> <small>( 8 )</small></h3><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-11-30T17:05:00+08:00" content="2022-11-30">11-30</time></div><div class="title"><a href="/2022/11/30/%E5%B0%86nginx%E6%9B%BF%E6%8D%A2%E4%B8%BAtengine/" itemprop="url"><span itemprop="name">将nginx替换为tengine</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-11-30T16:35:00+08:00" content="2022-11-30">11-30</time></div><div class="title"><a href="/2022/11/30/Nginx%E5%8A%A8%E6%80%81%E8%A7%A3%E6%9E%90%E5%9F%9F%E5%90%8D%E6%96%B9%E6%A1%88/" itemprop="url"><span itemprop="name">Nginx动态解析域名方案</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-11-30T16:09:00+08:00" content="2022-11-30">11-30</time></div><div class="title"><a href="/2022/11/30/Nginx%E9%85%8D%E7%BD%AEstream%E8%B8%A9%E5%9D%91/" itemprop="url"><span itemprop="name">Nginx配置stream踩坑</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-11-08T10:05:00+08:00" content="2022-11-08">11-08</time></div><div class="title"><a href="/2022/11/08/Nginx%E9%85%8D%E7%BD%AE-%E5%8F%8D%E5%90%91%E4%BB%A3%E7%90%86/" itemprop="url"><span itemprop="name">Nginx配置-反向代理</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-10-18T09:39:00+08:00" content="2022-10-18">10-18</time></div><div class="title"><a href="/2022/10/18/%E6%90%AD%E5%BB%BAnagios%E7%9B%91%E6%8E%A7/" itemprop="url"><span itemprop="name">搭建nagios监控</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-10-17T14:07:00+08:00" content="2022-10-17">10-17</time></div><div class="title"><a href="/2022/10/17/redis%E4%B8%BB%E4%BB%8E%E5%9F%BA%E7%A1%80%E9%85%8D%E7%BD%AE%E8%AE%B0%E5%BD%95/" itemprop="url"><span itemprop="name">redis主从基础配置</span></a></div></artLine truncated
|
||||
</head><body itemscope itemtype="http://schema.org/WebPage"><div id="loading"><div class="cat"><div class="body"></div><div class="head"><div class="face"></div></div><div class="foot"><div class="tummy-end"></div><div class="bottom"></div><div class="legs left"></div><div class="legs right"></div></div><div class="paw"><div class="hands left"></div><div class="hands right"></div></div></div></div><div id="container"><header id="header" itemscope itemtype="http://schema.org/WPHeader"><div class="inner"><div id="brand"><div class="pjax"><h1 itemprop="name headline">分类于"服务"的文章</h1></div></div><nav id="nav"><div class="inner"><div class="toggle"><div class="lines" aria-label="切换导航栏"><span class="line"></span> <span class="line"></span> <span class="line"></span></div></div><ul class="menu"><li class="item title"><a href="/" rel="start">☆∵∴Hito∴∵★</a></li></ul><ul class="right"><li class="item theme"><i class="ic i-sun"></i></li><li class="item search"><i class="ic i-search"></i></li></ul></div></nav></div><div id="imgs" class="pjax"><ul><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?364238"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?959622"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?160649"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?345103"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?67629"></li><li class="item" data-background-image="https://ndis.hitoli.com:8443/nas-dispatcher/common/downloadImg?682158"></li></ul></div></header><div id="waves"><svg class="waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto"><defs><path id="gentle-wave" d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z"/></defs><g class="parallax"><use xlink:href="#gentle-wave" x="48" y="0"/><use xlink:href="#gentle-wave" x="48" y="3"/><use xlink:href="#gentle-wave" x="48" y="5"/><use xlink:href="#gentle-wave" x="48" y="7"/></g></svg></div><main><div class="inner"><div id="main" class="pjax"><div class="collapse wrap"><h2 class="item header"><a href="/categories">全部</a> <small>/</small> <a href="/categories/Linux/">Linux</a> <small>/</small> 服务 <small>分类</small></h2><h3 class="item section"><a href="/categories/Linux/%E6%9C%8D%E5%8A%A1/Nginx/">Nginx</a> <small>( 8 )</small></h3><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-11-30T17:05:00+08:00" content="2022-11-30">11-30</time></div><div class="title"><a href="/2022/11/30/%E5%B0%86nginx%E6%9B%BF%E6%8D%A2%E4%B8%BAtengine/" itemprop="url"><span itemprop="name">将nginx替换为tengine</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-11-30T16:35:00+08:00" content="2022-11-30">11-30</time></div><div class="title"><a href="/2022/11/30/Nginx%E5%8A%A8%E6%80%81%E8%A7%A3%E6%9E%90%E5%9F%9F%E5%90%8D%E6%96%B9%E6%A1%88/" itemprop="url"><span itemprop="name">Nginx动态解析域名方案</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-11-30T16:09:00+08:00" content="2022-11-30">11-30</time></div><div class="title"><a href="/2022/11/30/Nginx%E9%85%8D%E7%BD%AEstream%E8%B8%A9%E5%9D%91/" itemprop="url"><span itemprop="name">Nginx配置stream踩坑</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-11-08T10:05:00+08:00" content="2022-11-08">11-08</time></div><div class="title"><a href="/2022/11/08/Nginx%E9%85%8D%E7%BD%AE-%E5%8F%8D%E5%90%91%E4%BB%A3%E7%90%86/" itemprop="url"><span itemprop="name">Nginx配置-反向代理</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-10-18T09:39:00+08:00" content="2022-10-18">10-18</time></div><div class="title"><a href="/2022/10/18/%E6%90%AD%E5%BB%BAnagios%E7%9B%91%E6%8E%A7/" itemprop="url"><span itemprop="name">搭建nagios监控</span></a></div></article><article class="item normal" itemscope itemtype="http://schema.org/Article"><div class="meta"><time itemprop="dateCreated" datetime="2022-10-17T14:07:00+08:00" content="2022-10-17">10-17</time></div><div class="title"><a href="/2022/10/17/redis%E4%B8%BB%E4%BB%8E%E5%9F%BA%E7%A1%80%E9%85%8D%E7%BD%AE%E8%AE%B0%E5%BD%95/" itemprop="url"><span itemprop="name">redis主从基础配置</span></a></div></artiLine truncated
|
||||
// 侧栏「最新评论」:挂在 footer 的 .leancloud-recent-comment 容器(PJAX 不替换 footer,全局渲染一次即可)
|
||||
// 动态 import 加载 ESM 版 waline.js;普通 <script src> 会报 export 语法错误
|
||||
(async () => {
|
||||
@@ -98,7 +98,7 @@
|
||||
const el = document.querySelector('.leancloud-recent-comment');
|
||||
if (!el) return;
|
||||
const opts = (typeof AbortSignal !== 'undefined' && AbortSignal.timeout) ? { signal: AbortSignal.timeout(15000) } : {};
|
||||
fetch('https://comment.hitoli.com:8443/api/comment?type=recent&count=8&lang=zh-CN', opts)
|
||||
fetch('https://comment.hitoli.com:8443/api/comment?type=recent&count=20&lang=zh-CN', opts)
|
||||
.then(r => { if (!r.ok) throw new Error('HTTP ' + r.status); return r.json(); })
|
||||
.then(res => {
|
||||
const list = (res && res.data) || [];
|
||||
@@ -107,6 +107,17 @@
|
||||
const byId = {};
|
||||
list.forEach(c => { byId[c.objectId] = c; });
|
||||
const nickOf = (id) => (byId[id] && byId[id].nick) || '';
|
||||
// 点击跳转地址:优先自己的 url;为空则沿 pid 链向上找祖先的 url(老数据回复的 url 可能缺失);再兜底首页
|
||||
const urlOf = (c) => {
|
||||
let cur = c, seen = {};
|
||||
while (cur) {
|
||||
if (cur.url) return cur.url;
|
||||
if (seen[cur.objectId]) break; // 防环
|
||||
seen[cur.objectId] = true;
|
||||
cur = cur.pid ? byId[cur.pid] : null;
|
||||
}
|
||||
return '/';
|
||||
};
|
||||
const esc = (s) => String(s || '').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
||||
const itemHtml = (c, indent) => {
|
||||
const tmp = document.createElement('div');
|
||||
@@ -114,10 +125,10 @@
|
||||
// 去掉服务端已加的 "@昵称 ," 前缀(渲染成缩进层级后冗余)
|
||||
let text = (tmp.textContent || '').replace(/^\s*@\S+?\s*,\s*/, '').trim().replace(/\s+/g, ' ').slice(0, 60);
|
||||
const replyTag = indent ? '<span class="wl-reply-tag">↳ 回复 ' + esc(nickOf(c.pid)) + '</span>' : '';
|
||||
const link = c.url || c.path || '';
|
||||
const link = urlOf(c);
|
||||
return '<li class="wl-recent-item' + (indent ? ' wl-recent-child' : '') + '">'
|
||||
+ replyTag
|
||||
+ '<a href="' + link + '">' + esc(c.nick || '匿名') + '</a>:' + esc(text)
|
||||
+ '<a href="' + esc(link) + '">' + esc(c.nick || '匿名') + '</a>:' + esc(text)
|
||||
+ '</li>';
|
||||
};
|
||||
// 子评论紧跟在父评论后面输出(保持数据原有时间序)
|
||||
|
||||
Reference in new issue
Block a user