Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📥 Add downloads to page/project frontmatter and site config #1049

Merged
merged 12 commits into from
Apr 5, 2024

Conversation

fwkoch
Copy link
Collaborator

@fwkoch fwkoch commented Apr 3, 2024

Previously, when you built a MyST site, all the exports defined on a page became Downloads and there was no other way to define additional or different downloads.

This PR adds downloads to page/project frontmatter as a place to specify (1) paths to local files and/or (2) export id values. Then, when you build your site, no longer do all the exports show up as downloads but only the specific downloads you specify.

This also makes improvements to site actions outlined here: #1048

@fwkoch
Copy link
Collaborator Author

fwkoch commented Apr 3, 2024

TODO: Enable assigning a title on each download, as an alternative to the file name. We do not currently allow this for page exports, so maybe it can be an enhancement in a separate PR? But we do allow it for site actions so there is some precedent.

@stevejpurves
Copy link
Contributor

stevejpurves commented Apr 3, 2024

Adding a title is definitely a good idea, currently with just exports themes are left to guess at what to put on the UI (https://github.com/executablebooks/myst-theme/blob/ef36c695035ae6895e7d022c9d00c5016d6c6c8e/themes/article/app/components/Downloads.tsx#L4) and with arbitrary downloads adding the filename is not a good option. So a title will benefit the themes well in both cases 👍

@fwkoch
Copy link
Collaborator Author

fwkoch commented Apr 5, 2024

One last thing this needs is differentiation between downloads: undefined and downloads: [] - Pretty sure currently those both coerce to [] on the site config; we need to make sure we keep the differentiation.

@fwkoch fwkoch merged commit c38cc28 into main Apr 5, 2024
4 checks passed
@fwkoch fwkoch deleted the feat/page-downloads branch April 5, 2024 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants