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

Generate absolute URLs automatically #1378

Merged
merged 1 commit into from
Mar 30, 2024
Merged

Conversation

jepler
Copy link
Member

@jepler jepler commented Mar 30, 2024

This allows a localhost:4000-style URL to be generated for local testing, but still gives an absolute URL, which enhances compatibility with RSS readers. A comment is added explaining the reason for the absolute URL.

Closes #1374

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

This now has merge conflicts due to merging #1375. But I am confused too: where does absolute_url come from?

This allows a `localhost:4000`-style URL to be generated for local
testing, but still gives an absolute URL, which enhances compatibility
with RSS readers. A comment is added explaining the reason for the
absolute URL.

Closes adafruit#1374
Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

OK, I see absolute_url is predefined, apparently. I'll approve this. Could you merge when you are ready to check the result immediately? Thanks.

@jepler
Copy link
Member Author

jepler commented Mar 30, 2024

absolute_url: https://jekyllrb.com/docs/liquid/filters/#absolute-url

let's do this now if you're able

@jepler jepler merged commit 7383164 into adafruit:main Mar 30, 2024
2 checks passed
@jepler
Copy link
Member Author

jepler commented Mar 30, 2024

generation looks good

  <!-- (uses an absolute URL for better compatibility with RSS readers -->
  <img srcset="https://circuitpython.org/assets/images/boards/small/raspberry_pi_pico.jpg 300w,
               https://circuitpython.org/assets/images/boards/large/raspberry_pi_pico.jpg 700w" sizes="(max-width: 1024px) 700px,
              300px" src="/assets/images/boards/large/raspberry_pi_pico.jpg" alt="Image of Board" loading="lazy">

@jepler
Copy link
Member Author

jepler commented Mar 30, 2024

hmm I lost the | absolute_url on the src=, oops

@makermelissa
Copy link
Collaborator

hmm I lost the | absolute_url on the src=, oops

You may need to point https://github.com/adafruit/circuitpython-org/blob/main/feed.html#L20 to board_image.html rather than feed_board_image.html.

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.

Incorrect location of images when testing locally
3 participants