mystmd icon indicating copy to clipboard operation
mystmd copied to clipboard

Inconsistent treatment of `downloads` across themes

Open fwkoch opened this issue 1 year ago • 2 comments

downloads were recently added to myst-frontmatter as a way to specify specific files / urls you want available as downloads from your MyST site. From a frontmatter validation point of view, these can be defined in project config or page frontmatter.

However, the two MyST site themes have different behavior:

article-theme centers the "project" around a single article; this theme only picks up downloads from the project config in myst.yml. (See here: https://github.com/executablebooks/myst-theme/blob/main/themes/article/app/components/Downloads.tsx#L22 - downloads come from project)

book-theme treats each article equally, so central project downloads are ignored, in favor of downloads defined in page frontmatter. (See here: https://github.com/executablebooks/myst-theme/blob/main/packages/frontmatter/src/FrontmatterBlock.tsx#L209 - downloads come from frontmatter)

Expected behavior

If I provide downloads in either place, they show up in either theme!

fwkoch avatar Apr 10 '24 23:04 fwkoch

I had some conversations with @choldgraf on this, the project downloads are now shown in the book-theme unless you override them on the page. The article-theme needs to be updated I think still!

rowanc1 avatar Apr 11 '24 03:04 rowanc1

isn't it perfectly reasonable for different themes to have different behaviour? they are intended to build different things not to be interchangeable on a given set of content.

I can see why adding the central downloads to the book-theme makes sense, and that behaviour seems ok, but what would be the intended changes/behaviour on article-theme it incorporate page downloads?

stevejpurves avatar Apr 11 '24 07:04 stevejpurves