fix: change website title
This commit is contained in:
@@ -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
45
scripts/push-sitemap.js
Normal 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();
|
||||
Reference in New Issue
Block a user