mbutterick / pollen-users

please use https://forums.matthewbutterick.com/c/typesetting/ instead
https://forums.matthewbutterick.com/c/typesetting/
52 stars 0 forks source link

Pollen report: two websites, one source #17

Closed mbutterick closed 4 years ago

mbutterick commented 4 years ago

I recently did something with Pollen I hadn’t tried before: collapsing my websites Practical Typography and Typography for Lawyers into one set of source files.

I use the environment variable pub=tfl or pub=bpt to determine which target to use in a writing or rendering session. Then I have tag functions called tfl and bpt that are shown in one publication and not the other, so I write branching sentences like

This is commonly used by ◊tfl{lawyers}◊bpt{writers}.

I also use the pub environment variable in the setup submodule to set a different default pagetree and publishing directory. Aside from a few other minor housekeeping details, that’s about it.

The only shortcoming I’ve found is that having two projects “duplexed” in this way defeats the page-rendering cache (that is, when you switch from one publication to another, you have to reset all the rendered HTML files). However, the compile caches work correctly, since Pollen keeps separate caches for each value of pub (once I added pub to the envvar-watchlist)

sorawee commented 4 years ago

I did the same with my (kinda defunct) webpage, to support multi-languages. I find it much easier to keep stuff in sync with this way. And common content (equation and code) is also shared.