Improve technical SEO: canonical URL, title, language, description and structured data

Open
#521 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
html, javascript
Domain
search, web-dev

Research direction

Start with index.php and data/themes/default/hypha.html, then read related issues #78, #365, and #376 for existing title, language, and description work. The issue also calls for canonical URLs and NewsArticle structured data, so identify the page and article metadata paths before estimating implementation. Done means pages expose the requested canonical URL, page title, content language, description and social description, and peer reviewed articles include the specified structured data.

Written by the indexing model from the issue text.

Description

Impact: High Level: Moderate Pagetype: Peer reviewed article Type: Enhancement Usecase: De Stadsbron Value: Visitors

Search engines get little or misleading information from Hypha pages. This costs De Stadsbron search traffic.

Canonical URLs

The same page is reachable through several URLs; the home page of De Stadsbron, for example, through 4 different URLs. Search engines split ranking over these duplicates.

  • Add <link rel="canonical" href="..."> to every page, using one preferred URL (https, with language, lower case)
  • Optionally redirect the non-preferred variants with a 301 (see #274, #247)
Page title

index.php sets the <title> to the site title only ($hyphaHtml->setTitle(hypha_getTitle())), so every page is titled "De Stadsbron".

  • Set the title to <page or article title> | <site title>, and only the site title on the home page (see #78)
Language

The default theme (data/themes/default/hypha.html) has an <html> element without a lang attribute.

  • Set lang to the content language of the current page, not the interface language (see #365)
Meta description

Pages have no <meta name="description">, so search engines and social media choose a random fragment.

  • Use the excerpt of an article, or an optional "Search engine description" field
  • Fall back to the first ~155 characters of the text
  • Reuse the same text for og:description (see #376)
Structured data

Search engines cannot tell who wrote an article, when it was published and whether it has comments.

  • Add a <script type="application/ld+json"> block with a NewsArticle for peer reviewed articles, containing headline, author, datePublished, dateModified, image, publisher and commentCount (optionally the comments as Comment)

Related: #78, #115, #138, #247, #274, #365, #374, #375, #376, #401

Origin: meeting on the future of Hypha (De Stadsbron).

Dominant language
JavaScript
Stars
5
Forks
9
Avg merge
18h 49m
Merged PRs (30d)
13

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PlanBCode/hypha

All issues in PlanBCode/hypha

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.