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

Fallback to first bigimg when JavaScript disabled #456

Merged

Conversation

WJBarnes456
Copy link
Contributor

Solves #455 by statically configuring the page source to use the source and description of the first image in bigimg. When the description is empty, also pre-hides the description box.

When JavaScript is enabled, this theme's main.js
(https://github.com/halogenica/beautifulhugo/blob/master/static/js/main.js) takes over and will overwrite this style attribute, changing the image in use.

Solves halogenica#455 by statically
configuring the page source to use the source and description of the first image
in bigimg. When the description is empty, also pre-hides the description box.

When JavaScript is enabled, this theme's main.js
(https://github.com/halogenica/beautifulhugo/blob/master/static/js/main.js)
takes over and will overwrite this style attribute, changing the image in use.
@WJBarnes456
Copy link
Contributor Author

I'm happy with the no-JS version not including the link rendering, but there's a very simple extension to render all Markdown in the desc attribute by piping $firstimg.desc into markdownify.

This would then introduce a feature disparity the other way around; I'm not sure if that's preferable or not, so I've omitted it from the PR.

@henryiii henryiii merged commit f0ff519 into halogenica:master Jun 19, 2023
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