Skip to content

Commit 4e8ca6c

Browse files
committed
fix(mastodon): remove unused preconnect links and update url handling
* removed preconnect and dns-prefetch links for mstd-s3-files * updated replaceFileUrl function to return original url Signed-off-by: Charles Chin <eallion.s+github@gmail.com>
1 parent b0f595a commit 4e8ca6c

3 files changed

Lines changed: 6 additions & 7 deletions

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: Setup Hugo
4040
uses: peaceiris/actions-hugo@v3
4141
with:
42-
hugo-version: '0.152.2'
42+
hugo-version: '0.154.5'
4343
extended: false
4444

4545
- name: Cache Hugo Resources

layouts/_default/mastodon.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
{{ define "main" }}
22
<link rel="preconnect" href="https://e5n.cc">
33
<link rel="dns-prefetch" href="https://e5n.cc">
4-
<link rel="preconnect" href="https://mstd-s3-files.eallion.com">
5-
<link rel="dns-prefetch" href="https://mstd-s3-files.eallion.com">
64
<style>
75
.mt-content p {
86
overflow-wrap: break-word;
@@ -280,7 +278,8 @@ <h1 id="title" class="text-4xl font-bold leading-normal">{{ .Title }}</h1>
280278

281279
// --- Helper Functions ( extracted from original inline code) ---
282280

283-
const replaceFileUrl = url => url.replace('https://files.e5n.cc/', 'https://mstd-s3-files.eallion.com/');
281+
// const replaceFileUrl = url => url.replace('https://files.e5n.cc/', 'https://mstd-s3-files.eallion.com/');
282+
const replaceFileUrl = url => url;
284283

285284
const getImageObjectFitClass = (imgWidth, imgAspect, containerRatio) => {
286285
if (!imgAspect) return 'object-cover';
@@ -430,7 +429,7 @@ <h1 id="title" class="text-4xl font-bold leading-normal">{{ .Title }}</h1>
430429

431430
// sensitive overlay
432431
// 生成图片描述列表
433-
const imageDescriptions = isSensitive && mediaItems.some(m => m.description)
432+
const imageDescriptions = isSensitive && mediaItems.some(m => m.description)
434433
? mediaItems.map((m, idx) => m.description ? `${idx + 1}. ${m.description}` : '').filter(d => d).join(' · ')
435434
: '';
436435

wrangler.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name = "eallion-com-cf-pages-origin"
22
pages_build_output_dir = "./public"
33

44
[vars]
5-
HUGO_VERSION = "v0.152.2"
5+
HUGO_VERSION = "v0.154.5"
66

77
[env.production.vars]
8-
HUGO_VERSION = "v0.152.2"
8+
HUGO_VERSION = "v0.154.5"

0 commit comments

Comments
 (0)