mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-12 20:26:10 +01:00
open source WOTB_GLOSSARY
This commit is contained in:
4 files changed
+13
-16
No files matched your search
@@ -82,11 +82,6 @@ env:
|
|||||||
PUBLIC_STATIC_ASSET_BASE: https://assets.blitzkit.app
|
PUBLIC_STATIC_ASSET_BASE: https://assets.blitzkit.app
|
||||||
PUBLIC_GUIDE_WEBSITE: https://guidesblitz.com
|
PUBLIC_GUIDE_WEBSITE: https://guidesblitz.com
|
||||||
|
|
||||||
# blitz
|
|
||||||
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
|
|
||||||
WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }}
|
|
||||||
WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }}
|
|
||||||
|
|
||||||
# google
|
# google
|
||||||
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
|
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { assertSecret } from "../blitzkit";
|
|
||||||
import type { BlitzGlossary } from "../types";
|
import type { BlitzGlossary } from "../types";
|
||||||
|
|
||||||
|
export const WOTB_GLOSSARY_DOMAIN = "https://na.wotblitz.com";
|
||||||
|
export const WOTB_GLOSSARY_PATH = "api/glossary/stuff";
|
||||||
|
|
||||||
export async function fetchGlossary(locale: string) {
|
export async function fetchGlossary(locale: string) {
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
`${assertSecret(
|
`${WOTB_GLOSSARY_DOMAIN}/${locale}/${WOTB_GLOSSARY_PATH}`,
|
||||||
import.meta.env.WOTB_GLOSSARY_DOMAIN,
|
|
||||||
)}/${locale}${assertSecret(import.meta.env.WOTB_GLOSSARY_PATH)}`,
|
|
||||||
);
|
);
|
||||||
return (await response.json()) as BlitzGlossary;
|
return (await response.json()) as BlitzGlossary;
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,9 @@
|
|||||||
import { assertSecret, type BlitzGlossary } from "@blitzkit/core";
|
import {
|
||||||
|
WOTB_GLOSSARY_DOMAIN,
|
||||||
|
WOTB_GLOSSARY_PATH,
|
||||||
|
type BlitzGlossary,
|
||||||
|
} from "@blitzkit/core";
|
||||||
|
import locales from "@blitzkit/i18n/locales.json";
|
||||||
import type { APIContext, GetStaticPathsItem } from "astro";
|
import type { APIContext, GetStaticPathsItem } from "astro";
|
||||||
import sharp from "sharp";
|
import sharp from "sharp";
|
||||||
import { mixStaticPaths } from "../../../../core/blitzkit/mixStaticPaths";
|
import { mixStaticPaths } from "../../../../core/blitzkit/mixStaticPaths";
|
||||||
@@ -30,7 +35,9 @@ export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const glossary = await fetch(assertSecret(import.meta.env.WOTB_GLOSSARY))
|
const glossary = await fetch(
|
||||||
|
`${WOTB_GLOSSARY_DOMAIN}/${locales.default}/${WOTB_GLOSSARY_PATH}`,
|
||||||
|
)
|
||||||
.then((response) => response.json() as Promise<BlitzGlossary>)
|
.then((response) => response.json() as Promise<BlitzGlossary>)
|
||||||
.then((glossary) =>
|
.then((glossary) =>
|
||||||
Object.values(glossary)
|
Object.values(glossary)
|
||||||
|
|||||||
@@ -26,10 +26,5 @@ PUBLIC_PROMOTE_OPENTEST=false
|
|||||||
# Legacy variable; this will be removed soon
|
# Legacy variable; this will be removed soon
|
||||||
PUBLIC_STATIC_ASSET_BASE=https://assets.blitzkit.app
|
PUBLIC_STATIC_ASSET_BASE=https://assets.blitzkit.app
|
||||||
|
|
||||||
# Proprietary Wargaming fields; you shouldn't need these for 99% of the tasks
|
|
||||||
WOTB_GLOSSARY=
|
|
||||||
WOTB_GLOSSARY_DOMAIN=
|
|
||||||
WOTB_GLOSSARY_PATH=
|
|
||||||
|
|
||||||
# Generate your own application id: https://developers.wargaming.net
|
# Generate your own application id: https://developers.wargaming.net
|
||||||
PUBLIC_WARGAMING_APPLICATION_ID=
|
PUBLIC_WARGAMING_APPLICATION_ID=
|
||||||
Reference in new issue
Block a user