Skip to content

fix: Avoid putting <body> inside <head> #738

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gadenbuie
Copy link

@gadenbuie gadenbuie commented Jun 4, 2025

Currently, the tidyverse site has some content that should be in the body of the page that's instead being placed in the <head> element via the header.html partial.

This causes some wonky HTML that's generally resolved by web browsers but introduces semantic errors that make it hard to use tools like markitdown to read the contents of the tidyverse blog.

This PR resolves those issues by moving the content from the header.html partial to the baseof.html partial.

While here, I also wrapped the main content in a <main> tag and replaced div.band with nav.band so that the header links are placed in an appropriate landmark area.

cc @t-kalinowski

@gadenbuie
Copy link
Author

Before

ragnar::read_as_markdown("https://www.tidyverse.org/blog/2025/05/ellmer-0-2-0/")
#> # ellmer 0.2.0
#> 
#> [Tidyverse](/)
#> 
#> [Packages](/packages/)
#> [Blog](/blog/)
#> [Learn](/learn/)
#> [Help](/help/)
#> [Contribute](/contribute/)

After

ragnar::read_as_markdown("https://deploy-preview-738--tidyverse-org.netlify.app/blog/2025/05/ellmer-0-2-0/")
#> # ellmer 0.2.0
#> 
#> [Tidyverse](/%20/)
#> 
#> [Packages](/packages/)
#> [Blog](/blog/)
#> [Learn](/learn/)
#> [Help](/help/)
#> [Contribute](/contribute/)
#> 
#> # ellmer 0.2.0
#> 
#> ![](/blog/2025/05/ellmer-0-2-0/thumbnail-wd.jpg)
#> 
#> Photo by [Nam Anh](https://unsplash.com/photos/elephant-walking-during-daytime-QJbyG6O0ick)
#> 
#>   2025/05/28
#> 
#> [ai](/tags/ai/),
#> [ellmer](/tags/ellmer/)
#> 
#> Hadley Wickham
#> 
#> # ellmer 0.2.0
#> 
#> I’m thrilled to announce the release of
#> [ellmer 0.2.0](https://ellmer.tidyverse.org)! ellmer is an R package designed to make it easy to use large language models (LLMs) from R. It supports a wide variety of providers (including OpenAI, Anthropic, Azure, Google, Snowflake, Databricks and many more), makes it easy to
#> [extract structured data](https://ellmer.tidyverse.org/articles/structured-data.html), and to give the LLM the ability to call R functions via
#> [tool calling](https://ellmer.tidyverse.org/articles/tool-calling.html).
#> 
#> You can install it from CRAN with:
#> 
#> ```
#> install.packages("ellmer")
#> ```
#> 
#> ...

@t-kalinowski
Copy link
Contributor

t-kalinowski commented Jun 4, 2025

If the navigational links appear outside the <main> tag, then read_as_markdown() (dev version) will omit them as well.

#> [Packages](/packages/)
#> [Blog](/blog/)
#> [Learn](/learn/)
#> [Help](/help/)
#> [Contribute](/contribute/)

@gadenbuie
Copy link
Author

If the navigational links appear outside the <main> tag,

They are outside the <main> tag, but there's also a #main on the page, which is higher up and includes the nav links. I tried taking that out, but it broke page styles and I didn't want to dig too far into the issue in this PR

@t-kalinowski
Copy link
Contributor

It already does the right thing with dev ragnar!

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