From fcfe61ce6de6b7d7103bd705097bcbd608084c31 Mon Sep 17 00:00:00 2001 From: JiPai Date: Mon, 20 May 2024 00:08:17 +0800 Subject: [PATCH] fix: fix image url path --- src/assets/themes.json | 6 +++--- src/utils/github.ts | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/assets/themes.json b/src/assets/themes.json index 2be1e1e..2edad1c 100644 --- a/src/assets/themes.json +++ b/src/assets/themes.json @@ -45,7 +45,7 @@ { "themeTitle": "Illinois", "themeDescription": "NetNewsWire plus a little bit of classic macOS.", - "themeThumbs": ["NetNewsWire-themes-collection/images/themes/illinois/illinois-mac.png"], + "themeThumbs": ["/NetNewsWire-themes-collection/images/themes/illinois/illinois-mac.png"], "themeRepo": "https://github.com/stuartbreckenridge/Illinois", "themeAuthor": { "name": "stuartbreckenridge", @@ -112,7 +112,7 @@ { "themeTitle": "Minutes for NetNewsWire", "themeDescription": "Inspired by Simone Silvestroni's site, Minutes uses Seravek for headings and Iowan Old Style for body text.Based on the default theme for NetNewsWire. Font size has been bumped up 2px on macOS to bring the font size in line with Safari's reader view when using Iowan.", - "themeThumbs": ["NetNewsWire-themes-collection/images/themes/minutes/mac-white.png"], + "themeThumbs": ["/NetNewsWire-themes-collection/images/themes/minutes/mac-white.png"], "themeRepo": "https://github.com/lkhrs/nnw-minutes", "themeAuthor": { "name": "Luke Harris", @@ -123,7 +123,7 @@ { "themeTitle": "serif-gazette", "themeDescription": "", - "themeThumbs": ["NetNewsWire-themes-collection/images/themes/serif-gazette/mac-white.png"], + "themeThumbs": ["/NetNewsWire-themes-collection/images/themes/serif-gazette/mac-white.png"], "themeRepo": "https://github.com/jsit/serif-gazette", "themeAuthor": { "name": "Jay Sitter", diff --git a/src/utils/github.ts b/src/utils/github.ts index 71d2eb2..c476fb0 100644 --- a/src/utils/github.ts +++ b/src/utils/github.ts @@ -4,10 +4,9 @@ const GITHUB_REPO_STAR_BADGE = "https://img.shields.io/github/stars"; export function getRepoStarBadge(repoUrl: string) { try { const spliteRepoUrl = repoUrl.replace("https://", "").split("/"); - console.log(spliteRepoUrl); - return `${GITHUB_REPO_STAR_BADGE}/${ - spliteRepoUrl[1] - }/${spliteRepoUrl[2].split("#")[0]}?style=flat&logo=github`; + return `${GITHUB_REPO_STAR_BADGE}/${spliteRepoUrl[1]}/${ + spliteRepoUrl[2].split("#")[0] + }?style=flat&logo=github`; } catch (error) { return null; }