/Wiki/sources/honojs__hono/2026/https-hono-dev-llms-full-txt-file-extension-133f44ac7636-file-extension-s0749-c0000.md
File Extension - hono-docs
File Extension Source evidence: /Sources/raw/honojs hono/honojs hono.md Canonical citation: https://hono.dev/llms full.txt file extension Summary The file ex...
File Extension
Source evidence: /Sources/raw/honojshono/honojshono.md Canonical citation: https://hono.dev/llms-full.txt#file-extension
Summary
The file extension depends on the Content-Type returned by each route. For example, responses from c.html are saved as .html. If you want to customize the file extensions, set the extensionMap option. ```ts import { toSSG, defaul...
Content
The file extension depends on the Content-Type returned by each route. For example, responses from c.html are saved as .html.
If you want to customize the file extensions, set the extensionMap option.
import { toSSG, defaultExtensionMap } from 'hono/ssg'
// Save `application/x-html` content with `.html`
toSSG(app, fs, {
extensionMap: {
'application/x-html': 'html',
...defaultExtensionMap,
},
})Note that paths ending with a slash are saved as index.ext regardless of the extension.
// save to ./static/html/index.html
app.get('/html/', (c) => c.html('html'))
// save to ./static/text/index.txt
app.get('/text/', (c) => c.text('text'))