mirror of
https://github.com/Ad-closeNN/blog-fuwari.git
synced 2026-05-31 02:20:05 -04:00
docs(telegram 能直连了?)
This commit is contained in:
@@ -7,6 +7,12 @@ import ImageWrapper from "../misc/ImageWrapper.astro";
|
||||
const config = profileConfig;
|
||||
---
|
||||
<div class="card-base p-3">
|
||||
<div class="text-center text-sm text-neutral-500 dark:text-neutral-400 border-neutral-100 dark:border-neutral-700">一言 / hitokoto</div>
|
||||
<div class="text-center text-sm text-neutral-500 dark:text-neutral-400 border-neutral-100 dark:border-neutral-700">
|
||||
<p id="hitokoto">正在加载一言...</p>
|
||||
</div>
|
||||
<div class="text-center text-sm text-neutral-500 dark:text-neutral-400 mt-3 pt-3 border-t border-neutral-200 dark:border-neutral-700">
|
||||
</div>
|
||||
<a aria-label="Go to About Page" href={url('/about/')}
|
||||
class="group block relative mx-auto mt-1 lg:mx-0 lg:mt-0 mb-3
|
||||
max-w-[12rem] lg:max-w-none overflow-hidden rounded-xl active:scale-95">
|
||||
@@ -46,6 +52,20 @@ const config = profileConfig;
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// 调用一言 API
|
||||
fetch("https://api.xinac.net/words")
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
// API 返回的字段是 data.text
|
||||
document.getElementById("hitokoto").innerText = data.text;
|
||||
})
|
||||
.catch(error => {
|
||||
console.error("获取一言失败:", error);
|
||||
document.getElementById("hitokoto").innerText = "获取失败,请稍后再试。";
|
||||
});
|
||||
</script>
|
||||
|
||||
<script define:vars={{ umamiConfig }}>
|
||||
// 获取全站访问量统计
|
||||
async function loadSiteStats() {
|
||||
|
||||
Reference in New Issue
Block a user