OpenLiberty / openliberty.io

Open Liberty website
https://openliberty.io
Other
54 stars 40 forks source link

Allow permalinks for guides to be different from their projectids #179

Open yeekangc opened 6 years ago

yeekangc commented 6 years ago

We need to optimize permalinks for the guides for SEO. The website will need to handle permalinks that do not map to projectids and treat them as independent.

related-guides uses projectid today and the website might have coded with the assumption they start with projectid.

Please answer the following if applicable

kinueng commented 6 years ago

This work may need #175 if we want to change any existing URLs.

Right now the code to generate the related guides section is using the permalink (which happens to contain the projectid). If we choose to make the projectid and permalinks different, we will need to change how we find the guides that belong in the related guides section. Maybe we look for projectids and ask Jekyll/Liquid for the permalink?

https://github.com/OpenLiberty/openliberty.io/blob/1c89284be436038b9522b283f37594c65d9d283f/src/main/content/_layouts/guide.html#L60

kinueng commented 6 years ago

Hi @yeekangc @evelinec Do we still need this issue?

yeekangc commented 6 years ago

Yes, @kinueng. This is still what we should consider and so for SEO.

steven1046 commented 3 years ago

I think you can change the permalink in guides, but keeping the project id's as is. We'll need to add redirects from old guide urls to the new ones once they change.

steven1046 commented 3 years ago

Adding support for a guide-redirects.properties file in the guides-common repo which will help address the move of permalinks.

steven1046 commented 3 years ago

@gkwan-ibm @yeekangc now the ui work is done for guides to begin converting permalinks. Add the old url and new url to the guides-common redirect file and then it should work on the draft site.

steven1046 commented 3 years ago

@gkwan-ibm @yeekangc i see one more instance on end of guides, where we display the cards to other related guides. This uses the permalink. I need to debug a little bit more to see how it can be done before we change the guides. But at least the redirect file can be used for now.

steven1046 commented 3 years ago

@yeekangc @gkwan-ibm

It actually works with no changes to the UI.

1) If a page permalink changes, then the guides that reference that guide in their page-related-guides will also have to update that metadata to include the new permalink. 2) Update guide categories json to include the new permalink changed.

The reason why we have to update the related guides and guide categories json, is that jekyll has no idea what projectid is. It can only have access to "page" variables. If we wanted to not have to change the related guides and guide category json, another approach is to rename :projectid: to :page-projectid:. If you want to take that approach, let me know as i'll probably have to update the ui code to look for the projectid instead of permalink.

steven1046 commented 2 years ago

@gkwan-ibm do you know if the above is good to implement or if we even want to change the permalinks anymore?

kinueng commented 2 years ago

Hi @steven1046, what is the current status of this issue?

steven1046 commented 2 years ago

I provided a suggested fix above.