|  | 
| 1 |  | -import { version } from "../package.json"; | 
|  | 1 | +import metadataJson from "../metadata.json"; | 
| 2 | 2 | 
 | 
| 3 |  | -// TODO: The metadata will be configurable via a JSON configuration file. | 
|  | 3 | +type Metadata = { | 
|  | 4 | +	language: "ja-JP" | "en-US"; | 
|  | 5 | +	version: string; | 
|  | 6 | +	typstOfficialUrl: string; | 
|  | 7 | +	typstOfficialDocsUrl: `http://${string}/` | `https://${string}/`; | 
|  | 8 | +	githubOrganizationUrl: string; | 
|  | 9 | +	githubRepositoryUrl: string; | 
|  | 10 | +	discordServerUrl: string; | 
|  | 11 | +	originUrl: string; | 
|  | 12 | +	basePath: "/" | `/${string}/`; | 
|  | 13 | +	displayTranslationStatus: boolean; | 
|  | 14 | +}; | 
|  | 15 | + | 
|  | 16 | +const metadata = metadataJson as unknown as Metadata; | 
|  | 17 | + | 
|  | 18 | +/** The language of the documentation. */ | 
|  | 19 | +export const language = metadata.language; | 
| 4 | 20 | /** The version of the documentation, without a leading `v`. */ | 
| 5 |  | -export { version }; | 
|  | 21 | +export const version = metadata.version; | 
| 6 | 22 | /** The official Typst website URL. */ | 
| 7 |  | -export const typstOfficialUrl = "https://typst.app"; | 
|  | 23 | +export const typstOfficialUrl = metadata.typstOfficialUrl; | 
| 8 | 24 | /** The official Typst documentation base URL. */ | 
| 9 |  | -export const typstOfficialDocsUrl: `http://${string}/` | `https://${string}/` = | 
| 10 |  | -	"https://typst.app/docs/"; | 
|  | 25 | +export const typstOfficialDocsUrl = metadata.typstOfficialDocsUrl; | 
| 11 | 26 | /** The GitHub organization URL. */ | 
| 12 |  | -export const githubOrganizationUrl = "https://github.com/typst-jp"; | 
|  | 27 | +export const githubOrganizationUrl = metadata.githubOrganizationUrl; | 
| 13 | 28 | /** The GitHub repository URL. */ | 
| 14 |  | -export const githubRepositoryUrl = "https://github.com/typst-jp/docs"; | 
|  | 29 | +export const githubRepositoryUrl = metadata.githubRepositoryUrl; | 
| 15 | 30 | /** The Discord server invite URL. */ | 
| 16 |  | -export const discordServerUrl = "https://discord.gg/9xF7k4aAuH"; | 
|  | 31 | +export const discordServerUrl = metadata.discordServerUrl; | 
| 17 | 32 | /** The origin URL of the deployed site, used for metadata. Note that the base path should not be included. */ | 
| 18 |  | -export const originUrl = "https://typst-jp.github.io/"; | 
|  | 33 | +export const originUrl = metadata.originUrl; | 
| 19 | 34 | /** The base public path for deployment. This must match the value used in typst-docs. */ | 
| 20 |  | -export const basePath: "/" | `/${string}/` = "/docs/"; | 
|  | 35 | +export const basePath = metadata.basePath; | 
| 21 | 36 | /** Indicates whether to display the translation status on the site. Community content is always displayed. */ | 
| 22 |  | -export const displayTranslationStatus: boolean = true; | 
|  | 37 | +export const displayTranslationStatus = metadata.displayTranslationStatus; | 
0 commit comments