fix: change website title

This commit is contained in:
zyronon
2025-08-22 22:11:23 +08:00
parent 361d6e645c
commit 1b3d3090a0
2 changed files with 46 additions and 1 deletions

View File

@@ -4,7 +4,7 @@
<meta charset="UTF-8"/>
<link rel="icon" type="image/svg+xml" href="/favicon.png"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Type Words - 英语打字练习平台 | 单词跟打 · 文章跟打</title>
<title>Type Words - 词文记 | 单词跟打 · 文章跟打</title>
<!-- 搜索引擎描述 -->
<meta name="description"
content="Type Words在线英语练习平台支持单词、文章跟打练习提升打字与语言能力。Practice English, one keystroke at a time.">

45
scripts/push-sitemap.js Normal file
View File

@@ -0,0 +1,45 @@
const fs = require("fs");
const bookList = require('../src/assets/book-list.json')
const dictList = require('../src/assets/dict-list.json')
async function pushUrls() {
// 配置区:改成你的
const site = "https://2study.top"; // 必须和百度站长平台注册的域名一致
const token = ""; // 在百度站长平台获取
// 读取 urls.txt每行一个 URL
let urls = bookList.flat().map(book => {
return site + '/practice-articles/' + book.id
}).concat(dictList.flat().map(book => {
return site + '/practice-words/' + book.id
})).concat([
site + '/words',
site + '/articles',
site + '/setting',
]).slice(7, 17)
if (urls.length === 0) {
console.error("❌ urls.txt 里没有 URL");
return;
}
console.log(`📄 读取到 ${urls.length} 个 URL准备推送到百度...`);
const api = `http://data.zz.baidu.com/urls?site=${site}&token=${token}`;
const body = urls.join("\n");
try {
const res = await fetch(api, {
method: "POST",
headers: {"Content-Type": "text/plain"},
body
});
const data = await res.json();
console.log("✅ 百度返回:", data);
} catch (err) {
console.error("❌ 推送失败:", err);
}
}
pushUrls();