Problem/Motivation

The module has an endpoint that serves the front page, and which node that is comes from its own setting — special_page_nodes.frontpage. The normalizer, however, decides whether the thing it is describing is the front page by comparing the alias against system.site.page.front, which is Drupal's setting for its own HTML site.

On a decoupled site those are two different questions with two different answers. Drupal's front page is whatever the site was installed with and nobody has any reason to change it, because nobody browses Drupal. The front end's front page is the node the module was told about. When they disagree, the front-page endpoint answers with the alias of the node instead of /:

"locales": {
  "current_language": "en",
  "current_locale": "/bench-page",
  "en": "/bench-page"
},
"metatags": {
  "canonical": "/bench-page",
  "og_url": "/bench-page",
  "alternate": [
    {"hreflang": "x-default", "href": "https://example.com/bench-page"}
  ]
}

A front end that puts that in <link rel="canonical"> tells search engines the home page lives at two addresses.

Steps to reproduce

  1. Name a node in special_page_nodes.frontpage, and leave system.site.page.front at whatever the installer set.
  2. Request the front-page endpoint.
  3. locales.current_locale, metatags.canonical, metatags.og_url and every alternate href carry the alias of the node rather than /.

Proposed resolution

  • Collect the front pages from the node named by special_page_nodes.frontpage, per language, and keep reading system.site.page.front as well: a site that has aligned the two must keep working, and a site that serves both a Drupal front page and a decoupled one has two right answers.
  • Cover it: the endpoint answers / for the node it was told about, whether or not Drupal names the same one, and a site that names neither is unchanged.

Remaining tasks

Everything.

Issue fork myrest-3623211

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

sergeydruua created an issue. See original summary.

  • sergeydruua committed 7e450ab3 on 1.0.x
    Issue #3623211: Treat the node named for the front page as the front...
sergeydruua’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

sergeydruua’s picture

Status: Fixed » Closed (fixed)