-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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 .HeadlessPages to site variable. #4882
Comments
This would truly solve the issue I raised last year, too. #3612 |
I don't think so. I think the people asking for this are asking for something else. As in, it would be a hack to solve #3612 |
What would solve #3612? As it stands, I am still using the hack mentioned in that post. |
They may want for a way to include both normal pages and headless pages in a call, but I Understand the absurdity of it (and don't want it), hence my suggestion of giving an access to headless pages only. I have not used headless pages in any of my project yet, so I don't feel very opinionated about this issue yet, but by the look of it, people will have to hack their way around this restriction (using a lot of |
We are using some workaround, because this feature is missing. We flag all headless files and remove them during the build process with a script. We had to add some stuff to the sitemap as well. Currently we are not using the intended functionality of headless pages at all. |
This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help. |
+1 |
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. |
Because Headless pages are excluded from every page collections, there is currently no easy way to iterate over a set of headless pages.
Along the line of
.Site.RegularPages
and.Site.AllPages
, would it be possible to create a new site variable (.Site.HeadlessPages
) where all the Headless pages of one site would be stored and easily accessed (usingwhere
,sort
etc...) by the users.I think people will need to range on their headless pages eventually. I see a lot of use cases where they are used as data with a bundle… (sponsors, ads, team members) resulting in dozens of headless pages which, at some point in a template, need to be conveniently iterated over.
As of today, I don’t see any easy way. You have to know where to look in order to create a range on their filename and then use
.GetPage
on each of them inside the range like described here.Also see this thread.
The text was updated successfully, but these errors were encountered: