mirror of
https://github.com/Ad-closeNN/blog-fuwari.git
synced 2026-05-31 02:00:05 -04:00
style(config): 在 Profile 页加入了提交信息
2. typo(pages): new-domain.md 多拼写了双引号
This commit is contained in:
Vendored
+3
@@ -24,5 +24,8 @@
|
|||||||
},
|
},
|
||||||
"[html]": {
|
"[html]": {
|
||||||
"editor.defaultFormatter": "vscode.html-language-features"
|
"editor.defaultFormatter": "vscode.html-language-features"
|
||||||
|
},
|
||||||
|
"[json]": {
|
||||||
|
"editor.defaultFormatter": "vscode.json-language-features"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { url } from "../../utils/url-utils";
|
|||||||
import ImageWrapper from "../misc/ImageWrapper.astro";
|
import ImageWrapper from "../misc/ImageWrapper.astro";
|
||||||
|
|
||||||
const config = profileConfig;
|
const config = profileConfig;
|
||||||
|
|
||||||
const isSunday = new Date().getDay() === 0;
|
const isSunday = new Date().getDay() === 0;
|
||||||
---
|
---
|
||||||
<div class="card-base p-3">
|
<div class="card-base p-3">
|
||||||
@@ -29,7 +28,18 @@ const isSunday = new Date().getDay() === 0;
|
|||||||
<div class="px-2">
|
<div class="px-2">
|
||||||
<div class="font-bold text-xl text-center mb-1 dark:text-neutral-50 transition">{config.name}</div>
|
<div class="font-bold text-xl text-center mb-1 dark:text-neutral-50 transition">{config.name}</div>
|
||||||
<div class="h-1 w-5 bg-[var(--primary)] mx-auto rounded-full mb-2 transition"></div>
|
<div class="h-1 w-5 bg-[var(--primary)] mx-auto rounded-full mb-2 transition"></div>
|
||||||
|
|
||||||
|
<!-- bio: 名言部分 -->
|
||||||
|
<!-- 星期日 -->
|
||||||
|
{ isSunday &&
|
||||||
|
<div class="text-center text-neutral-400 mb-2.5 transition">调整你的步伐,跟着节拍摇摆,举起双手拥抱你想成为的人</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
<!-- 其他日 -->
|
||||||
|
{ !isSunday &&
|
||||||
<div class="text-center text-neutral-400 mb-2.5 transition">{config.bio}</div>
|
<div class="text-center text-neutral-400 mb-2.5 transition">{config.bio}</div>
|
||||||
|
}
|
||||||
|
|
||||||
<div class="flex gap-2 justify-center mb-1">
|
<div class="flex gap-2 justify-center mb-1">
|
||||||
{config.links.length > 1 && config.links.map(item =>
|
{config.links.length > 1 && config.links.map(item =>
|
||||||
<a rel="me" aria-label={item.name} href={item.url} target="_blank" class="btn-regular rounded-lg h-10 w-10 active:scale-90">
|
<a rel="me" aria-label={item.name} href={item.url} target="_blank" class="btn-regular rounded-lg h-10 w-10 active:scale-90">
|
||||||
@@ -51,13 +61,23 @@ const isSunday = new Date().getDay() === 0;
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 最新 Commit 提交信息 -->
|
||||||
|
<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 class="flex items-center justify-center gap-1">
|
||||||
|
<Icon name="ic:baseline-commit" class="text-base"></Icon>
|
||||||
|
<span><a id="github-commit-link" href="#" target="_blank">
|
||||||
|
<span id="github-commit">加载中...</span></a></span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 星期日 -->
|
<!-- 星期日 -->
|
||||||
{isSunday &&
|
{ isSunday &&
|
||||||
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=250 height=86 src="//music.163.com/outchain/player?type=2&id=2155423467&auto=0&height=66"></iframe>
|
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=250 height=86 src="//music.163.com/outchain/player?type=2&id=2155423467&auto=0&height=66"></iframe>
|
||||||
}
|
}
|
||||||
|
|
||||||
<!-- 其他日 -->
|
<!-- 其他日 -->
|
||||||
{!isSunday &&
|
{ !isSunday &&
|
||||||
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=250 height=86 src="//music.163.com/outchain/player?type=2&id=2608813264&auto=0&height=66"></iframe>
|
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=250 height=86 src="//music.163.com/outchain/player?type=2&id=2608813264&auto=0&height=66"></iframe>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
@@ -77,7 +97,7 @@ fetch("https://v1.hitokoto.cn")
|
|||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.error("获取一言失败:", error);
|
console.error("获取一言失败:", error);
|
||||||
//document.getElementById("hitokoto").innerText = "获取失败,请稍后再试。";
|
//document.getElementById("hitokoto").innerText = "获取失败,请稍后再试。";
|
||||||
//失败后用内置的,成功了用别人的。不过,这真的可能用失败吗?
|
//失败后用内置的,成功了用别人的。
|
||||||
document.getElementById("hitokoto").innerText = "再热情的心也经不起冷漠,再爱你的人也经不起冷落。";
|
document.getElementById("hitokoto").innerText = "再热情的心也经不起冷漠,再爱你的人也经不起冷落。";
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@@ -131,4 +151,60 @@ fetch("https://v1.hitokoto.cn")
|
|||||||
|
|
||||||
// 页面加载完成后获取统计数据
|
// 页面加载完成后获取统计数据
|
||||||
document.addEventListener('DOMContentLoaded', loadSiteStats);
|
document.addEventListener('DOMContentLoaded', loadSiteStats);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- 获取 Commit 信息 via API -->
|
||||||
|
<script>
|
||||||
|
async function loadCommitStats() {
|
||||||
|
try {
|
||||||
|
// 第零步:检查域名(甚至本地)
|
||||||
|
const statsElement = document.getElementById('github-commit'); // 查找 id
|
||||||
|
const link = document.getElementById('github-commit-link'); // 查找 id
|
||||||
|
|
||||||
|
if (!window.location.hostname.includes('localhost') && !window.location.hostname.includes('adclosenn.top')) {
|
||||||
|
statsElement.textContent = 'Err. invalid domain name';
|
||||||
|
}
|
||||||
|
// 第一步:调用 API
|
||||||
|
const githubResponse = await fetch(`https://api.adclosenn.top/.netlify/functions/commit`);
|
||||||
|
|
||||||
|
if (!githubResponse.ok) {
|
||||||
|
throw new Error('获取信息失败');
|
||||||
|
}
|
||||||
|
|
||||||
|
const Data = await githubResponse.json();
|
||||||
|
|
||||||
|
// 第二步:获取 Commit 数据
|
||||||
|
const latestCommit = Data
|
||||||
|
|
||||||
|
const commitData = {
|
||||||
|
hash: latestCommit.sha.slice(0, 7),
|
||||||
|
fullHash: latestCommit.sha,
|
||||||
|
message: latestCommit.commit.message.split('\n')[0],
|
||||||
|
author: latestCommit.commit.author.name,
|
||||||
|
date: latestCommit.commit.author.date,
|
||||||
|
url: latestCommit.html_url
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
if (statsElement) {
|
||||||
|
statsElement.textContent = `当前提交:${Data.sha.slice(0,7)}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (link){
|
||||||
|
const gurl = "https://github.com/Ad-closeNN/blog-fuwari/commit/"+Data.sha;
|
||||||
|
link.href = gurl;
|
||||||
|
link.title = "("+Data.commit.committer.date + ")" + " " + Data.commit.message;
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取 Commit 信息失败:', error);
|
||||||
|
const statsElement = document.getElementById('github-commit');
|
||||||
|
if (statsElement) {
|
||||||
|
statsElement.textContent = '提交信息不可用';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 页面加载完成后获取 Commit 数据
|
||||||
|
document.addEventListener('DOMContentLoaded', loadCommitStats);
|
||||||
</script>
|
</script>
|
||||||
@@ -17,7 +17,6 @@ customcover: ../assets/images/cloudflare-turnstile-verify-error.png
|
|||||||
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js?onload=onloadTurnstileCallback" defer async></script>
|
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js?onload=onloadTurnstileCallback" defer async></script>
|
||||||
<!-- hCaptcha -->
|
<!-- hCaptcha -->
|
||||||
<script src="https://hcaptcha.com/1/api.js?recaptchacompat=off&hl=zh" async defer></script>
|
<script src="https://hcaptcha.com/1/api.js?recaptchacompat=off&hl=zh" async defer></script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
你好~
|
你好~
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ draft: false
|
|||||||
---
|
---
|
||||||
|
|
||||||
# .xyz 域名
|
# .xyz 域名
|
||||||
:::warning["注意"]
|
:::warning[注意]
|
||||||
如无特殊指代,阿里云指[阿里云(国内站)](https://wanwang.aliyun.com/domain)。
|
如无特殊指代,阿里云指[阿里云(国内站)](https://wanwang.aliyun.com/domain)。
|
||||||
:::
|
:::
|
||||||
之前在[*里云](https://wanwang.aliyun.com/domain)买了个8位纯数字的 `.xyz` 域名,现在买了 `.top` 后觉得特亏。一是在阿里云里面买任何域名都需要实名认证(14+),还得填一些实际身份的信息,我了个去,填完这些信息都够我在 Spaceship 买两次域名了,真是够麻烦的。。。
|
之前在[阿里云](https://wanwang.aliyun.com/domain)买了个8位纯数字的 `.xyz` 域名,现在买了 `.top` 后觉得特亏。一是在阿里云里面买任何域名都需要实名认证(14+),还得填一些实际身份的信息,我了个去,填完这些信息都够我在 Spaceship 买两次域名了,真是够麻烦的。。。
|
||||||
|
|
||||||
# .top 域名
|
# .top 域名
|
||||||
买域名后直接开始搭博客,真香~如果不出意外的话,这个域名将会一直用下去。~~毕竟`.top`确实便宜~~
|
买域名后直接开始搭博客,真香~如果不出意外的话,这个域名将会一直用下去。~~毕竟`.top`确实便宜~~
|
||||||
|
|||||||
Reference in New Issue
Block a user