Table of Contents
Defined in: packages/astro-friday/src/config.ts:262
NOTE: When passing functions as configuration values, they must be context-independent. This means all variables used within the function scope must be either:
- Parameters of the function
- Variables declared inside the function
- Built-in globals (e.g., console, Date, etc.)
Functions cannot access variables from the outer scope where they are defined, as they will be serialized and executed in a different context.
✅ Good example:
og: (entry) => {
const title = entry.data.title || 'Default Title'
return [title, { width: 1200, height: 630 }]
}❌ Bad example:
const defaultTitle = 'My Site'
og: (entry) => {
const title = entry.data.title || defaultTitle // ❌ defaultTitle is not available
return [title, { width: 1200, height: 630 }]
}Properties
advanced?
optional advanced: object;Defined in: packages/astro-friday/src/config.ts:664
Advanced configuration options for power using.
functionCodeReplace?
optional functionCodeReplace: object[];Function code replacement configuration for advanced using.
When passing functions as configuration values, you might want to replace certain code snippets.
Like we can solve the __vite_ssr_dynamic_import__ is not defined issue
by replacing __vite_ssr_dynamic_import__("node:fs") with
import("node:fs") when building.
Example
advanced: {
functionCodeReplace: [
{
api: 'replaceAll',
parameters: ['__vite_ssr_dynamic_import__("node:', 'import("node:'],
},
],
}appearance?
optional appearance: Appearance | "dynamic" | "plain";Defined in: packages/astro-friday/src/config.ts:560
The appearance (theme) toggle behavior
plain: simply toggle between light and dark modedynamic: toggle with a dynamic circular reveal effect- custom function: provide your own implementation
Default
'dynamic'art?
optional art: Partial<Record<"dots" | "plum", Partial<ArtConfig>>>;Defined in: packages/astro-friday/src/config.ts:550
Page background art configuration, there are two styles available: dots and plum.
Forked from antfu.me
author?
optional author: object;Defined in: packages/astro-friday/src/config.ts:282
The author information, used in the footer and SEO metadata.
avatar?
optional avatar: string;The author’s avatar image URL.
NOTE currently not used
email?
optional email: string;The author’s email address.
NOTE currently not used
name?
optional name: string;The author’s name.
url?
optional url: string;The author’s website URL.
NOTE currently not used
collections?
optional collections: Record<string, {
glob: GlobOptions & object;
label?: string;
}>;Defined in: packages/astro-friday/src/config.ts:495
Define content collections
currently just glob loader supported, collections[key].glob
components?
optional components: object;Defined in: packages/astro-friday/src/config.ts:582
Default components mapping, can be overridden by user config
NavbarBrand?
optional NavbarBrand: string;The component used for the brand/logo area in the navbar.
Example
components: {
NavbarBrand: 'src/components/YourBrand.astro',
}copyright?
optional copyright: object;Defined in: packages/astro-friday/src/config.ts:309
The copyright information, used in the footer.
copyrightYears?
optional copyrightYears: string;The copyright years, e.g. 2022 or 2020-2024.
Default
current yearlicense?
optional license: object;The license information
license.type
type: string;The license type
Default
'CC BY-NC-SA 4.0'license.url
url: string;The license URL.
Default
'https://creativecommons.org/licenses/by-nc-sa/4.0/'description?
optional description: string;Defined in: packages/astro-friday/src/config.ts:270
The site description, used in SEO metadata.
imports?
optional imports: object;Defined in: packages/astro-friday/src/config.ts:566
Custom the path of function imports
@vercel/og?
optional @vercel/og: string;Default
'@vercel/og'See
https://byronogis.github.io/astro-friday/post/custom-og-middleware-handler
integrations?
optional integrations: object;Defined in: packages/astro-friday/src/config.ts:610
Integrations configuration, you can configure or disable built-in integrations here.
mdx?
optional mdx: false | Partial<MdxOptions>;MDX integration using @astrojs/mdx.
See
https://docs.astro.build/en/guides/integrations-guide/mdx/
nprogress?
optional nprogress: false | Config;Nprogress using in astro while the astro view transition is enabled.
See
https://github.com/byronogis/astro-nprogress
robotsTxt?
optional robotsTxt: false | RobotsTxtOptions;Custom robots.txt entries, will be appended to the generated robots.txt file.
Default
- User-agent: * Allow: /
- Remote: https://raw.githubusercontent.com/ai-robots-txt/ai.robots.txt/main/robots.txt
- Sitemap: <your-site-url>/sitemap-index.xmlrss?
optional rss: Partial<RSSOptions>;seo?
optional seo: any;SEO configuration for astro-seo integration
See
Priority: default build-in < config < specific page build-in
default build-in:
- https://github.com/byronogis/astro-friday/blob/30e444d5b11dffb70bc5a2036eb83c80ef6bd200/packages/astro-friday/src/components/HeadContent.astro#L17-L29 specific page build-in:
- https://github.com/byronogis/astro-friday/blob/30e444d5b11dffb70bc5a2036eb83c80ef6bd200/packages/astro-friday/src/routes/post/%5B…slug%5D.astro#L35-L65
sitemap?
optional sitemap: false | SitemapOptions;Sitemap generation using @astrojs/sitemap integration.
See
https://docs.astro.build/en/guides/integrations-guide/sitemap/
logo?
optional logo: object;Defined in: packages/astro-friday/src/config.ts:537
Logo configuration, used in the browser tab and top left corner of the navbar.
NOTE: if you set a custom display in navbar, you might also want to override the NavbarBrand component in components config
url?
optional url: string;override the default logo image path
Example
'/favicon.svg'navigations?
optional navigations:
| Partial<Record<"post" | "series" | "tag" | "theme-toggle" | "project", Partial<NavItem>>>
| {
[key: string]: NavItem;
};Defined in: packages/astro-friday/src/config.ts:521
Navigation items, used in the navbar.
You can override the built-in navs: post, tag, series, theme-toggle, project,
also can define your own navigation items.
Example
navigations: {
// override built-in post nav
post: { label: 'Blog' },
// define your own nav
github: { label: 'Github', icon: 'i-lucide:github', external: true, link: 'https://github.com/your-repo' }
}pages?
optional pages: Partial<Record<"404" | "home" | "rss_xml", false | InjectedRoute>>;Defined in: packages/astro-friday/src/config.ts:531
Custom pages configuration, you can disable built-in pages by setting the value to false
or override the default route by providing your own pattern and entrypoint.
Default home page is the post list page of all collections, you can also set it to a custom page.
See
https://byronogis.github.io/astro-friday/post/custom-homepage
post?
optional post: object;Defined in: packages/astro-friday/src/config.ts:337
Post related configuration
date?
optional date: object;Control the date display infos in post list and post page.
date.formats?
optional formats: object;The date format string, using dayjs format.
date.formats.long?
optional long: string;The long date format, used in post page.
Default
'MMM D, YYYY'date.formats.short?
optional short: string;The short date format, used in post list.
Default
'MMM D'date.key?
optional key: "created" | "modified";Which frontmatter field to use as the date source.
Default
'created'export?
optional export: object;Post export options
export.md?
optional md:
| false
| {
rehypeParse?: Options;
rehypeRemark?: Options;
remarkGfm?: Options;
remarkStringify?: Options;
};Markdown export options, you can customize the markdown export behavior here.
Set to false to disable markdown export.
We using unified with rehype and remark plugins to convert HTML back to Markdown. You can pass options to the underlying plugins here.
Type Declaration
false
{
rehypeParse?: Options;
rehypeRemark?: Options;
remarkGfm?: Options;
remarkStringify?: Options;
}frontmatterKeys?
optional frontmatterKeys: Partial<Record<FrontmatterKeysInternal, string>>;frontmatter keys mapping to Schema fields
Like if you want to use date instead of created in frontmatter,
you can set { created = 'date' } here.
The defaults is same as the field names.
#### lang?
```ts
optional lang: object;Post can be written in multiple languages, and to switch between these languages in the post page.
lang.collapse?
optional collapse: boolean;If set to true, just display a default language version post in post list.
lang.collapseFallbackLangCodes?
optional collapseFallbackLangCodes: string[];If collapse is true, and the post has no version for the default language,
you can specify fallback language codes here to find a suitable version.
lang.default?
optional default: string;The default language code for posts without a specified language.
Default
'en'lang.langs?
optional langs: object;You can also define more information for each language here.
Index Signature
[key: string]: objectog()?
optional og: (entry, config) => [ReactElement, ImageOptions & ResponseInit];Open Graph (OG) metadata for social media sharing
NOTE: You can access the frontmatter from entry.data, e.g. entry.data.title
Parameters
entry
CollectionEntry
config
Returns
[ReactElement, ImageOptions & ResponseInit]
pathStyle?
optional pathStyle: "id" | "collection/id";Path style for post routes
collection/id:/post/collection/id, e.g./post/blog/my-first-postid:/post/id, e.g./post/my-first-post
Maybe you want a premalike like /post/my-first-post instead of /post/blog/my-first-post
See
https://byronogis.github.io/astro-friday/post/making-permalinks-to-posts
Default
'collection/id'sort?
optional sort: "created-desc" | "created-asc" | "modified-desc" | "modified-asc";Sort order for the posts.
By default, posts are sorted by created date in descending order (newest first).
- ‘created-desc’: Sort by created date in descending order (newest first).
- ‘created-asc’: Sort by created date in ascending order (oldest first).
- ‘modified-desc’: Sort by modified date in descending order (newest first).
- ‘modified-asc’: Sort by modified date in ascending order (oldest first).
Default
'created-desc'toc?
optional toc: Partial<
| {
enable?: boolean;
range?: [number, number];
}
| undefined>;Table of contents (TOC) generation for all content
NOTE: this is just a default config for all content, can be overridden in specific content frontmatter
Default
{ enable: true, range: [2, 4] }postcss?
optional postcss: object;Defined in: packages/astro-friday/src/config.ts:603
Built-in PostCSS plugins configuration options
postcssGlobalData?
optional postcssGlobalData: pluginOptions;postcssPresetEnv?
optional postcssPresetEnv: pluginOptions;prefix?
optional prefix: string;Defined in: packages/astro-friday/src/config.ts:278
The prefix for all built-in routes, e.g. /post, /tag, /series.
Default
’/’ mean no prefix, e.g. /post
Example
'/content' will make routes like `/content/post`processors?
optional processors: object;Defined in: packages/astro-friday/src/config.ts:487
Processors to process each content entry
processorId?
optional processorId: ProcessorIdOptions;Ensure the entry has an ID in the frontmatter.
processorLangs?
optional processorLangs: ProcessorLangsOptions;Automatically set the langs codes for the entry.
processorPermalink?
optional processorPermalink: ProcessorPermalinkOptions;Generate a permalink for the entry.
processorTitle?
optional processorTitle: ProcessorTitleOptions;A processor to set the title of an entry based on its file name if not already set.
processorUpdateModifiedTime?
optional processorUpdateModifiedTime: ProcessorUpdateModifiedTimeOptions;With this processor, you can automatically update the modified frontmatter
key of your markdown files to reflect their last modified time.
projects?
optional projects: ProjectItem[];Defined in: packages/astro-friday/src/config.ts:660
Project showcase items, used in the /project page.
A page route for /project will be automatically created if there are more than 0 projects defined.
Default
[]title?
optional title: string;Defined in: packages/astro-friday/src/config.ts:266
The site title, used in the navbar and SEO metadata.
viewTransition?
optional viewTransition: object;Defined in: packages/astro-friday/src/config.ts:593
View transition functionality configuration
enable?
optional enable: boolean;Enable or disable view transitions for page navigation.
Default
true