Knowledge-Graphs-Book / HTML-Book

Other
36 stars 7 forks source link

Improve SEO for the KG book #48

Open Antoine-Zimmermann opened 1 year ago

Antoine-Zimmermann commented 1 year ago

The book is not visible enough in search engines. When I type "knowledge graphs", with or without quotes, with or without capital "K" and "G", in a search engine on a fresh, cookie-free browser, the book only comes very low in the result list. It's much worse when I use singular.

Antoine-Zimmermann commented 1 year ago

I think one reason is that the main title of the page (the <h1> is embedded in a <header> element, and the title is split into a structure <span>K</span>nowledge <span>G</span>raphs that may confuse web crawlers when indexing this. We should consider changing the structure of the title.

aidhog commented 1 year ago

Huge +1 to this, and I think it's of relatively high priority.

(Another probably more minor issue is that it is commonly believed that Google uses the site's loading times as a metric in ranking. But not sure there's much to be done there.)

Antoine-Zimmermann commented 1 year ago

For the loading time issue, one solution would be to split the book in pieces. Loading one chapter at a time is very fast.

Antoine-Zimmermann commented 1 year ago

The first letter of an element can be rendered differently in CSS using pseudo-element ::first-letter, but it is not possible to change the first letter of every words. A possibility to keep the same rendering would be:

<h1><span>Knowledge</span> <span>Graphs</span></h1>

and use CSS:

h1 span::first-letter {
    /* make letter large */
}
Antoine-Zimmermann commented 1 year ago

In fact, ::first-letter does not work on inline elements like span.

Antoine-Zimmermann commented 1 year ago

We can use the title that appears on the book cover as the main h1 title.

aidhog commented 1 year ago

I like the current rendering, but if it's affecting people finding the book, I would prioritise the SEO and just have "Knowledge Graphs" in the h1 without tags.

I guess the issue is we have no idea if it matters for SEO or not, just a suspicion that it might?

Antoine-Zimmermann commented 1 year ago

I think the SEO is not good not only because of the span element on the first letter, but also because the h1 is inside the header element. There can be multiple h1s as long as they are in different sections, but the main title should be at the root of the document, I suppose. We can use the text that is on top of the cover picture and move it to a h1, then turn the title with big majuscules into a normal div:

 <h1 id="booktitle">Knowledge Graphs</h1>  <!-- CSS to render it as the book title on top of the cover -->
 ...
 <div id="title"><div>Knowledge</div> <div>Graphs</div></div>  <!-- CSS such that the first letters of the `div`s look big -->

I will submit this in a pull request later today.

Antoine-Zimmermann commented 1 year ago

I made the changes and put merged in the main branch

Antoine-Zimmermann commented 3 months ago

The SEO is still extremely bad with Google. I can't find any result pointing to kgbook.org when I use knowledge graphs as a query. It's better in other search engines, but not good. I'm sure the overly long webpage is a big issue. In comparison, the multipage version that I created on my very low-page-ranked personal web space appears higher in the result list on Google.