fixed 维护一下项目结构
This commit is contained in:
1 parent
c7acf03b4a
commit
6ad43b2c08
87 files changed
+6864
-11017
No files matched your search
@@ -1,8 +0,0 @@
|
||||
{{ define "main" }}
|
||||
<div id="pjax-container">
|
||||
<div class="post-content" itemprop="articleBody" uk-scrollspy="target: > .cf-friends; cls: uk-animation-scale-up; delay: 150">
|
||||
{{ partial "link_items.html" . }}
|
||||
<div style="clear:both;"></div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
@@ -1,30 +0,0 @@
|
||||
{{ define "main" }}
|
||||
<div id="pjax-container">
|
||||
<div class="post-content" itemprop="articleBody">
|
||||
<div id="links-container" class="items" uk-scrollspy="target: > .item-box; cls: uk-animation-slide-bottom-small; delay: 100">
|
||||
<!-- 静态生成的内容作为 SEO 兜底或构建时数据 -->
|
||||
{{ range site.Data.links.blogs }}
|
||||
<div class="item-box">
|
||||
<div class="website-img">
|
||||
<img src="https://s0.wp.com/mshots/v1/{{ .url }}?w=800&h=600" alt="{{ .name }}">
|
||||
</div>
|
||||
<div class="link-info">
|
||||
<div class="link-avatar">
|
||||
<img src="{{ .image }}" alt="{{ .name }}">
|
||||
</div>
|
||||
<div class="link-des">
|
||||
<div class="link-name">{{ .name }}</div>
|
||||
<div class="link-des" style="color: #64748B;">{{ .description }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<a href="{{ .url }}">
|
||||
<div class="website-go-button">逛一逛</div>
|
||||
</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
<div style="clear:both;"></div>
|
||||
</div>
|
||||
<!-- 移除动态加载脚本,仅保留静态生成内容 -->
|
||||
</div>
|
||||
{{ end }}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -47,19 +47,19 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ $iconfont := resources.Get "js/iconfont.js" }}
|
||||
{{ $lightgallery := resources.Get "js/lightgallery.umd.min.js" }}
|
||||
{{ $uikit := resources.Get "js/uikit.min.js" }}
|
||||
{{ $iconfont := resources.Get "js/libs/iconfont.js" }}
|
||||
{{ $lightgallery := resources.Get "js/libs/lightgallery.umd.min.js" }}
|
||||
{{ $uikit := resources.Get "js/libs/uikit.min.js" }}
|
||||
{{ $easylazyload := resources.Get "js/modules/lazyload.js" }}
|
||||
{{ $viewimage := resources.Get "js/view-image.min.js" }}
|
||||
{{ $artalk := resources.Get "js/Artalk.js" }}
|
||||
{{ $barrage := resources.Get "js/barrage.js" }}
|
||||
{{ $viewimage := resources.Get "js/libs/view-image.min.js" }}
|
||||
{{ $artalk := resources.Get "js/libs/Artalk.js" }}
|
||||
{{ $barrage := resources.Get "js/modules/barrage.js" }}
|
||||
{{ $main := resources.Get "js/main.js" }}
|
||||
{{ $mypjax := resources.Get "js/mypjax.js" }}
|
||||
{{ $nprogress := resources.Get "js/nprogress.js" }}
|
||||
{{ $message := resources.Get "js/message.min.js" }}
|
||||
{{ $echarts := resources.Get "js/echarts.min.js" }}
|
||||
{{ $tiaozhuan := resources.Get "js/tiaozhuan.js" }}
|
||||
{{ $mypjax := resources.Get "js/modules/mypjax.js" }}
|
||||
{{ $nprogress := resources.Get "js/libs/nprogress.js" }}
|
||||
{{ $message := resources.Get "js/libs/message.min.js" }}
|
||||
{{ $echarts := resources.Get "js/libs/echarts.min.js" }}
|
||||
{{ $tiaozhuan := resources.Get "js/modules/tiaozhuan.js" }}
|
||||
|
||||
{{/* Modules */}}
|
||||
{{ $utils := resources.Get "js/modules/utils.js" }}
|
||||
@@ -69,7 +69,7 @@
|
||||
{{ $paragraphComments := resources.Get "js/modules/paragraph-comments.js" }}
|
||||
{{ $infiniteScroll := resources.Get "js/modules/infinite-scroll.js" }}
|
||||
{{ $artalkModule := resources.Get "js/modules/artalk.js" }}
|
||||
{{ $pjaxLib := resources.Get "js/pjax.js" }}
|
||||
{{ $pjaxLib := resources.Get "js/libs/pjax.js" }}
|
||||
|
||||
{{ $scripts := slice $iconfont $lightgallery $uikit $easylazyload $viewimage $artalk $barrage $utils $loader $search $floatingTools $paragraphComments $infiniteScroll $artalkModule $nprogress $pjaxLib $main $mypjax $message $echarts $tiaozhuan | resources.Concat "js/bundle.js" | resources.Minify | resources.Fingerprint }}
|
||||
<script src="{{ $scripts.RelPermalink }}"></script>
|
||||
|
||||
@@ -92,12 +92,12 @@
|
||||
</script>
|
||||
|
||||
<!-- Stylesheets -->
|
||||
{{ $normalize := resources.Get "css/normalize.css" }}
|
||||
{{ $remixicon := resources.Get "css/remixicon.css" }}
|
||||
{{ $uikit := resources.Get "css/uikit.min.css" }}
|
||||
{{ $nprogress := resources.Get "css/nprogress.min.css" }}
|
||||
{{ $artalk := resources.Get "css/Artalk.css" }}
|
||||
{{ $message := resources.Get "css/message.min.css" }}
|
||||
{{ $normalize := resources.Get "css/libs/normalize.css" }}
|
||||
{{ $remixicon := resources.Get "css/libs/remixicon.css" }}
|
||||
{{ $uikit := resources.Get "css/libs/uikit.min.css" }}
|
||||
{{ $nprogress := resources.Get "css/libs/nprogress.min.css" }}
|
||||
{{ $artalk := resources.Get "css/libs/Artalk.css" }}
|
||||
{{ $message := resources.Get "css/libs/message.min.css" }}
|
||||
{{ $main := resources.Get "css/main.css" }}
|
||||
|
||||
{{ $style := slice $normalize $remixicon $uikit $nprogress $artalk $message $main | resources.Concat "css/style.css" | resources.Minify | resources.Fingerprint }}
|
||||
@@ -222,9 +222,6 @@
|
||||
|
||||
|
||||
<script src="/js/instantpage.min.js" type="module" defer></script>
|
||||
{{ if or (eq .Type "about") (eq .Type "post") }}
|
||||
<link rel="stylesheet" href="/css/mywaline.css" />
|
||||
{{ end }}
|
||||
<script>console.log("\n %c Amigo Theme %c https://usj.cc \n", "color: #fadfa3; background: #030307; padding:3px; font-size:12px;", "color: #ffffff;background: #16171a; padding: 3px; font-size: 12px;");</script>
|
||||
<meta name="template" content="Amigo" />
|
||||
</head>
|
||||
@@ -1,6 +0,0 @@
|
||||
{{ range .Site.Data.links.blogs }}
|
||||
<div class="archive-item links-item cf-friends">
|
||||
<img loading="lazy" class="archive-list-image avatar" src="{{ .image }}">
|
||||
<a target="_blank" href="{{ .url }}">{{ .name }}</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
@@ -1,200 +0,0 @@
|
||||
<style>
|
||||
.heatmap-scroll-wrapper {
|
||||
width: 100%;
|
||||
overflow-x: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
-ms-overflow-style: none;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
.heatmap-scroll-wrapper::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="heatmap-wrapper" class="heatmap-scroll-wrapper">
|
||||
<div id="heatmap" style="max-width: 800px; height: 160px; margin: 0 auto 0px auto; padding: 10px; border-radius: 10px; transition: all 0.3s ease; display: block !important; visibility: visible !important; min-width: 300px;"></div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function renderHeatmap() {
|
||||
if (!window.echarts) {
|
||||
console.warn("ECharts not loaded yet, retrying...");
|
||||
setTimeout(renderHeatmap, 500);
|
||||
return;
|
||||
}
|
||||
var chartDom = document.getElementById('heatmap');
|
||||
if (!chartDom) {
|
||||
console.warn("Heatmap DOM not found");
|
||||
return;
|
||||
}
|
||||
|
||||
// Dispose existing instance if any
|
||||
var existing = echarts.getInstanceByDom(chartDom);
|
||||
if (existing) {
|
||||
existing.dispose();
|
||||
}
|
||||
|
||||
var myChart = echarts.init(chartDom, null, { renderer: 'svg' });
|
||||
|
||||
// Check mobile state
|
||||
var isMobile = window.innerWidth < 768;
|
||||
|
||||
// Handle resize with debouncing and re-render for responsive range
|
||||
var resizeTimer;
|
||||
window.addEventListener('resize', function() {
|
||||
clearTimeout(resizeTimer);
|
||||
resizeTimer = setTimeout(function() {
|
||||
var newIsMobile = window.innerWidth < 768;
|
||||
if (newIsMobile !== isMobile) {
|
||||
// Re-render if switching between mobile/desktop to update range
|
||||
renderHeatmap();
|
||||
} else {
|
||||
myChart.resize();
|
||||
}
|
||||
}, 100);
|
||||
});
|
||||
|
||||
// Data Processing
|
||||
var dataMap = new Map();
|
||||
{{ range where .Site.RegularPages "Type" "post" }}
|
||||
var key = "{{ .Date.Format "2006-01-02" }}";
|
||||
var link = "{{ .RelPermalink }}";
|
||||
var title = "{{ .Title }}";
|
||||
var wordCount = {{ .WordCount }};
|
||||
|
||||
if (!dataMap.has(key)) {
|
||||
dataMap.set(key, []);
|
||||
}
|
||||
dataMap.get(key).push({link, title, wordCount});
|
||||
{{- end -}}
|
||||
|
||||
var data = [];
|
||||
for (const [key, value] of dataMap.entries()) {
|
||||
data.push([key, value.length]);
|
||||
}
|
||||
|
||||
// Date Range Logic
|
||||
var endDate = new Date();
|
||||
var startDate = new Date();
|
||||
|
||||
if (isMobile) {
|
||||
// Mobile: Show last 5 months to fit screen
|
||||
startDate.setMonth(startDate.getMonth() - 5);
|
||||
} else {
|
||||
// Desktop: Show last 12 months
|
||||
startDate.setFullYear(startDate.getFullYear() - 1);
|
||||
}
|
||||
|
||||
var startDateStr = echarts.format.formatTime('yyyy-MM-dd', startDate);
|
||||
var endDateStr = echarts.format.formatTime('yyyy-MM-dd', endDate);
|
||||
|
||||
// Theme Logic
|
||||
var isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||
|
||||
// Minimalist Monochrome Colors (Black/White/Gray)
|
||||
// Light: Light Gray -> Black
|
||||
var colorLight = ['#f0f0f0', '#d9d9d9', '#a6a6a6', '#737373', '#000000'];
|
||||
// Dark: Dark Gray -> White
|
||||
var colorDark = ['#1f1f1f', '#404040', '#737373', '#a6a6a6', '#ffffff'];
|
||||
|
||||
var rangeColors = isDark ? colorDark : colorLight;
|
||||
var calendarLabelColor = isDark ? '#a6a6a6' : '#737373';
|
||||
|
||||
var option = {
|
||||
tooltip: {
|
||||
padding: 10,
|
||||
backgroundColor: isDark ? '#2d2d2d' : '#ffffff',
|
||||
borderColor: isDark ? '#444' : '#eee',
|
||||
borderWidth: 1,
|
||||
textStyle: {
|
||||
color: isDark ? '#eee' : '#333',
|
||||
fontSize: 12
|
||||
},
|
||||
formatter: function (p) {
|
||||
const date = p.data[0];
|
||||
const posts = dataMap.get(date);
|
||||
if (!posts) return;
|
||||
|
||||
var content = `<div style="font-weight:bold; margin-bottom:5px;">${date}</div>`;
|
||||
content += `<div style="max-height:150px; overflow-y:auto;">`;
|
||||
for (const post of posts) {
|
||||
content += `<div style="margin-bottom:2px;">`;
|
||||
content += `<a href="${post.link}" target="_blank" style="color:${isDark ? '#fff' : '#000'}; text-decoration:none;">${post.title}</a>`;
|
||||
content += `</div>`;
|
||||
}
|
||||
content += `</div>`;
|
||||
return content;
|
||||
}
|
||||
},
|
||||
visualMap: {
|
||||
min: 0,
|
||||
max: 4,
|
||||
type: 'piecewise',
|
||||
orient: 'horizontal',
|
||||
left: 'center',
|
||||
top: 0,
|
||||
show: false,
|
||||
inRange: {
|
||||
color: rangeColors.slice(1)
|
||||
}
|
||||
},
|
||||
calendar: {
|
||||
top: 30,
|
||||
left: 'center',
|
||||
range: [startDateStr, endDateStr],
|
||||
cellSize: ['auto', 13],
|
||||
splitLine: { show: false },
|
||||
itemStyle: {
|
||||
color: isDark ? '#1f1f1f' : '#f0f0f0',
|
||||
borderWidth: 2,
|
||||
borderColor: isDark ? '#121212' : '#ffffff'
|
||||
},
|
||||
yearLabel: { show: false },
|
||||
monthLabel: {
|
||||
nameMap: 'CN',
|
||||
color: calendarLabelColor,
|
||||
fontSize: 12
|
||||
},
|
||||
dayLabel: {
|
||||
show: true,
|
||||
firstDay: 1,
|
||||
nameMap: ['日', '一', '二', '三', '四', '五', '六'],
|
||||
color: calendarLabelColor,
|
||||
fontSize: 10
|
||||
}
|
||||
},
|
||||
series: {
|
||||
type: 'heatmap',
|
||||
coordinateSystem: 'calendar',
|
||||
data: data,
|
||||
itemStyle: {
|
||||
borderRadius: 2
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
myChart.setOption(option);
|
||||
}
|
||||
|
||||
// Initial render
|
||||
if (window.echarts) {
|
||||
renderHeatmap();
|
||||
} else {
|
||||
// Retry a few times if script is still loading
|
||||
setTimeout(renderHeatmap, 500);
|
||||
setTimeout(renderHeatmap, 1500);
|
||||
setTimeout(renderHeatmap, 3000);
|
||||
}
|
||||
|
||||
// Re-render on theme change
|
||||
var observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.type == "attributes" && mutation.attributeName == "data-theme") {
|
||||
renderHeatmap();
|
||||
}
|
||||
});
|
||||
});
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true
|
||||
});
|
||||
</script>
|
||||
Reference in new issue
Block a user