Skip to content

Commit

Permalink
fix: name
Browse files Browse the repository at this point in the history
  • Loading branch information
cstrikeasia committed Nov 5, 2024
1 parent 3ceb1e8 commit 14c687c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "cdpsplugins-website",
"name": "tremplugins-website",
"version": "0.1.0",
"private": true,
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,25 @@ import { translateLangDict } from "@/utils/i18n-utils";
import { getLocale } from "next-intl/server";
import React from "react";

export async function PluginContentIntroduction({plugin}: { plugin: AllOfAPlugin }) {
const desc = await get_content(plugin.github,plugin.package_name)
export async function PluginContentIntroduction({
plugin,
}: {
plugin: AllOfAPlugin;
}) {
const desc = await get_content(plugin.github, plugin.package_name);
// const introduction = translateLangDict(await getLocale(), desc, true) || ''
return (
<>
{/* SSR, no need to use GfmMarkdownDynamic */}
<GfmMarkdown allowEmbedHtml>
{desc}
</GfmMarkdown>
<GfmMarkdown allowEmbedHtml>{desc}</GfmMarkdown>
</>
)
);
}

async function get_content(repo: string,pkg:string): Promise<string> {
const url = `https://raw.githubusercontent.com/${repo}/master/${pkg}/cdps.json`
const rsp = await fetch(url)
const data = await rsp.json()
const desc = data.description.zh_tw
return desc
}
async function get_content(repo: string, pkg: string): Promise<string> {
const url = `https://raw.githubusercontent.com/${repo}/master/${pkg}/trem.json`;
const rsp = await fetch(url);
const data = await rsp.json();
const desc = data.description.zh_tw;
return desc;
}
4 changes: 2 additions & 2 deletions src/catalogue/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const gunzipAsync = promisify(gunzip);
async function fetchEverything(): Promise<Everything> {
const url: string =
process.env.MW_EVERYTHING_JSON_URL ||
"https://raw.githubusercontent.com/ExpTechTW/CDPS/master/assets/plugins.json";
"https://raw.githubusercontent.com/ExpTechTW/Plugins-web/refs/heads/main/public/plugins.json";

// The 2nd init param cannot be defined as a standalone global constant variable,
// or the ISR might be broken: fetchEverything() will never be invoked after the first 2 round of requests,
Expand All @@ -68,7 +68,7 @@ async function fetchEverything(): Promise<Everything> {
}

export async function getInfo(github: string, pkg: string): Promise<trem_json> {
const url = `https://raw.githubusercontent.com/${github}/master/${pkg}/cdps.json`;
const url = `https://raw.githubusercontent.com/${github}/master/${pkg}/trem.json`;
const rsp = await fetch(url, {
next: {
revalidate: 10 * 60, // ISR 10min
Expand Down
2 changes: 1 addition & 1 deletion src/components/plugin/plugin-dependencies.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export async function PluginRequirementTable({
([pluginId, requirement], index) => {
const id = pluginId.match(/^[a-zA-Z0-9_]+$/)?.toString();
let pluginUrl: string | undefined;
if (id === "cdps") {
if (id === "trem") {
pluginUrl = siteConfig.links.githubTrem;
} else if (id === "python") {
pluginUrl = "https://www.python.org";
Expand Down

0 comments on commit 14c687c

Please sign in to comment.