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

cannot convert type hugolib.PagesGroup to Pages #1

Closed
pappayain opened this issue Oct 2, 2018 · 9 comments
Closed

cannot convert type hugolib.PagesGroup to Pages #1

pappayain opened this issue Oct 2, 2018 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@pappayain
Copy link

$hugo
Building sites … ERROR 2018/10/02 20:07:56 Error while rendering "home" in "": template: index.html:5:14: executing "index.html" at <.Paginate>: error calling Paginate: cannot convert type hugolib.PagesGroup to Pages

@natarajmb
Copy link
Owner

@pappayain not sure how you are using it. I just tested it with latest 0.49 version of hugo and it works fine.

To test it yourself follow this steps, create a test folder and do the following. Assuming hugo is installed and accessible.

  1. $hugo new site charak-theme-test
  2. $cd charaka-theme-test/themes
  3. $git clone git@github.com:natarajmb/charaka-hugo-theme.git
  4. $cd charaka-theme-test/themes/charaka-hugo-theme
  5. $cp -r exampleSite/* ../../
  6. $cd ../../
  7. $hugo server -D

navigate to http://localhost:1313 you should see the sample site.

@pappayain
Copy link
Author

Yes, if I copy content folder of example site, then it works. But if I follow the quick start guide at https://gohugo.io/getting-started/quick-start/ and replace the theme with charaka-hugo-theme then it just fails.

@pappayain
Copy link
Author

$hugo version
Hugo Static Site Generator v0.49/extended darwin/amd64 BuildDate: unknown

$hugo new site quickstart
Congratulations! Your new Hugo site is created in /tmp/quickstart.

$cd quickstart

$git init
Initialized empty Git repository in /private/tmp/quickstart/.git/

$git submodule add https://github.com/natarajmb/charaka-hugo-theme.git themes/charaka-hugo-theme
Cloning into '/private/tmp/quickstart/themes/charaka-hugo-theme'...
remote: Enumerating objects: 151, done.
remote: Counting objects: 100% (151/151), done.
remote: Compressing objects: 100% (89/89), done.
remote: Total 151 (delta 65), reused 129 (delta 43), pack-reused 0
Receiving objects: 100% (151/151), 1.12 MiB | 542.00 KiB/s, done.
Resolving deltas: 100% (65/65), done.

$cp -vf themes/charaka-hugo-theme/exampleSite/config.toml .
themes/charaka-hugo-theme/exampleSite/config.toml -> ./config.toml

$hugo new posts/my-first-post.md

$hugo server
Building sites … ERROR 2018/10/05 17:18:45 Error while rendering "home" in "": template: index.html:5:14: executing "index.html" at <.Paginate>: error calling Paginate: cannot convert type hugolib.PagesGroup to Pages
Total in 42 ms
Error: Error building site: logged 1 error(s)

@natarajmb
Copy link
Owner

Use this "post" instead of "posts" and see if the error goes away. If it does then I will update the template.

$hugo new post/my-first-post.md

@natarajmb
Copy link
Owner

Check out the latest code and it should work now with "posts"

@ivanvpan
Copy link

Same issue with master and v0.49. I fixed it by just removing pagination, because I don't really need it. I really like the theme, thanks a bunch.

Building sites … ERROR 2018/10/11 13:16:08 Error while rendering "taxonomyTerm" in "": template: _default/list.html:6:18: executing "_default/list.html" at <.Paginate>: error calling Paginate: cannot convert type hugolib.PagesGroup to Pages

Building sites … ERROR 2018/10/11 13:18:48 Error while rendering "home" in "": template: index.html:5:16: executing "index.html" at <.Paginate>: error calling Paginate: cannot convert type hugolib.PagesGroup to Pages

@natarajmb
Copy link
Owner

@pappayain, I'm able to re-create the issue with your steps and have put in a fix to solve this. If you are still looking to get it fixed then take the latest code. The issue was to do with pages being empty as its a new site and those pages were being fed into PageGroups which always errored.

@natarajmb natarajmb self-assigned this Oct 19, 2018
@natarajmb natarajmb added the bug Something isn't working label Oct 19, 2018
@natarajmb
Copy link
Owner

No response from the initial reporter closing as its fixed.

@lczen
Copy link

lczen commented Feb 10, 2020

Same issue with master and v0.49. I fixed it by just removing pagination, because I don't really need it. I really like the theme, thanks a bunch.

Building sites … ERROR 2018/10/11 13:16:08 Error while rendering "taxonomyTerm" in "": template: _default/list.html:6:18: executing "_default/list.html" at <.Paginate>: error calling Paginate: cannot convert type hugolib.PagesGroup to Pages

Building sites … ERROR 2018/10/11 13:18:48 Error while rendering "home" in "": template: index.html:5:16: executing "index.html" at <.Paginate>: error calling Paginate: cannot convert type hugolib.PagesGroup to Pages
Hi bro,I just remove it and it works now,but i wonder if some issues will be produced,cause i don't know this removed file's function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants