Opened on 08/17/2017 at 04:57:07 PM

Last modified on 09/17/2019 at 12:27:03 PM

#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.

Attachments (0)

Change History (7)

comment:1 Changed on 08/17/2017 at 05:02:34 PM by juliandoucette

  • Blocking 5531 added

comment:2 follow-up: Changed on 08/22/2017 at 04:51:19 PM 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 on 08/22/2017 at 04:55:04 PM 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 on 08/22/2017 at 04:55:49 PM by juliandoucette

comment:4 Changed on 08/22/2017 at 05:05:15 PM 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 on 01/16/2018 at 12:37:00 PM by asmirnov

  • Blocking 6260 added

comment:6 Changed on 01/16/2018 at 12:37:14 PM by asmirnov

  • Blocking 6260 removed

comment:7 Changed on 09/17/2019 at 12:27:03 PM 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

Add Comment

Modify Ticket

Change Properties
Action
as new .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from (none).
Next status will be 'reviewing'.
 
Note: See TracTickets for help on using tickets.