Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new option to enhance first page link #809

Merged
merged 1 commit into from
Oct 7, 2024
Merged

add new option to enhance first page link #809

merged 1 commit into from
Oct 7, 2024

Conversation

garak
Copy link
Collaborator

@garak garak commented Sep 30, 2024

Fix #804

public function __construct(
private readonly Processor $processor,
private readonly string $pageName = 'page',
private readonly bool $skipFirstPageLink = false,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not so fond of the naming of this parameter as it can be misinterpreted.

Suggested change
private readonly bool $skipFirstPageLink = false,
private readonly bool $includePageInFIrstPageLink = true,

@@ -55,6 +55,9 @@ public function getConfigTreeBuilder(): TreeBuilder
->booleanNode('convert_exception')
->defaultFalse()
->end()
->booleanNode('remove_page_1_link')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find this configuration option not so straightforward, what bout this? I'm afraid it can be misinterpreted

Suggested change
->booleanNode('remove_page_1_link')
->booleanNode('include_page_in_first_page_link')

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand your concern, I'm open to suggestions to improve the naming. The purpose is explained in the linked issue: to be able to avoid a duplicate URL in pagination, because the first page link is usually an URL like example.org?page=1 and is the same as example.org

Copy link
Member

@alexpozzi alexpozzi Oct 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might have misunderstood the issue but isn't the issue asking only to have the ability to configure a behavior to remove the first page's link page query param? I don't see any duplicated link suppression in the current PR or do you mean duplicated in search engines?
Maybe a more appropriate name would be include_page_param_on_first_page?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, the duplication refers to the SEO. I'd like to keep the option name under a decent limit, what about "remove_first_page_param"?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine with me 👍

@garak garak requested a review from alexpozzi October 4, 2024 13:57
Copy link
Member

@alexpozzi alexpozzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@garak garak merged commit f22f3ba into master Oct 7, 2024
26 checks passed
@garak garak deleted the update-alias branch October 7, 2024 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to remove page query parameter from first page?
2 participants