python-poetry / website

Source for the official Poetry website
https://python-poetry.org
34 stars 17 forks source link

Fix page summary for non-default version. #139

Closed jenskeiner closed 11 months ago

jenskeiner commented 1 year ago

It seems that section summaries in the documentation flyover are not rendered correctly when looking at a non-default version, e.g., currently https://python-poetry.org/docs/1.5/.

The cause is that the removal of the section title from .Page.Summary via strings.TrimPrefix .Name doesn't work for pages in non-default versions since the titles contain a suffix with the version number, e.g., Introduction | 1.5.

This is accounted for when rendering the section title in a separate paragraph above, but not when rendering the excerpt from the section body.

This PR fixes that by using the same index (split .Name "|") 0 construct that correctly extracts the section title.

github-actions[bot] commented 11 months ago

Deploy preview for website ready!

✅ Preview https://website-oc3qc83u6-python-poetry.vercel.app

Built with commit 406be996b99f6cd78ce655a2aca9288814f8ec55. This pull request is being automatically deployed with vercel-action