rspec.github.io icon indicating copy to clipboard operation
rspec.github.io copied to clipboard

Most documentation pages have empty `<title>` tags

Open davidjb opened this issue 1 year ago • 3 comments

I noticed that in web search results, results from rspec.info have empty titles (or show inconsistent text), making it unclear what's on each page. The cause is that the <title> tags are empty for most pages, except those with frontmatter (e.g. #32).

If the first H1 could be used as the default for the title in the absence of frontmatter, that should solve the issue without having to add titles to every page manually.

Either way, ensuring pages have titles is useful for both accessibility and search engines and would be a real help to be added to the RSpec docs.

davidjb avatar May 26 '24 23:05 davidjb

I assume you're talking about the gherkin documentation seeing as I think all of the original pages have titles, this is certainly an area that can use improvement as it was hastily generated after relish went away, we're using a tool to generate the md files which fufilled the task of "not having to write from scratch" gherkin2markdown so manually adding frontmatter isn't really an option as it would be a nightmare to maintain, using the first h1 is an interesting idea but someone would probably have to write a plugin for middleman to make that happen.

JonRowe avatar May 27 '24 11:05 JonRowe

Apologies, I realise I didn’t include an example URL: https://rspec.info/features/3-13/rspec-core/helper-methods/let/ and https://rspec.info/features/6-1/rspec-rails/matchers/ were two pages I noticed it happening on recently: the search engine result titles didn’t align with the URLs & content.

davidjb avatar May 27 '24 11:05 davidjb

Those are indeed autogenerated pages

JonRowe avatar May 27 '24 12:05 JonRowe