diff --git a/.gitignore b/.gitignore index dcac261..8f04025 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,8 @@ pnpm-debug.log* package-lock.json bun.lockb yarn.lock + +# My test files +duolingo.py +duolingo copy.py +test.py \ No newline at end of file diff --git a/public/assets/apache.jpg b/public/assets/apache.jpg new file mode 100644 index 0000000..bad06a1 Binary files /dev/null and b/public/assets/apache.jpg differ diff --git a/public/assets/apache_carbon.png b/public/assets/apache_carbon.png new file mode 100644 index 0000000..5704dbf Binary files /dev/null and b/public/assets/apache_carbon.png differ diff --git a/public/assets/apache_carbon.svg b/public/assets/apache_carbon.svg new file mode 100644 index 0000000..475eb48 --- /dev/null +++ b/public/assets/apache_carbon.svg @@ -0,0 +1,17 @@ +
\ No newline at end of file diff --git a/public/assets/carbon-config.json b/public/assets/carbon-config.json new file mode 100644 index 0000000..9f726a3 --- /dev/null +++ b/public/assets/carbon-config.json @@ -0,0 +1 @@ +{"paddingVertical":"56px","paddingHorizontal":"56px","backgroundImage":null,"backgroundImageSelection":null,"backgroundMode":"color","backgroundColor":"rgba(255,255,255,1)","dropShadow":true,"dropShadowOffsetY":"20px","dropShadowBlurRadius":"68px","theme":"zenburn","windowTheme":"none","language":"text","fontFamily":"Ubuntu Mono","fontSize":"18px","lineHeight":"200%","windowControls":true,"widthAdjustment":false,"lineNumbers":false,"firstLineNumber":1,"exportSize":"4x","watermark":false,"squaredImage":false,"hiddenCharacters":false,"name":"","width":"611"} \ No newline at end of file diff --git a/public/assets/old_apache_carbon.png b/public/assets/old_apache_carbon.png new file mode 100644 index 0000000..710f015 Binary files /dev/null and b/public/assets/old_apache_carbon.png differ diff --git a/src/components/widget/Profile.astro b/src/components/widget/Profile.astro index 307199d..69cf1b1 100644 --- a/src/components/widget/Profile.astro +++ b/src/components/widget/Profile.astro @@ -53,16 +53,21 @@ const config = profileConfig; diff --git a/src/config.ts b/src/config.ts index 01f7f23..4784d39 100644 --- a/src/config.ts +++ b/src/config.ts @@ -17,13 +17,13 @@ export const siteConfig: SiteConfig = { fixed: false, // Hide the theme color picker for visitors }, banner: { - enable: false, - src: "assets/images/demo-banner.png", // Relative to the /src directory. Relative to the /public directory if it starts with '/' + enable: true, + src: "/assets/apache_carbon.svg", // Relative to the /src directory. Relative to the /public directory if it starts with '/' position: "center", // Equivalent to object-position, only supports 'top', 'center', 'bottom'. 'center' by default credit: { enable: true, // Display the credit text of the banner image - text: "a", // Credit text to be displayed - url: "", // (Optional) URL link to the original artwork or artist's page + text: "Carbon", // Credit text to be displayed + url: "https://carbon.now.sh", // (Optional) URL link to the original artwork or artist's page }, }, background: { diff --git a/src/content/assets/images/github-change-visibility.png b/src/content/assets/images/github-change-visibility.png new file mode 100644 index 0000000..78a167a Binary files /dev/null and b/src/content/assets/images/github-change-visibility.png differ diff --git a/src/content/assets/images/github-leave-fork-network.png b/src/content/assets/images/github-leave-fork-network.png new file mode 100644 index 0000000..fcb87cf Binary files /dev/null and b/src/content/assets/images/github-leave-fork-network.png differ diff --git a/src/content/assets/images/pcl-gemini-mixed.png b/src/content/assets/images/pcl-gemini-mixed.png new file mode 100644 index 0000000..65a8880 Binary files /dev/null and b/src/content/assets/images/pcl-gemini-mixed.png differ diff --git a/src/content/assets/images/pcl-intelligence-home-page.png b/src/content/assets/images/pcl-intelligence-home-page.png new file mode 100644 index 0000000..18d4b7a Binary files /dev/null and b/src/content/assets/images/pcl-intelligence-home-page.png differ diff --git a/src/content/assets/images/pcl-settings-homepage-online.png b/src/content/assets/images/pcl-settings-homepage-online.png new file mode 100644 index 0000000..2206da7 Binary files /dev/null and b/src/content/assets/images/pcl-settings-homepage-online.png differ diff --git a/src/content/assets/images/vercel-pcl-intelligence-homepage-domains-panel.png b/src/content/assets/images/vercel-pcl-intelligence-homepage-domains-panel.png new file mode 100644 index 0000000..a5b82a0 Binary files /dev/null and b/src/content/assets/images/vercel-pcl-intelligence-homepage-domains-panel.png differ diff --git a/src/content/assets/images/vercel-redeploy.png b/src/content/assets/images/vercel-redeploy.png new file mode 100644 index 0000000..981ab9e Binary files /dev/null and b/src/content/assets/images/vercel-redeploy.png differ diff --git a/src/content/posts/new-domain.md b/src/content/posts/new-domain.md index 7ed6bc6..8c3a51c 100644 --- a/src/content/posts/new-domain.md +++ b/src/content/posts/new-domain.md @@ -10,7 +10,7 @@ draft: false # .xyz 域名 :::note -下面讲的都是[阿里云(国内站)](https://wanwang.aliyun.com/domain)。 +如无特殊指代,阿里云指[阿里云(国内站)](https://wanwang.aliyun.com/domain)。 ::: 之前在[*里云](https://wanwang.aliyun.com/domain)买了个8位纯数字的 `.xyz` 域名,现在买了 `.top` 后觉得特亏。一是在阿里云里面买任何域名都需要实名认证(14+),还得填一些实际身份的信息,我了个去,填完这些信息都够我在 Spaceship 买两次域名了,真是够麻烦的。。。 diff --git a/src/content/posts/pcl-intelligence-homepage.md b/src/content/posts/pcl-intelligence-homepage.md new file mode 100644 index 0000000..e632e1a --- /dev/null +++ b/src/content/posts/pcl-intelligence-homepage.md @@ -0,0 +1,118 @@ +--- +title: PCL Intelligence 主页说明书 +published: 2025-08-09 +tags: ["PCL"] +description: 在 PCL 启动器上面询问大模型?当然可以~ +image: ../assets/images/pcl-gemini-mixed.png +category: 教程 +draft: false +--- + + + + +# 前言 +:::CAUTION[警告] +- 本项目仅供学习交流,请在遵守当地法律法规的情况下使用。中国大陆用户请勿输入政治敏感等违法内容。 +- 项目仍在开发中,可能会出现不稳定的现象。 +::: + +截图: +![pcl-intelligence-home-page](../assets/images/pcl-intelligence-home-page.png) + +感谢 [@Light-Beacon/HomepageBuilder](https://github.com/Light-Beacon/HomepageBuilder) 的主页构建器,使得大模型输出的 Markdown 得以构建并输出为 XAML 文件。 + +::github{repo="Light-Beacon/HomepageBuilder"} + +# 需求 +- 一个 [Vercel](https://vercel.com/signup) 账号:用于部署主页后端。 +- [Google AI Studio API 密钥](https://aistudio.google.com/apikey)(香港地区不支持访问 Google AI Studio):用于请求模型。 + - 如需请求**单个 API Key**,**Gemini 2.5 Flash** 仅可**每天**调用 250 次;**Gemini 2.5 Pro** 仅可**每天**调用 100 次。 + - 如需请求**多个 API Key** 用于后续的 **[多 API Key 模式](#什么是多-api-key-模式)**,请从[https://console.cloud.google.com/projectcreate](https://console.cloud.google.com/projectcreate) 创建多个项目,后在 AI Studio 中创建 API Key。遇到问题请自行 Google。 +- 一个 [GitHub](https://github.com) 账号:用于 Fork 项目。 + +# 部署 +:::CAUTION[警告] +1. 目前仅对 Vercel 平台和 Gemini 模型进行适配,如需使用自己的服务器与其他模型,请自行修改对应文件。 +2. 请务必按照以下指示部署你的 PCL Intelligence 主页,不当的操作可能会导致你的 API Key 被**泄露**。 +3. 请关注 Vercel Usage 使用情况(位于 [Vercel 主菜单](https://vercel.com) 左侧),需重点关注 `Fluid Active CPU` 和 `Edge Requests` 使用量。不要用超了。更多 Usage Limit 请查看主菜单横条上的 `Usage` 选项。 +::: + +:::warning[注意] +现在有**两个**部署方式: +- 如果你需要使用 **[多 API Key 模式](#什么是多-api-key-模式)**,请看 **[#多 API Key 模式](#多-api-key-模式)** 。 +- (推荐轻度使用)如果你需要使用 **单 API Key 模式** *(一切请求只通过一个 Key 调用)* ,请看 **[#单 API Key 模式](#单-api-key-模式推荐轻度使用)** 。 + +简单点, +如果你是轻度**单人使用**,推荐使用 **[#单 API Key 模式](#单-api-key-模式推荐轻度使用)**。 +如果你是**重度**或**多人使用**,推荐使用 **[多 API Key 模式](#什么是多-api-key-模式)**,请看 **[#多 API Key 模式](#多-api-key-模式)**,但请注意不要用超 Vercel 限制。 +::: + +**这个是前置步骤**: +::github{repo="Ad-closeNN/PCL-Intelligence-Homepage"} +- 来到 GitHub 仓库 [@Ad-closeNN/PCL-Intelligence-Homepage](https://github.com/Ad-closeNN/PCL-Intelligence-Homepage) 或 [点此](https://github.com/Ad-closeNN/PCL-Intelligence-Homepage/fork) Fork 仓库。 + +## 多 API Key 模式 +1. 将 GitHub 仓库的可见性改为 **私密**: + 1. 在仓库顶端点击 **Settings**。 + 2. 滑至底部,点击 **Leave fork network** 按钮并确认操作。 ![Leave fork network](../assets/images/github-leave-fork-network.png) + 3. 等待10至30秒,使 Fork 后的仓库脱离 Fork 网络。 + 4. 刷新页面,待 **Danger Zone** 里的 **Change visibility** 按钮可用后,点击 **Change visibility** 按钮并确认操作。 ![Change visibility](../assets/images/github-change-visibility.png) +2. 更改 `config/api_key` 文件,删掉原有内容,把从 [Google AI Studio](#需求) 申请的 API Key 以 **一行一个 Key** 的格式填入。 +4. 使用 Vercel 部署:[Create New Project](https://vercel.com/new) + 需要填写相关变量: + - 填写获取 API Key 的方法: + - Env Name: `mode` + - Env Value: `local` + - 填写请求地址(在 PCL 主页需要通过**点击一个按钮**来向**你所部署的服务器**发送一个请求,所以这个 `请求地址` 需要填写部署好的链接): + - Env Name: `link` + - Env Value:域名或 IP 地址,**必须以 http 开头** + :::TIP[提示] + ### 如果不知道怎么填写 `link`,请按照下列指示操作: + 1. 先不填这个变量 `link`。但是上面 `mode` **需要填**,填完**直接部署**。 + 2. 部署完成后建议**绑定自定义域名**。也可以尝试做**Vercel 优选**(非必须)。 + 3. 来到 Vercel 项目的 **Settings**,在左侧菜单选择 **Environment Variables**。 + 4. `Key` 填入 `link`;`Value` 填入 **部署后的链接(优先选有绑定好的自定义域名)**(如`https:/url.pcl-community.org` 或 `https://pih.vercel.app`)**必须带上协议!** 如 `http://` 和 `https://`。 + 关于 `link` 能填什么,例如说,我在 **Domains** 内绑定了几个域名,只有以 `.vercel.app` 结尾的地址是 Vercel 给的,其他剩下的域名是自己的(不包括 `pclc.cc`),所以变量 `link` 就为**除 `vercel.app` 之外的域名**,如 **pclai.adclosenn.top**。如果你不在海外,就不要选带 `vercel.app` 的域名了。 ![vercel-pcl-intelligence-homepage-domains-panel](../assets/images/vercel-pcl-intelligence-homepage-domains-panel.png) + 5. 点击 `Save` 按钮,保存变量。 + 6. 点击右下角弹出的 `Redeploy` 按钮,重新部署 ![Redeploy](../assets/images/vercel-redeploy.png) + ::: +5. 部署完成后,就可以把链接填在 PCL 的**自定义主页-联网获取**了。**不要**填我的,要填你部署后用的链接。 ![pcl-settings-homepage-online](../assets/images/pcl-settings-homepage-online.png) + +## 单 API Key 模式(推荐轻度使用) +1. 使用 Vercel 部署:[Create New Project](https://vercel.com/new) + 需要填写相关变量: + - 填写 API Key: + - Env Name: `api_key` + - Env Value: `你的单个 API Key` + - 填写请求地址(在 PCL 主页需要通过**点击一个按钮**来向**你所部署的服务器**发送一个请求,所以这个 `请求地址` 需要填写部署好的链接): + - Env Name: `link` + - Env Value:域名或 IP 地址,**必须以 http 开头** + :::TIP[提示] + ### 如果不知道怎么填写 `link`,请返回查看 [#如果不知道怎么填写 `link` 请按照下列指示操作](#如果不知道怎么填写-link请按照下列指示操作),无需填写 `mode`! + ::: +2. 部署完成后,就可以把链接填在 PCL 的**自定义主页-联网获取**了。**不要**填我的,要填你部署后用的链接。 ![pcl-settings-homepage-online](../assets/images/pcl-settings-homepage-online.png) + +# 其他 + +:::TIP[提示] +如果你把 `api_key` 和 `mode` 都填了,其使用的顺序为 `mode`>`api_key`(也就是优先使用多个 API Key)。 +如果你什么都不填,或者 `mode` 填的不是 `local` 或 以`http`开头的链接,会报 **500 内部服务器错误**。 +::: + + +# 解答 +## 什么是“多 API Key 模式”? +[返回 #需求](#需求) | [返回 #部署](#部署) +Google Gemini API 有速率限制,详情可以查看这张图片,或直接去 [官网](https://ai.google.dev/gemini-api/docs/rate-limits) 查询: + +:::TIP[提示] +**Free Tier**:免费层级\ +**RPM**(**R**equests **P**er **M**inute):每分钟**请求数**\ +**TPM**(**T**oken **P**er **M**inute) :每分钟**输入数**(令牌数)\ +**RPD**(**R**equests **P**er **D**ay):每日**请求数** +::: + +![GOOGLE_API_Limit](https://i0.hdslb.com/bfs/new_dyn/c5ece227ed85f47003badc39d232a7293493090681686120.png) + +单 API Key 每天只能用 **Gemini 2.5 Flash** 250 次。而**每个** API Key 是**单独计算**请求数量的,所以当我们把多个 API Key 一起用的时候就可以请求 `250*n` 次(取决于模型 **RPD** 和 Key **数量**)。 \ No newline at end of file diff --git a/src/content/posts/umami.md b/src/content/posts/umami.md index 7659c00..4a95f29 100644 --- a/src/content/posts/umami.md +++ b/src/content/posts/umami.md @@ -56,5 +56,10 @@ Neon 仍有使用限制:[https://neon.com/pricing](https://neon.com/pricing) 14. 至此,你已成功自托管一个 Umami 网站统计工具。恭喜你。 # 注意事项 -:::caution -Umami 对于从台湾地区传来的请求,默认展示为 **ROC Flag + 台湾**。请注意风险,如需更改,请手动更改 Umami 文件。 \ No newline at end of file +:::caution[警告 CAUTION] +### [非必须] +Umami 对于从台湾地区传来的请求,默认展示为 **ROC Flag + 台湾**。如需更改,请手动更改 Umami 文件。 +- ``/public/datamaps.world.json`` +- ``/public/images/country/tw.png`` +- ``/public/intl/country/zh-CN.json`` +- ``/public/intl/country/zh-TW.json`` \ No newline at end of file diff --git a/src/content/spec/about.md b/src/content/spec/about.md index 0ce2e25..1ba0a00 100644 --- a/src/content/spec/about.md +++ b/src/content/spec/about.md @@ -7,7 +7,7 @@ ::github{repo="withastro/astro"} ::github{repo="afoim/fuwari"} -## 域名 +# 域名 目前你现在见到的,也就是 [adclosenn.top](https://adclosenn.top)。除了这个,我还有其他的域名(部分): 1. adclosenn.top @@ -17,17 +17,51 @@ --- -## 关于我 -好了,本站的介绍完了,到介绍我自己了。 +# 关于我 +一位住在[中华人民共和国广西壮族自治区](https://baike.baidu.com/item/%E5%B9%BF%E8%A5%BF%E5%A3%AE%E6%97%8F%E8%87%AA%E6%B2%BB%E5%8C%BA/163178)的苦逼学生。 -关于我的名字 Ad_closeNN... 你可以叫我 **Ad**、**closeNN**或**广告猫猫**。 - -一位住在[中华人民共和国广西壮族自治区梧州市](https://baike.baidu.com/item/%E6%A2%A7%E5%B7%9E%E5%B8%82/7260153)的苦逼学生。长吗?长就对了!谁让广西是自治区呢! - -### 爱好 +## 爱好 玩游戏、写代码、写博客(也许吧),哦,还有读书。只会一点 [Python](https://baike.baidu.com/item/Python/407313),初学者罢了。 -## 关于本站 -### 字体 -使用的是 [MiSans](https://hyperos.mi.com/font),中英文可变字重字体从官方 CDN 服务器获取。 -# [点此查看详情](/misans/) \ No newline at end of file +## 联系方式 +电子邮箱:[1709301095@qq.com](mailto:1709301095@qq.com) 或 [W1709301095@gmail.com](mailto:W1709301095@gmail.com) +Discord:https://discord.com/users/1068060784300658688 + +--- + +# 关于本站 +## 字体 +使用的是 [MiSans VF](https://hyperos.mi.com/font),中英文可变字重字体从官方 CDN 服务器获取。 +[点此查看详情](/misans/) + +## 一言 +使用的是 [一言语句接口(JSON)](https://developer.hitokoto.cn/sentence/)。`v1.hitokoto.cn` + +## 统计信息 +使用的是自托管([Netlify](https://www.netlify.com) + [Neon](https://neon.com))的 [Umami](https://umami.is)。具体可查看 [手把手自托管 Umami +](/posts/umami/) + +--- + +# 2025/8/10 +~~1145141919**810**~~ +::github{repo="carbon-app/carbon"} +https://carbon.now.sh + +本站取消使用 Background 图像(之前为每日 Bing 图像),改为使用横幅由 [Carbon](https://github.com/carbon-app/carbon) 生成的 Banner:**Apache Getting Started**。 +出处:https://httpd.apache.org/docs/2.4/getting-started.html + +``` +Troubleshooting any problem without +the error log is like driving with your eyes closed. +在没有错误日志的情况下诊断任何问题无异于闭眼开车 + —— Apache 官方文档 Getting Started 篇章 +``` + +除此之外,我在 `/public/` 中留了 3 个 banner 文件: +- [/public/assets/apache_carbon.svg](/assets/apache_carbon.svg) :由 [Carbon](https://github.com/carbon-app/carbon) 生成的 banner,`SVG` 格式(本站使用中)。 ![apache_carbon](/assets/apache_carbon.svg) +- [/public/assets/apache_carbon.png](/assets/apache_carbon.png) :由 [Carbon](https://github.com/carbon-app/carbon) 生成的 banner,`PNG` 格式。 +- [/public/assets/apache.jpg](/assets/apache.jpg):网传的图片 ![apache](/assets/apache.jpg) + +和一个 `JSON` 文件: +- /public/assets/carbon-config.json :[Carbon 官网](https://carbon.now.sh) 配置文件。 \ No newline at end of file diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index f43da5f..7dbc3b2 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -555,27 +555,6 @@ window.onresize = () => { offset = offset - offset % 4; document.documentElement.style.setProperty('--banner-height-extend', `${offset}px`); } -// Background image loading detection https://github.com/afoim/fuwari/commit/aad0a7734be5f6e96a54a3aed51e49760ab3162a -const bgUrl = getComputedStyle(document.documentElement).getPropertyValue('--bg-url').trim(); -const bgEnable = getComputedStyle(document.documentElement).getPropertyValue('--bg-enable').trim(); - -if (bgUrl && bgUrl !== 'none' && bgEnable === '1') { - const img = new Image(); - const urlMatch = bgUrl.match(/url\(["']?([^"')]+)["']?\)/); - if (urlMatch) { - img.onload = function() { - // 背景图片完全加载后,显示背景并启用卡片透明效果 - document.body.classList.add('bg-loaded'); - document.documentElement.style.setProperty('--card-bg', 'var(--card-bg-transparent)'); - document.documentElement.style.setProperty('--float-panel-bg', 'var(--float-panel-bg-transparent)'); - }; - img.onerror = function() { - // Keep cards opaque if background image fails to load - console.warn('Background image failed to load, keeping cards opaque'); - }; - img.src = urlMatch[1]; - } -}