1078 文字
5 minutes
Configuration Guides for Fumika Site

This guide walks you through configuring your site using the src/config.ts file in the Fumika Astro theme. If you are unfamiliar with JavaScript syntax, consider reviewing basic variable usage. TypeScript will also help catch any data type mismatches.

Site Configuration#

The siteConfig object controls core site metadata, layout behaviors, and multi-language support.

title: "Fumika",
subtitle: "Blog",
lang: "en",
supportedLangs: ["en", "es", "id", "ja"],
theme: {
hue: 75,
mode: "light",
},
banner: {
enable: true,
src: "assets/images/demo-banner.jpg",
position: "center",
credit: {
enable: true,
text: "Artist Name",
url: "https://example.com"
},
},
toc: {
enable: true,
depth: 2,
},
favicon: [],
ogImage: {
useDefault: true,
defaultSrc: "/media/images/banner.jpg",
},
};

Attribute title and subtitle are displayed like this format in website title homepage:

<title> - <subtitle>

Languages#

Set lang for primary language code for your site.

The supportedLangs attribute is an array of language codes available in the site language switcher. Leave as an empty array [] to disable multi-language support. The order of items in the array determines their display order in the switcher.

Available languages:

  • "en"
  • "zh_CN"
  • "zh_TW"
  • "ja"
  • "ko"
  • "es"
  • "th"
  • "vi"
  • "tr"
  • "id"
  • "fr"
  • "fa"
WARNING

Currently, Persian fa language not set properly.
(Not set to right to left direction)

Theme#

theme.color is the primary accent color hue value ranging from 0 to 360 (e.g., Red: 0, Teal: 200, Cyan: 250, Pink: 345).

TIP

To see the live preview of theme color, run pnpm dev and see the display setting in navbar.
You can change the theme color without changing theme.color manually in src/config.ts.
This feature only appear in dev mode

Set theme.mode for default color theme mode ("light" or "dark").

AttributeDescription
banner.enableSet to true to display the hero banner image at the top of pages
banner.srcImage source path.
Relative to src/ by default (e.g., src/assets/images/demo-banner.jpg),
or relative to public/ if prefixed with / (e.g., /media/images/banner.jpg).
banner.positionObject alignment for the banner image. Accepts "top", "center", or "bottom".
banner.creditArtwork attribution configuration:
1. enable: Set to true to display the credit text of the banner.
2. text: The credit string to display (e.g., artist name or source).
3. url: (Optional) Link to the original artwork or artist profile.

TOC#

Set toc.enable to true to display TOC. The toc.depth is the maximum heading depth level to display in the TOC, ranging from 1 to 3.

Favicon#

favicon is an array of custom favicon configuration objects. Leave empty [] to use the default site favicon.

This is example custom favicon look like:

favicon: [
{
src: "/favicon/icon.svg", // Path relative to /public
theme: "light", // Optional: 'light' or 'dark'
sizes: "32x32", // Optional: image size dimension
},
]

Open Graph Image#

Open Graph image (ogImage) is the Social media preview card configuration

AttributeDescription
ogImage.useDefaultSet to true to fall back to defaultSrc when a post lacks its own cover image.
ogImage.detaultSrcThe default image path used for Open Graph previews. It’s only relative to /public directory start with /
It’s also the Open Graph image for other pages tha posts like Home, About, etc.

Configure the main navigation links in navBarConfig. You can mix default preset links with custom external or internal links.

export const navBarConfig: NavBarConfig = {
links: [
LinkPreset.Home,
LinkPreset.Archive,
LinkPreset.About,
LinkPreset.Friends,
{
name: "GitHub",
url: "https://github.com/your-username/your-repo",
external: true,
},
],
};

Custom navigation bar link attributes:

AttributeDescription
nameDisplayed name in navbar
urlURL navigation of external or internal links.
Internal links should not include the base path, as it is automatically added
externalIf it set to true, it will show an external link icon and open in a new tab

This is how navigation links that only contain Home, Archive, and About look like:

export const navBarConfig: NavBarConfig = {
links: [
LinkPreset.Home,
LinkPreset.Archive,
LinkPreset.About,
],
};

Profile Configuration#

The profileConfig object populates the sidebar profile card with your avatar, bio, and social links.

export const profileConfig: ProfileConfig = {
avatar: "assets/images/demo-avatar.jpg",
name: "Fumika",
bio: "Lorem ipsum dolor sit amet",
links: [
{
name: "X",
icon: "fa6-brands:x-twitter",
url: "https://x.com",
},
{
name: "GitHub",
icon: "fa6-brands:github",
url: "https://github.com",
},
],
};

avatar path is relative to the src/ directory by default (e.g., "assets/images/demo-avatar.jpg"). Also it relative to the public/ directory if the path starts with a leading slash / (e.g., "/media/images/avatar.webp").

links icons are powered by Iconify. If you use an icon set that is not already included in the template, you must install the corresponding package:

Terminal window
pnpm add @iconify-json/<icon-set-name>

Visit https://icones.js.org for icon codes.

License Configuration#

Configure the content license displayed at the end of post using licenseConfig:

export const licenseConfig: LicenseConfig = {
enable: true,
name: "CC BY-NC-SA 4.0",
url: "https://creativecommons.org/licenses/by-nc-sa/4.0/",
};

Expressive Code Configuration#

WARNING

Please select a dark theme, as Fumika currently only supports dark background color.

export const expressiveCodeConfig: ExpressiveCodeConfig = {
theme: "github-dark",
};

Comment Configuration#

Fumika targeting 3 comment support, Disqus, Giscus, and Twikoo. Currently only support Giscus.

Giscus#

Fumika supports Giscus out-of-the-box for GitHub Discussions-powered comments.

export const commentConfig: CommentConfig = {
giscus: {
repo: "your-username/your-repo",
repoId: "R_kgDO...",
category: "General",
categoryId: "DIC_kwDO...",
mapping: "pathname",
strict: "0",
reactionsEnabled: "1",
emitMetadata: "1",
inputPosition: "top",
theme: "reactive",
lang: "en",
loading: "lazy",
},
};
AttributeDescription
repoRepository for discussion database.
Format: username/repo
repoIdThe unique ID of the GitHub repository. Obtainable from https://giscus.app
categoryThe discussion category name.
Options: Announcement, General, Ideas, Polls, Q&A, Show and tell
categoryIdThe unique ID of the discussion category. Obtainable from https://giscus.app
mappingHow pages map to GitHub Discussions.
Options: pathname, url, title, og:title, and specific
strictWhether to strictly match discussion titles.
("1" for enable and "2" for disable)
reactionsEnabledEnable or disable reaction buttons for the main post.
("1" for enable and "2" for disable)
emitMetadataWhether to send discussion metadata to the parent page.
("1" for enable and "2" for disable)
inputPositionPosition of the comment box relative to comments.
("top" or "bottom")
themeGiscus color theme.
(e.g., "light", "dark", "preferred_color_scheme", "reactive")
langDisplay language for the Giscus widget.
(e.g., "en", "zh-CN", "ja")
loadingLoading strategy for the comment iframe.
("lazy" or "eager")
TIP

set theme to reactive to use reactive style using custom CSS.
set category to Announcement to prevent replies directly in repository of discussion.

To disable comments completely, set giscus to undefined:

export const commentConfig: CommentConfig = {
giscus: undefined;
}

Analytics Configuration#

Analytics allow you to monitor and analyze site traffic. Fumika integrates with Partytown to offload third-party scripts to a Web Worker, ensuring your site maintains optimal loading performance.

Currently, Fumika natively supports Google Analytics (GA4). Integration with Umami is planned for a future update.

To disable analytics completely, set enabled to false:

export const analyticsConfig: AnalyticsConfig = {
enabled: false,
};

Google Analytics#

To enable Google Analytics, set enabled to true and provide your GA4 Measurement ID in analyticsConfig:

export const analyticsConfig: AnalyticsConfig = {
enabled: true,
google: {
id: "G-XXXXXXXXXX",
},
};

If wanna disable it, set analyticsConfig like:

export const analyticsConfig: AnalyticsConfig = {
enabled: false,
};

Deployment Configuration#

Configure your site’s domain and base path in deployConfig:

export const deployConfig: DeployConfig = {
siteUrl: "https://example.com",
baseUrl: "/",
};

Keep baseUrl as "/" if you are deploying directly to the root domain like https://example.com.

Subpath Deployment Example

If your site is hosted at https://example.com/blog, configure deployConfig as follows:

export const deployConfig: DeployConfig = {
siteUrl: "https://example.com",
baseUrl: "/blog",
};
Configuration Guides for Fumika Site
https://fumika-demo.netlify.app/ja/posts/configuration/
著者
Fumika
公開日
2026-09-11
ライセンス
CC BY-NC-SA 4.0