Breaking change: .env replaced by project.conf + pandoc.yaml #2
lex57ukr
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What changed
The
.envconfiguration file has been removed and replaced by two purpose-built files:project.confpandoc.yamlThis is not a simple rename. The old
.envmixed operational plumbing with book content in a single flat file. The new structure separates these concerns entirely.Why we made this change
1. Unicode corruption
The previous system used environment variables from
.envas a fallback to inject metadata into Pandoc via-Mcommand-line flags (e.g.,-M author="François Müller"). Pandoc's CLI corrupts unicode characters passed through-Mflags. This caused garbled author names, titles, and descriptions for anyone using non-ASCII characters.By making
pandoc.yamlthe sole metadata source, Pandoc reads the YAML file natively — unicode is preserved perfectly.2. Single source of truth
The old system had a confusing dual-path: metadata could come from either
user-metadata.yamlor.envenvironment variables, with a fallback chain inpublish.sh. This made it unclear which file actually controlled your book's output. Now there is exactly one place for all book settings:pandoc.yaml.3. Cleaner separation of concerns
The old
.envcrammed together unrelated settings — your book's title sat next to Docker container naming. The new split puts operational plumbing inproject.conf(you set this once and forget it) and everything about your book's content and appearance inpandoc.yaml.4. Better discoverability
pandoc.yamlis a well-commented YAML file with references to Pandoc documentation. Settings likepapersize,geometry,fontfamily, andcover-imageare documented inline with accepted values and examples — no more guessing atKEYSTONE_LATEX_GEOMETRYvariable names.How to migrate your existing project
Step 1: Rebuild your Docker image
The updated
publish.shinside the container expects the new configuration files. You must rebuild your local image to pick up these changes:This runs
docker compose buildand bakes the newpublish.shinto your project's image. Builds will fail if you skip this step — the old image still expects.envenvironment variables for metadata.Step 2: Create
project.confIn your project root (next to where
.envused to be), createproject.conf:Replace
my-bookwith whatever you had asKEYSTONE_PROJECTin your old.env.Step 3: Create
pandoc.yamlCreate
pandoc.yamlin your project root. Move your book metadata from the old.envvariables into YAML format:Here's how the old
.envvariables map topandoc.yamlfields:.envvariablepandoc.yamlfieldKEYSTONE_TITLEtitleKEYSTONE_SUBTITLEsubtitleKEYSTONE_AUTHORauthorKEYSTONE_DATEdateKEYSTONE_FOOTER_COPYRIGHTfooter-copyrightKEYSTONE_DESCRIPTIONdescriptionKEYSTONE_KEYWORDSkeywords(YAML list)KEYSTONE_LATEX_PAPERSIZEpapersizeKEYSTONE_LATEX_GEOMETRYgeometryKEYSTONE_LATEX_FONTSIZEfontsizeKEYSTONE_LATEX_FONTFAMILYfontfamilyKEYSTONE_COVER_IMAGEcover-imageStep 4: Update
MakefileOpen your
Makefileand change theincludeline near the top:Also update every line that references
.envas the--env-fileflag. Look for theDCvariable and change it:Step 5: Update
docker-compose.yamlIn your
.docker/docker-compose.yaml, make two changes:Update
env_fileto point toproject.confinstead of.env:Add the
pandoc.yamlbind mount to thevolumessection:This mounts your
pandoc.yamlas the metadata file Pandoc reads inside the container.Step 6: Delete
.envOnce you've verified your new files are in place, remove the old
.env:Step 7: Build and verify
Run your usual build command (
make publish,make all, etc.) and verify the output looks correct.Important notes
pandoc.yamlmust not be empty. The build will hard-fail if the file exists but is empty. It must contain at least your book's title and author.cover-imagemust be commented out if unused. Settingcover-image:with no value (YAML null) will crash EPUB builds. Comment out the line entirely if you don't have a cover image.pandoc.yaml.Questions?
If you run into any issues migrating, please open a discussion in the Q&A category and we'll help you out.
Beta Was this translation helpful? Give feedback.
All reactions