| File | Purpose |
|---|---|
src/config.ts | Main entry point: site information, theme switches, profile, license, friend links, languages and the Cover text of every page |
astro.config.mjs | Astro configuration: site and i18n are read from src/config.ts, so usually only build-time options such as markdown.shikiConfig need editing |
src/content.config.ts | Schema of the article frontmatter (only needs changes when fields are added or modified) |
src/i18n/ | UI translations (everything except the Cover text) |
astro.config.mjssite: Website URL, taken from siteConfig.rootSiteUrli18n: Internationalization configuration, taken from i18nConfig
locales: Supported languages, corresponds to i18nConfig.supportedLanguagesdefaultLocale: Default language, corresponds to i18nConfig.defaultLanguagemarkdown
shikiConfig: Code block styling. Refer to Astro’s documentation ShikiIn other words, everything related to languages and your domain lives in
src/config.ts;astro.config.mjsnormally needs no changes.
src/config.tssiteConfigtitle: Site titlesubTitle: Site subtitlerootSiteUrl: Root URL of the site, used to generate absolute links for SEO and social sharing; astro.config.mjs uses it as sitefavicon: Site iconpageSize: Number of articles per pagetoc
enable: Enable table of contentsdepth: Table of contents depthblogNavi
enable: Enable page navigation at the bottom of the blogcomments
enable: Enable comment featureplatform: Comment platform, default uses Momo-backend, twikoo is also supportedbackendUrl: Url of the backendtheme
AOS: Enable AOS animationsLQIP: Enable LQIPPhotoSwipe: Enable PhotoSwipepostCard
imageMode: Cover image mode for article cards
"top": The image is displayed above the card content (default)"background": The image is used as the card background, fading to transparent from right to leftFor the backend project, refer to Momo-backend. Ensure all configurations are completed as specified, particularly for cross-domain domains.
profileConfigavatar: Profile picture, relative to the src/ directory; relative to public/ when it starts with /name: Name, shown in the footerdescription: Description, used in SEOindexPage: Profile homepage, shown in the footerstartYear: Year the site was created, used for the copyright year range in the footerlicenseConfigenable: Enable license display at the end of articlesname: License nameurl: License URLfriendLinkConfigname: Friend link nameavatar: Friend link iconurl: Friend link URLdescription: Friend link description, set to an empty string if not neededi18nConfigdefaultLanguage: Default language, also used as defaultLocale in astro.config.mjs (the default language is not prefixed in URLs)supportedLanguages: List of supported languages, also used as locales in astro.config.mjstranslations: Cover text for each language
translations["zh-cn"].Cover / translations["en"].CoverCover.title: Large title of each page — home, archive, about, friendsCover.subTitle: Subtitle of each page, same keys as above; archive supports the {count} placeholder, which is replaced with the total number of articlesThe i18n files live in the src/i18n/ folder:
key.ts: the Translation interface, the single source of truth for the translation structurelanguage/zh-cn.ts, language/en.ts: UI copy for each language; fields must match Translation one to onetranslation.ts: i18nit(lang) returns a t(key, params) function with {name} style parameter substitution and a fallback to the default languageThe Cover text of each page (cover.title / cover.subTitle) has moved into i18nConfig.translations in src/config.ts, and the files under src/i18n/language simply reference it. To change the title or subtitle of the home, archive, about or friends page, edit src/config.ts instead of the language files.
Loading comments...