Skip to content
Discussion options

You must be logged in to vote

You can't do what you want or your post-render script will also have to modify the HTML files.

Alternatively, you can have a pre-render script that does the setup for you, i.e., setting the output-file, see https://quarto.org/docs/projects/scripts.html#pre-and-post-render.

Below are two versions of the same script:

  • TypeScript
import * as fs from "node:fs";
import * as path from "node:path";

fs.readdirSync("content", { withFileTypes: true }).forEach((dirent) => {
  if (dirent.isDirectory()) {
    const metadataPath = path.join("content", dirent.name, "_metadata.yml");
    const metadataContent = `format:\n  html: default\n  pdf:\n    output-file: ${dirent.name}.pdf\n  docx:\n    output-…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by rputikar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants