ballerina-platform / ballerina-dev-website

Dev version of the ballerina.io website
Apache License 2.0
158 stars 180 forks source link

Links to subsections of the release note don't work #6638

Open MaryamZi opened 1 year ago

MaryamZi commented 1 year ago

Description

For example https://ballerina.io/downloads/swan-lake-release-notes/swan-lake-2201.2.0#http-package-1 for Standard library updates > Improvements > http package

praneesha commented 1 year ago

This should be because of the duplication of the same title in the release note.

s-vamshi commented 2 weeks ago

Hey @keizer619 @sm1990 I would like to work on this issue

sm1990 commented 2 weeks ago

@s-vamshi thank you. I'll assign it to you. Let me know if you have any questions. Happy coding!

s-vamshi commented 2 weeks ago

hey @sm1990, i am not able to replicate the issue links in subsection of release notes are working can you please let me now if i am missing something?

sm1990 commented 2 weeks ago

Hi @s-vamshi , If you copy and paste https://ballerina.io/downloads/swan-lake-release-notes/swan-lake-2201.2.0#http-package-1, it should go to the page and then scroll to the relevant section in the page. But it doesn't. It's probably because there are 2 headings as http package under 2 sections. We appended -1, -2, .. for such duplicated sections. It seems to be not working. Let me know if you have any questions.

s-vamshi commented 2 weeks ago

Hey @sm1990 thanks for clarifying, i guess we need to update the ID's of headings with the count

s-vamshi commented 1 week ago

Hey @sm1990, just wanted to let you know that I’m currently writing a blog on Ballerina and working on creating a connector for it, so I’m finding it hard to manage my time for this issue. If someone is interested, please assign this issue to them!

sm1990 commented 1 week ago

Thank you for letting us know @s-vamshi . I'll unassign this task from you for now, so that others can see it as an available task. Once you have finished your other task, if no one has claimed this, you can have it :smile:

s-vamshi commented 1 week ago

Sure 😃

harshalkh commented 1 week ago

@sm1990 I am interested to work, pls assign to me.

sm1990 commented 1 week ago

Hi @harshalkh , Thank you for selecting this issue. I'll assign it to you. Happy coding!!!!

sm1990 commented 4 days ago

@harshalkh Any update on this issue? Let me know if you have any questions.

harshalkh commented 4 days ago

@sm1990 I tried few blogs, this looks correct but still it's not working when direct link accessed. If you could help will be good.

sm1990 commented 4 days ago

@harshalkh can you check these two files (https://github.com/ballerina-platform/ballerina-dev-website/blob/master/pages/downloads/swan-lake-release-notes/%5B...slug%5D.js and https://github.com/ballerina-platform/ballerina-dev-website/blob/master/components/common/pg-toc/Toc.js) they are the ones involved in setting the IDs of the headings.

sm1990 commented 2 days ago

@harshalkh Looks like we're not using the https://github.com/ballerina-platform/ballerina-dev-website/blob/master/components/common/main-content/MainContent.js in release note slugs. See, whether it works, if we refactor the code using that.

harshalkh commented 2 days ago

@sm1990 sorry I am not able to track this. If someone else want to take this you can reassign..

AnsarMahir commented 2 days ago

@sm1990 Can I try this out ??

sm1990 commented 2 days ago

Sure. I'll assign it to you @AnsarMahir

AnsarMahir commented 1 day ago

@sm1990 Just checked this. Everything works fine. The only issue here is the permalink used by @MaryamZi to create the issue. The permalink has a "-1" suffix which should not be there. It should be without "-1" as there is only one section with the name "http-package" . As per the logic in the below code snippet,

`const headingCount = getArrayCount(uniqueHeadingList, sectionId); uniqueHeadingList.push(sectionId);

if (headingCount !== 0) { unique = false; sectionId = sectionId + "-" + headingCount; }`

The logic used state that only add a suffix when the section is repeated. Eg: There are 4 sections with "New-features" on the provided permalink , so when going to the second section, then it will have the suffix "-1" as "#new-features-1". So it seems like the permalink that is used to create the issue is wrong and it should be https://ballerina.io/downloads/swan-lake-release-notes/swan-lake-2201.2.0#http-package

sm1990 commented 1 day ago

@AnsarMahir there are 2 headings called http package. One under Standard library updates -> New features -> http package. the other under Standard library updates -> Improvements -> http package.

So we need to have that -1 at the end. Please check this explanation above as well.

Let me know if you have any questions.