Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions _includes/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ <h3 class="footer-heading">联系</h3>
<p>&copy; {{ site.time | date: "%Y" }} {{ site.title }} · 借助 Jekyll 与开源主题生态构建</p>
</div>
</footer>
<script src="{{ "/assets/js/visit-tracker.js" | relative_url }}" defer></script>
<script>
(function () {
var storageKey = 'pref-theme';
Expand Down
4 changes: 4 additions & 0 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ <h2>写作信息</h2>
<dt>阅读预估</dt>
<dd>约 {{ minutes }} 分钟 · {{ words }} 字</dd>
</div>
<div>
<dt>本地访问次数</dt>
<dd id="page-view-count" data-page-url="{{ page.url | relative_url }}">加载中…</dd>
</div>
</dl>
</div>
<div class="post-aside-card">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: 欢迎来到 Kaermaxc 博客
date: 2024-01-01 10:00:00 +0800
date: 2025-01-01 10:00:00 +0800
tags: [Jekyll, 教程]
excerpt: "从零开始搭建 GitHub Pages 博客的完整流程,以及我为本站打造的 Aurora 夜空主题设计思路。"
---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: 永磁同步电机控制与性能评估实战
date: 2024-04-15 09:30:00 +0800
date: 2025-04-15 09:30:00 +0800
tags: [电机控制, 控制理论, STM32]
excerpt: "从性能指标、参数辨识、FOC 实现到 PI 整定与排错的完整闭环;附 STM32 实操清单、调参流程与示例数据表。"
layout: post
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: 打造高效 Neovim C/C++ 开发环境:从零到一的完整指南
date: 2024-10-17 10:00:00 +0800
date: 2025-10-17 10:00:00 +0800
tags: [Neovim, C++, 开发环境, LSP]
excerpt: "用 clangd + Treesitter 打造 IDE 级体验,覆盖补全/诊断/调试/格式化/构建;修正 GDB/Lldb 适配,提供 Windows 与 CMake 指南。"
layout: post
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: post
title: "谐波减速机学习总结"
date: 2024-10-30 00:00:00 +0800
date: 2025-10-27 00:00:00 +0800
categories: 技术
tags: [谐波减速机, 传动, 机械设计]
excerpt: 汇总谐波减速机的工作原理、性能特性、关键计数参数与选型应用要点,便于快速查阅与工程实践。
Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of '计数' to '计算' (the excerpt should read '关键计算参数' meaning 'key calculation parameters' rather than '关键计数参数' which means 'key counting parameters').

Suggested change
excerpt: 汇总谐波减速机的工作原理、性能特性、关键计数参数与选型应用要点,便于快速查阅与工程实践。
excerpt: 汇总谐波减速机的工作原理、性能特性、关键计算参数与选型应用要点,便于快速查阅与工程实践。

Copilot uses AI. Check for mistakes.
Expand Down
52 changes: 52 additions & 0 deletions assets/js/visit-tracker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
(function () {
'use strict';

var viewElement = document.getElementById('page-view-count');
if (!viewElement) {
return;
}

if (!('localStorage' in window)) {
viewElement.textContent = '暂不可用(浏览器不支持本地存储)';
return;
}

var storageKey = 'kaermaxc-visit-counts';
var pageId = viewElement.getAttribute('data-page-url') || window.location.pathname;

function readCounts() {
try {
var raw = localStorage.getItem(storageKey);
if (!raw) {
return {};
}
var parsed = JSON.parse(raw);
if (typeof parsed === 'object' && parsed) {
Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The null check parsed is redundant after checking typeof parsed === 'object' since typeof null === 'object' evaluates to true. The order should be reversed: check truthiness first, then type. Change to if (parsed && typeof parsed === 'object') to avoid potential null issues.

Suggested change
if (typeof parsed === 'object' && parsed) {
if (parsed && typeof parsed === 'object') {

Copilot uses AI. Check for mistakes.
return parsed;
}
} catch (error) {
console.warn('无法从本地存储读取访问数据', error);
}
return {};
}

function writeCounts(counts) {
try {
localStorage.setItem(storageKey, JSON.stringify(counts));
return true;
} catch (error) {
console.warn('无法将访问数据写入本地存储', error);
return false;
}
}

var counts = readCounts();
var current = counts[pageId] || 0;
current += 1;
counts[pageId] = current;
if (writeCounts(counts)) {
viewElement.textContent = current + ' 次(仅记录本设备)';
} else {
viewElement.textContent = '暂不可用(浏览器禁用了本地存储)';
}
})();