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

Paginated Output Format's first page filepath is wrong #6797

Closed
regisphilibert opened this issue Jan 24, 2020 · 6 comments
Closed

Paginated Output Format's first page filepath is wrong #6797

regisphilibert opened this issue Jan 24, 2020 · 6 comments
Assignees
Milestone

Comments

@regisphilibert
Copy link
Member

What version of Hugo are you using (hugo version)?

Hugo Static Site Generator v0.58.3/extended darwin/amd64 (or later)

Does this issue reproduce with the latest release?

Yes


When using paginated output formats on list templates, such as json. Hugo creates the following file:

/page/1/index.json/index.html

Other pages files are created as expected at:

/page/2/index.json

This might be what triggers #6472

See this example repo (initially created for #6472) 👉 https://github.com/theNewDynamic/gohugo-6472

@bep bep added this to the v0.64 milestone Jan 30, 2020
@bep bep self-assigned this Jan 30, 2020
@bep bep added the Bug label Jan 30, 2020
@bep
Copy link
Member

bep commented Jan 30, 2020

OK, I have checked this, and:

  • For HTML, we create alias pages for /section/page/1 redirecting to /section/
  • For JSON, a redirect obviously does not make sense
  • But I'm not totally sure that duplicating so/section/page/1/index.json == /section/index.json which would make a confusing setup.

My short term fix for this (I will keep this issue open) is to NOT creating alias for non-HTML paginators.

@regisphilibert
Copy link
Member Author

My short term fix for this (I will keep this issue open) is to NOT creating alias for non-HTML paginators.

I'm fine with that.

@ntrrg
Copy link

ntrrg commented Feb 2, 2020

With v0.63.2 the .Paginator property for non-HTML formats is broken:

Building sites … ERROR 2020/02/02 11:57:57 render of "page" failed: execute of template failed: template: _default/list.json.json:4:37: executing "data" at <.Paginator.Pages>: error calling Pages: runtime error: invalid memory address or nil pointer dereference

Not sure if it is related to this

@bep bep modified the milestones: v0.64, v0.65 Feb 4, 2020
@bep bep modified the milestones: v0.65, v0.66 Feb 18, 2020
@bep bep modified the milestones: v0.66, v0.67 Mar 2, 2020
@bep bep modified the milestones: v0.67, v0.68 Mar 9, 2020
@bep bep modified the milestones: v0.68, v0.69 Mar 20, 2020
@bep bep modified the milestones: v0.69, v0.70 Apr 8, 2020
@bep bep modified the milestones: v0.70, v0.71 Apr 28, 2020
@bep bep modified the milestones: v0.71, v0.72 May 18, 2020
@bep bep modified the milestones: v0.72, v0.73 May 31, 2020
@bep bep modified the milestones: v0.73, v0.74 Jun 23, 2020
@bep bep modified the milestones: v0.77, v0.78 Oct 30, 2020
@bep bep modified the milestones: v0.78, v0.83 Apr 23, 2021
@bep bep modified the milestones: v0.83, v0.84 May 3, 2021
@bep bep modified the milestones: v0.84, v0.85 Jun 18, 2021
@bep bep modified the milestones: v0.85, v0.86 Jul 5, 2021
@bep bep modified the milestones: v0.86, v0.87, v0.88 Jul 26, 2021
@bep bep modified the milestones: v0.88, v0.89 Sep 2, 2021
@bep bep modified the milestones: v0.89, v0.90 Nov 2, 2021
@bep bep modified the milestones: v0.90, v0.91.0 Dec 13, 2021
@bep bep modified the milestones: v0.91.0, v0.92.0 Dec 22, 2021
@bep bep modified the milestones: v0.92.0, v0.93.0 Jan 12, 2022
@ptgott
Copy link
Contributor

ptgott commented Jan 31, 2022

Just checking to see if there's any more work to be done on this now that we've merged #6829.

@jmooring
Copy link
Member

jmooring commented Feb 2, 2022

Resolved, presumably with #6829.

git clone --single-branch -b hugo-github-issue-6797 https://github.com/jmooring/hugo-testing hugo-github-issue-6797
cd hugo-github-issue-6797
hugo server
public/posts/page/
├── 1/
│   └── index.html  <-- there isn't an alias for json, as expected/desired
├── 2/
│   ├── index.html
│   └── index.json
└── 3/
    ├── index.html
    └── index.json

@jmooring jmooring closed this as completed Feb 2, 2022
@github-actions
Copy link

github-actions bot commented Feb 9, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants