```ts
export function greet(name: string): string {
return `Hello, ${name}`
}
```export function greet(name: string): string {
return `Hello, ${name}`
}Without a language
```
Plain text without highlighting.
```Plain text without highlighting.
With a title
A title= after the language puts a label above the block — handy for naming the file the excerpt
belongs to.
```yaml title="quartz.config.yaml"
configuration:
pageTitle: Example
```configuration:
pageTitle: ExampleLong lines
A code block does not wrap long lines, it scrolls: breaking a shell command costs more than scrolling it.
npx quartz build --serve --port 8080 --wsPort 3001 --bundleInfo --verbose --directory contentIn this template
Three differences from the default:
- The language sits at the top left of the block, as an
::afterin the stylesheet — so it does not end up in a copy. - The copy button is 44 px across and appears on hover, on focus and permanently on devices without a pointer. Out of the box it is only visible on hover and therefore unreachable on a smartphone.
- The background comes from the template, not from the syntax theme:
keepBackground: falsemakes shiki set only the colours of the characters. That way the block fits in both colour schemes.