rspec / rspec.github.io

source for rspec.info
http://rspec.info/
Other
15 stars 41 forks source link

Most documentation pages have empty `<title>` tags #205

Open davidjb opened 4 months ago

davidjb commented 4 months ago

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.

JonRowe commented 4 months ago

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.

davidjb commented 4 months ago

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.

JonRowe commented 4 months ago

Those are indeed autogenerated pages