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

Fixes paginator issue since hugo v0.123.0 #170

Merged

Conversation

MichielVanDerWinden
Copy link
Contributor

What problem does this PR solve?

Pages of kind "page" don't allow the creation of a paginator (.Paginate or .Paginator) in the newest version of hugo.
Pages of kind "section" (e.g. /posts) still allow the creation. This fix adds a check for the kind of page and excludes pages with kind "page" from creating a paginator.

Is this PR adding a new feature?

No

Is this PR related to any issue or discussion?

Closes #165

PR Checklist

  • I have verified that the code works as described/as intended.
  • This change adds a social icon which has a permissive license to use it.
  • This change does not include any external library/resources.
  • This change does not include any unrelated scripts (e.g. bash and python scripts).
  • I have enabled maintainer edits for this PR.

Copy link

netlify bot commented Mar 7, 2024

Deploy Preview for hugo-blog-awesome ready!

Name Link
🔨 Latest commit 457a902
🔍 Latest deploy log https://app.netlify.com/sites/hugo-blog-awesome/deploys/65e9927bfeab5400087c9ce4
😎 Deploy Preview https://deploy-preview-170--hugo-blog-awesome.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@hugo-sid
Copy link
Owner

hugo-sid commented Mar 7, 2024

Hi Michiel, thanks for creating this PR and for the detailed information you've provided.

Could you please bump the Hugo version in netlify.toml to 0.123.7?

HUGO_VERSION = "0.122.0"

This will allow us to test whether the fix works in Hugo version > 0.123.0.
If the Netlify deployment is successful, it will indicate that the fix is effective.

Let me know if anything is not clear or if you have any queries.

@MichielVanDerWinden
Copy link
Contributor Author

@hugo-sid done. Apparently there's another issue that breaks the build, has something to do with the twitter_simple shortcode.

@MichielVanDerWinden
Copy link
Contributor Author

MichielVanDerWinden commented Mar 7, 2024

@hugo-sid we've got two issues breaking the build currently, so how do you want to proceed? I can create another branch that fixes the twitter_simple shortcode, but that PR will then break netlify on the paginator issue as well.

@hugo-sid
Copy link
Owner

hugo-sid commented Mar 7, 2024

@MichielVanDerWinden thank you for enabling maintainer edits for this PR.

I am currently pushing a commit (as part of this PR) to fix the twitter_simple shortcode.

Also, thanks for the Hugo version bump.

Pages of kind "page" don't allow the creation of a paginator (.Paginate
or .Paginator) in the newest version of hugo.
Pages of kind "section" (e.g. /posts) still allow the creation. This fix
adds a check for the kind of page and excludes pages with kind "page"
from creating a paginator.
@MichielVanDerWinden
Copy link
Contributor Author

MichielVanDerWinden commented Mar 7, 2024

@MichielVanDerWinden thank you for enabling maintainer edits for this PR.

I am currently pushing a commit (as part of this PR) to fix the twitter_simple shortcode.

Also, thanks for the Hugo version bump.

To maintain full transparency I've created #171 which is duplicated by your #172 - do you want me to close my issue?

@hugo-sid hugo-sid force-pushed the fix/paginator-issue-hugo-v0.123.0 branch from e28185d to 457a902 Compare March 7, 2024 10:10
Copy link

sonarcloud bot commented Mar 7, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@hugo-sid
Copy link
Owner

hugo-sid commented Mar 7, 2024

Ah, I saw #171 just now. Please don't delete the the issue which you have created, Michiel. It's more detailed and informative than mine.

Anyways these two will be closed as soon as I merge this PR.

Thanks again for the detailed issue.

Copy link
Owner

@hugo-sid hugo-sid left a comment

Choose a reason for hiding this comment

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

LGTM.

Thank you Michiel for taking time to contribute to Hugo blog awesome.

I truly appreciate your contribution.

@hugo-sid hugo-sid merged commit 9f042a8 into hugo-sid:main Mar 7, 2024
7 checks passed
@MichielVanDerWinden MichielVanDerWinden deleted the fix/paginator-issue-hugo-v0.123.0 branch March 7, 2024 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

Posts paginator error, fails on hugo server --buildDrafts
2 participants