jumph4x/canonical-rails

Is there a way to support other subdomains?

Closed this issue · 1 comments

I have a few subdomain site set up using the gem Apartment, they all have similar content so I intend to add "alternate" tag.

<link rel="canonical" href='https://hk.lvh.me/en/programs/enroll?course_code=AT212121321' />
<link rel="alternate" hreflang="en-sg" href='https://sg.lvh.me/en/programs/enroll?course_code=AT212121321' />
<link rel="alternate" hreflang="en-tw" href='https://tw.lvh.me/en/programs/enroll?course_code=AT212121321' />
<link rel="alternate" hreflang="zh-tw" href='https://tw.lvh.me/zh/programs/enroll?course_code=AT212121321' />

Is there a way to support adding some whitelisted subdomains? Thanks :)

Definitely won't do this out of the box, but to add subdomain support itself would be pretty easy.

The real issue is the fact that the URL differs in the path itself, specifically the lang namespace you have going on with en and zh. That and for some others this might become a parameter.

This would complicate the gem significantly. Suggest you roll your own helper method.