RSS API 地址全部收敛到 hugo.toml [params.rssapi],切到 api.200181.xyz
Deploy to Production / pre-check (push) Successful in 2m0s
Deploy to Production / build (push) Successful in 9m9s
Deploy to Production / deploy-edgeone (push) Successful in 4m3s
Deploy to Production / finalize (push) Successful in 29s
Deploy to Production / notify-failure (push) Skipped
Deploy to Production / pre-check (push) Successful in 2m0s
Deploy to Production / build (push) Successful in 9m9s
Deploy to Production / deploy-edgeone (push) Successful in 4m3s
Deploy to Production / finalize (push) Successful in 29s
Deploy to Production / notify-failure (push) Skipped
- 新增 [params.rssapi] base 配置,主题 7 处硬编码改为读配置: head(preconnect+window.rssApiBase)、footer(构建时拉 links/feeds)、 render-link(favicon)、circles/links 页 fetch、linkify.js(读 window.rssApiBase) - scripts/fetch_greetings.js 支持 RSS_API_BASE 环境变量,默认新地址 - scfapi.usj.cc(国内代理)保持不变
This commit is contained in:
1 parent
be5abce16a
commit
20869a3c45
8 files changed
+16
-8
No files matched your search
@@ -190,6 +190,13 @@ hasCJKLanguage = true
|
||||
emoticons = "/emotion/OwO.json"
|
||||
gravatar = "https://cravatar.cn/avatar/"
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# RSS 聚合服务 (rss-robot-cf:订阅/友链/文章/图标)
|
||||
# ----------------------------------------------------------------------------
|
||||
[params.rssapi]
|
||||
# 2026-10-02 从 EdgeOne (https://api.usj.cc) 迁到 Cloudflare Workers
|
||||
base = "https://api.200181.xyz"
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# 弹幕配置 (Barrage Configuration)
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const API_BASE = "https://api.usj.cc/api/ai/greeting";
|
||||
const API_BASE = (process.env.RSS_API_BASE || "https://api.200181.xyz") + "/api/ai/greeting";
|
||||
let TOKEN = process.env.RSS_API_TOKEN;
|
||||
|
||||
// Fallback: read from write/.env
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
(function() {
|
||||
var URL_RE = /(https?:\/\/[^\s一-鿿 -〿-<>"')\]]+)/g;
|
||||
var VIDEO_RE = /\.(mp4|webm|ogg|mov)(\?|$)/i;
|
||||
var FAVICON_API = 'https://api.usj.cc/api/favicon?url=';
|
||||
var FAVICON_API = (window.rssApiBase || 'https://api.200181.xyz') + '/api/favicon?url=';
|
||||
|
||||
function getDomain(url) {
|
||||
try { return new URL(url).hostname; } catch (e) { return url; }
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</video>
|
||||
{{- else if $isExternal -}}
|
||||
{{- $domain := urls.Parse $url -}}
|
||||
{{- $faviconUrl := printf "https://api.usj.cc/api/favicon?url=%s" $domain.Host -}}
|
||||
{{- $faviconUrl := printf "%s/api/favicon?url=%s" (site.Params.rssapi.base | default "https://api.200181.xyz") $domain.Host -}}
|
||||
{{- if $isBareUrl -}}
|
||||
<a class="link-card" href="/tiaozhuan.html?target={{ $url | base64Encode }}" target="_blank" rel="noopener">
|
||||
<img class="link-card-icon" src="{{ $faviconUrl }}" alt="" loading="lazy" onerror="this.src='/image/avatar/tx7.jpg';this.onerror=null;">
|
||||
|
||||
@@ -448,7 +448,7 @@
|
||||
hardTtl: window.BrowserCache ? window.BrowserCache.formatDuration(window.FriendCircle.CACHE_OPTIONS.hardTtl) : window.FriendCircle.CACHE_OPTIONS.hardTtl
|
||||
});
|
||||
}
|
||||
return fetch("https://api.usj.cc/api/articles?limit=50")
|
||||
return fetch("{{ site.Params.rssapi.base | default "https://api.200181.xyz" }}/api/articles?limit=50")
|
||||
.then(function(res) {
|
||||
if (!res.ok) throw new Error("Network response was not ok");
|
||||
return res.json();
|
||||
|
||||
@@ -220,7 +220,7 @@
|
||||
softTtl: window.BrowserCache ? window.BrowserCache.formatDuration(CACHE_OPTIONS.softTtl) : CACHE_OPTIONS.softTtl,
|
||||
hardTtl: window.BrowserCache ? window.BrowserCache.formatDuration(CACHE_OPTIONS.hardTtl) : CACHE_OPTIONS.hardTtl
|
||||
});
|
||||
return fetch('https://api.usj.cc/api/links')
|
||||
return fetch('{{ site.Params.rssapi.base | default "https://api.200181.xyz" }}/api/links')
|
||||
.then(function(res) {
|
||||
if (!res.ok) throw new Error('Failed to fetch links');
|
||||
return res.json();
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
{{/* Fetch friend data at build time — no runtime network requests */}}
|
||||
{{ $linkHosts := slice }}
|
||||
{{ $linkNames := slice }}
|
||||
{{ with resources.GetRemote "https://api.usj.cc/api/links?all=1" }}
|
||||
{{ with resources.GetRemote (printf "%s/api/links?all=1" (site.Params.rssapi.base | default "https://api.200181.xyz")) }}
|
||||
{{ with .Err }}
|
||||
{{ warnf "Links API fetch failed: %s" . }}
|
||||
{{ else }}
|
||||
@@ -107,7 +107,7 @@
|
||||
|
||||
{{ $feedHosts := slice }}
|
||||
{{ $feedNames := slice }}
|
||||
{{ with resources.GetRemote "https://api.usj.cc/api/feeds" }}
|
||||
{{ with resources.GetRemote (printf "%s/api/feeds" (site.Params.rssapi.base | default "https://api.200181.xyz")) }}
|
||||
{{ with .Err }}
|
||||
{{ warnf "Feeds API fetch failed: %s" . }}
|
||||
{{ else }}
|
||||
|
||||
@@ -42,7 +42,8 @@
|
||||
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
||||
<!-- Resource Hints -->
|
||||
<link rel="preconnect" href="https://cravatar.cn">
|
||||
<link rel="preconnect" href="https://api.usj.cc">
|
||||
{{ with site.Params.rssapi.base }}<link rel="preconnect" href="{{ . }}">{{ end }}
|
||||
{{ with site.Params.rssapi.base }}<script>window.rssApiBase = "{{ . }}";</script>{{ end }}
|
||||
<link rel="dns-prefetch" href="https://bsz.dusays.com:9001">
|
||||
<!-- Analytics -->
|
||||
<script async src="https://019e3dec-3312-7873-862a-3f56ac99ea83.spst2.com/ustat.js"></script>
|
||||
|
||||
Reference in new issue
Block a user