增加详细卡片页
This commit is contained in:
parent
051908833f
commit
a50ee3e613
10
card/page/1/index.html
Normal file
10
card/page/1/index.html
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh-cn">
|
||||||
|
<head>
|
||||||
|
<title>http://localhost:1313/card/</title>
|
||||||
|
<link rel="canonical" href="http://localhost:1313/card/">
|
||||||
|
<meta name="robots" content="noindex">
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="refresh" content="0; url=http://localhost:1313/card/">
|
||||||
|
</head>
|
||||||
|
</html>
|
388
card/qimo---副本/index.html
Normal file
388
card/qimo---副本/index.html
Normal file
File diff suppressed because it is too large
Load Diff
5
card/qimo.html
Normal file
5
card/qimo.html
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{{ define "main" }}
|
||||||
|
|
||||||
|
hello!
|
||||||
|
|
||||||
|
{{ end }}
|
445
card/qimo/index.html
Normal file
445
card/qimo/index.html
Normal file
File diff suppressed because it is too large
Load Diff
445
card/xuanzeti/index.html
Normal file
445
card/xuanzeti/index.html
Normal file
File diff suppressed because it is too large
Load Diff
0
card/新建 文本文档.txt
Normal file
0
card/新建 文本文档.txt
Normal file
File diff suppressed because one or more lines are too long
14
index.xml
14
index.xml
@ -296,5 +296,19 @@ $$
|
|||||||
2017-2018学年试卷B 您的设备无法正常显示PDF文件。 点击此处下载。
|
2017-2018学年试卷B 您的设备无法正常显示PDF文件。 点击此处下载。
|
||||||
2016-2017学年试卷B 您的设备无法正常显示PDF文件。 点击此处下载。</description>
|
2016-2017学年试卷B 您的设备无法正常显示PDF文件。 点击此处下载。</description>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<title>期末真题合集</title>
|
||||||
|
<link>https://xn--xhq44jb2fzpc.com/card/qimo/</link>
|
||||||
|
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
|
||||||
|
<guid>https://xn--xhq44jb2fzpc.com/card/qimo/</guid>
|
||||||
|
<description></description>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<title>选择题题库合集</title>
|
||||||
|
<link>https://xn--xhq44jb2fzpc.com/card/xuanzeti/</link>
|
||||||
|
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
|
||||||
|
<guid>https://xn--xhq44jb2fzpc.com/card/xuanzeti/</guid>
|
||||||
|
<description></description>
|
||||||
|
</item>
|
||||||
</channel>
|
</channel>
|
||||||
</rss>
|
</rss>
|
||||||
|
42
js/cardlist.js
Normal file
42
js/cardlist.js
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
function createCardSection(containerId, keyword) {
|
||||||
|
fetch('/index.json')
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
// 筛选文章,排除掉 permalink 包含 /card/ 的内容
|
||||||
|
const filteredArticles = data.filter(article =>
|
||||||
|
(article.title.includes(keyword) || article.content.includes(keyword)) &&
|
||||||
|
!article.permalink.includes('/card/')
|
||||||
|
);
|
||||||
|
|
||||||
|
const articlesContainer = document.getElementById(containerId);
|
||||||
|
|
||||||
|
filteredArticles.forEach(article => {
|
||||||
|
const card = document.createElement('div');
|
||||||
|
card.className = 'card';
|
||||||
|
card.onclick = () => window.location.href = article.permalink;
|
||||||
|
|
||||||
|
const title = document.createElement('div');
|
||||||
|
title.className = 'card-title'; // 使用 card-title 避免类名冲突
|
||||||
|
title.textContent = article.title.length > 30
|
||||||
|
? article.title.slice(0, 27) + "..."
|
||||||
|
: article.title;
|
||||||
|
|
||||||
|
const summary = document.createElement('div');
|
||||||
|
summary.className = 'summary';
|
||||||
|
summary.textContent = article.summary.length > 60
|
||||||
|
? article.summary.slice(0, 57) + "..."
|
||||||
|
: article.summary;
|
||||||
|
|
||||||
|
card.appendChild(title);
|
||||||
|
card.appendChild(summary);
|
||||||
|
|
||||||
|
articlesContainer.appendChild(card);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 设置网格布局每行显示3个卡片
|
||||||
|
articlesContainer.style.display = 'grid';
|
||||||
|
articlesContainer.style.gridTemplateColumns = 'repeat(3, 1fr)';
|
||||||
|
articlesContainer.style.gap = '16px';
|
||||||
|
})
|
||||||
|
.catch(error => console.error('Error loading articles:', error));
|
||||||
|
}
|
@ -243,7 +243,7 @@ Edge或Chrome浏览器如果加载不出PDF预览,直接右键PDF区域选择
|
|||||||
<div class="card-section">
|
<div class="card-section">
|
||||||
<div class="section-header">
|
<div class="section-header">
|
||||||
<span class="section-title">期末真题合集</span>
|
<span class="section-title">期末真题合集</span>
|
||||||
<a href="/search/?searchquery=期末真题" class="view-more">查看更多</a>
|
<a href="/card/qimo" class="view-more">查看更多</a>
|
||||||
</div>
|
</div>
|
||||||
<div id="qmzt" class="card-container"></div>
|
<div id="qmzt" class="card-container"></div>
|
||||||
</div>
|
</div>
|
||||||
@ -251,7 +251,7 @@ Edge或Chrome浏览器如果加载不出PDF预览,直接右键PDF区域选择
|
|||||||
<div class="card-section">
|
<div class="card-section">
|
||||||
<div class="section-header">
|
<div class="section-header">
|
||||||
<span class="section-title">选择题题库合集</span>
|
<span class="section-title">选择题题库合集</span>
|
||||||
<a href="/search/?searchquery=选择题" class="view-more">查看更多</a>
|
<a href="/card/xuanzeti" class="view-more">查看更多</a>
|
||||||
</div>
|
</div>
|
||||||
<div id="xzttk" class="card-container"></div>
|
<div id="xzttk" class="card-container"></div>
|
||||||
</div>
|
</div>
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user