Opened 2 years ago

Last modified 3 months ago

#5530 new change

Allow canonical link override in page front-matter

Reported by: juliandoucette Assignee:
Priority: P3 Milestone:
Module: Sitescripts Keywords:
Cc: kvas, jsonesen, wspee, ire, greiner, saroyanm, lisabielik Blocked By:
Blocking: #5531 Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description (last modified by kvas)

Background

  • get_canonical_url was implemented in #5343
  • this solution was not ideal for adblockplus.org because adblockplus.org contains one home page per browser that is served/redirected based on UA sniffing e.g. "index" -> "chrome", "index" -> "firefox" based on chrome/firefox UA

What to change

Allow the canonical url (specifically, the page that is used to derive the canonical url) to be overridden in page front-matter e.g.

example.md

<!--
title=Example
canonical_page=another_page
-->

In this example get_canonical_url('example') would return https://foo.bar/another_page instead of https://foo.bar/example.

Note: if another_page also overrides canonical_page, get_canonical_url() should follow that as well, until we get to a page that doesn't want to override it.

Change History (7)

comment:1 Changed 2 years ago by juliandoucette

  • Blocking 5531 added

comment:2 follow-up: Changed 2 years ago by kvas

canonical=index

This variable name is not very specific. What do you think about canonical_page=index (that would ask get_canonical_url to calculate canonical url for that page instead) or canonical_url=/ (that would force the canonical url to a certain value, that would be prefixed with site_url unless it's a full url) or perhaps supporting both of these options?

comment:3 in reply to: ↑ 2 Changed 2 years ago by juliandoucette

Replying to kvas:

canonical=index

This variable name is not very specific. What do you think about canonical_page=index (that would ask get_canonical_url to calculate canonical url for that page instead) or canonical_url=/ (that would force the canonical url to a certain value, that would be prefixed with site_url unless it's a full url) or perhaps supporting both of these options?

Both are fine with me. And/But canonical_page would be ideal for abp.org currently.

Last edited 2 years ago by juliandoucette (previous) (diff)

comment:4 Changed 2 years ago by kvas

  • Description modified (diff)
  • Priority changed from Unknown to P3
  • Ready set

Ok, I guess let's implement just canonical_page for now. Adding canonical_url later would be easy if we need it.

comment:5 Changed 2 years ago by asmirnov

  • Blocking 6260 added

comment:6 Changed 2 years ago by asmirnov

  • Blocking 6260 removed

comment:7 Changed 3 months ago by kvas

Dear stakeholders of this ticket,

I'm cleaning up Sitescripts tickets in Trac due to its phase out. This is one of the tickets that I could not myself close or move, so I need your input on it.

Please let me know if this ticket is still relevant for you and we can then discuss where it should be moved. If you think that this ticket is no longer relevant, you can write a comment explaining this or just ignore this message.

If I see now comments in the ticket on October 14, I will close it as rejected.

Best regards,
Vasily

Note: See TracTickets for help on using tickets.