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 dynamic page priorities for sitemap? #429

Closed
caendesilva opened this issue May 19, 2022 · 1 comment · Fixed by #437
Closed

Add dynamic page priorities for sitemap? #429

caendesilva opened this issue May 19, 2022 · 1 comment · Fixed by #437
Assignees

Comments

@caendesilva
Copy link
Member

Some sitemap generators set priorities based on how deeply nested pages are. Could this be of use for Hyde?

@caendesilva caendesilva self-assigned this May 21, 2022
@caendesilva
Copy link
Member Author

Trying out the following:

$priority = 0.5;

if (in_array($pageClass, [BladePage::class, MarkdownPage::class])) {
    $priority = 0.9;
    if ($slug === 'index') {
        $priority = 1;
    }
    if ($slug === '404') {
        $priority = 0.5;
    }
}

if ($pageClass === DocumentationPage::class) {
    $priority = 0.9;
}

if ($pageClass === MarkdownPost::class) {
    $priority = 0.75;
}

return (string) $priority;

@caendesilva caendesilva linked a pull request May 21, 2022 that will close this issue
caendesilva added a commit that referenced this issue May 21, 2022
…sitemap

Fix #429: Add page priorities to sitemap generation
caendesilva pushed a commit that referenced this issue Aug 26, 2022
Refactor HydeKernel code to organized single-used traits hydephp/develop@9f91a20
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 a pull request may close this issue.

1 participant