Skip to content

Conversation

@jepler
Copy link
Contributor

@jepler jepler commented Apr 1, 2024

Originally, both the RSS feed and the board list pages used the same board_image.html include; I added | absolute_url to this file for the RSS feed, which functions better when all links are absolute.

Using | absolute_url is preferable to just prepending https://circuitpython.org because it can give a correct URL when previewing locally with bundle run jekyll serve.

This crossed with a change by @makermelissa to switch the feeds to use a separate include, presumably (though I didn't specifically ask her about it) to avoid having the absoulute URLs where they were not needed.

In this commit, I remove the use of absolute_url in the include that's used to generate regular pages, while switching from prepending https://circuitpython.org to using | absolute_url on the include that is used just for the feed.

Originally, both the RSS feed and the board list pages used the same
board_image.html include; I added `| absolute_url` to this file for
the RSS feed, which functions better when all links are absolute.

Using `| absolute_url` is preferable to just prepending
`https://circuitpython.org` because it can give a correct URL when
previewing locally with `bundle run jekyll serve`.

This crossed with a change by @makermelissa to switch the feeds
to use a separate include, presumably (though I didn't specifically ask
her about it) to avoid having the absoulute URLs where they were not
needed.

In this commit, I remove the use of `absolute_url` in the include that's
used to generate regular pages, while switching from prepending
`https://circuitpython.org` to using `| absolute_url` on the include
that is used just for the feed.
@jepler jepler requested a review from makermelissa April 1, 2024 15:57
@jepler
Copy link
Contributor Author

jepler commented Apr 1, 2024

Tested locally, the download list page images work and are relative; the rss feed links are absolute links to localhost:4000.

@makermelissa
Copy link
Collaborator

Do you know if the absolute_url works for loading images locally? If so, you could probably just combine the 2 pieces of code.

@jepler
Copy link
Contributor Author

jepler commented Apr 1, 2024

Yes, unless I'm failing to understand something or my testing is insufficient, the "feed_board_image.html" from this issue include would work equally well for the board list pages from the point of view of a user.

In 'view source' you would see a redundant specification of the full URL of the images (img src="https://circuitpython.org/..." when viewing the published version, src=http://localhost:4000/... when testing locally with jekyll serve) so in a sense it's "less tidy", but it works the same.

If you want me to re-do this PR so that it re-combines the two include files I'm happy to do that. My assumption had been that since you split them out subsequent to my two PRs adding |absolute_url the first time that either you were encountering a problem with the version I had written, or you didn't want the redundant URLs in view-source.

@makermelissa
Copy link
Collaborator

If you want me to re-do this PR so that it re-combines the two include files I'm happy to do that. My assumption had been that since you split them out subsequent to my two PRs adding |absolute_url the first time that either you were encountering a problem with the version I had written, or you didn't want the redundant URLs in view-source.

Please do. I was just in a hurry as I was at the end of my day and it was the simplest way to make the change that I knew would work for certain.

After discussion, having an absolute URL in the generated HTML is just
fine.
@jepler
Copy link
Contributor Author

jepler commented Apr 1, 2024

Updated.

Copy link
Collaborator

@makermelissa makermelissa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks.

@makermelissa makermelissa merged commit 0d5b937 into adafruit:main Apr 1, 2024
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