The following section is an overview of basic configuration for .
Most of the options discussed are specific to , for the rest of the available configuration options please check Vite's config reference.
You can configure Vite.js as usual using vite.config.ts, check Vite's plugins and config reference.
Alternatively, you can provide a vite option in iles.config.ts with the same options.
import { defineConfig } from 'iles'
export default defineConfig({
vite: {
plugins: [],
},
})Visit the Plugins section for more details about the pre-configured Vite.js plugins.
You may provide an iles.config.ts configuration file to customize settings
related to markdown, component resolution, and other îles-specific features.
You can leverage your IDE's intellisense with jsdoc type hints or use the defineConfig helper:
import { defineConfig } from 'iles'
export default defineConfig({
siteUrl: 'https://iles-docs.netlify.app',
jsx: 'preact',
})draftsbooleantrue in development, false when buildingWhether to include drafts in pages and documents.
By default drafts will be displayed during development, but will be excluded when building the site.
When disabled, drafts will also be excluded from useDocuments.
modulesIlesModuleOption[]modules to apply in the site. Read the Plugins and Modules guide.
turbo (experimental)booleanfalseWhether to enable SPA-like navigation for the site. See the guide for Turbo.
jsx'vue' | 'preact' | 'solid''vue'Which framework to use to compile .jsx and .tsx files.
prettyUrlsbooleantrueWhether to skip .html and trailing slashes in link hrefs and router paths.
Set
prettyUrls: falseto simplify the migration of an existing VitePress site without having to add redirects, or when deploying on services that don't support pretty urls (most do).
ssgOptions applied during site generation when running iles build.
ssg.beforePageRenderasync (page: RouteToRender, config: AppConfig) => RouteToRender | voidThis hook will be invoked before îles renders a page.
Modify
page.renderedto alter the content of the page as needed.
ssg.onSiteRenderedasync ({ pages: RouteToRender[], config: AppConfig }) => voidThis hook will be invoked once îles has rendered the entire site.
ssg.manualChunksAllows to configure how JS chunks for islands should be grouped.
ssg.sitemap booleantrueWhether to generate a sitemap and reference it using a meta tag in all pages.
You must provide siteUrl to enable sitemap generation.
siteUrlstringURL for the site in production, used to generate absolute URLs for the sitemap and social meta tags.
When set, it is exposed as
site.urlandsite.canonical.
debugboolean | 'log'trueWhether to output more information about islands and hydration in development.
will pre-configure a Vue 3 app that will load any pages defined in the site.
You may provide additional configuration in src/app.ts, and leverage
intellisense by using the defineApp helper.
import { defineApp } from 'iles'
export default defineApp({
head ({ frontmatter, site }) {
return {
meta: [
{ property: 'author', content: site.author },
{ property: 'keywords', content: computed(() => frontmatter.tags) },
]
}
},
enhanceApp ({ app, head, router }) {
// Configure the app to add plugins.
},
router: {
scrollBehavior (current, previous, savedPosition) {
// Configure the scroll behavior
},
},
})headHeadObject | (context: AppContext) => HeadObjectSet the page title, meta tags, additional CSS, or scripts using @vueuse/head.
enhanceApp(context: AppContext) => Promise<void>A hook where you can add plugins to the Vue app, or do anything else prior to the app being mounted.
mdxComponentsMDXComponents | (context: AppContext) => MDXComponentsProvide an object that maps tag names in MDX to components to render.
import { defineApp } from 'iles'
import Image from '~/components/Image.vue'
export default defineApp({
mdxComponents: {
b: 'strong',
img: Image,
},
})routerRouterOptionsConfigure vue-router by providing options such as scrollBehavior and linkActiveClass.
socialTagsbooleantrueSome social tags can be inferred from the site.
Set it to false to avoid adding social tags such as og:title and twitter:description.
iles.config.ts Exampleimport { defineConfig } from 'iles'
import windicss from 'vite-plugin-windicss'
export default defineConfig({
siteUrl: 'https://iles-docs.netlify.app',
extendFrontmatter (frontmatter, filename) {
if (filename.includes('/posts/'))
frontmatter.layout = 'post'
},
markdown: {
remarkPlugins: [
'remark-gemoji',
],
},
modules: [
'@islands/icons',
'@islands/headings',
'@islands/prism',
],
vite: {
plugins: [
windicss(),
],
},
})