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

/section/subsection/ leads nowhere #1024

Closed
peczony opened this issue Apr 1, 2015 · 6 comments
Closed

/section/subsection/ leads nowhere #1024

peczony opened this issue Apr 1, 2015 · 6 comments
Labels

Comments

@peczony
Copy link

peczony commented Apr 1, 2015

I am unsure if that’s a bug or an intended way of working, so if it’s intended feel free to close the issue.

Suppose inside of my section blog I want to have a separate subsection guest for posts written by my friends.

As for now, if I do thus with the default permalinks configuration values (as in: no permalinks section in the config), guest posts have paths like this: :baseUrl/blog/guest/:slug

Which is fine, but when I visit path :baseUrl/blog/guest, I expect to see something like /layouts/_default/list.html. Instead i see a list of directories in plain html. Seems like a bug.

OK then, suppose it was fixed, now we have another problem.

‘Guest’ posts are included in the default :baseUrl/blog/ list with no indication whatsoever that they belong to a subcategory. A site visitor who sees the page can only infer a subcategory this if he clicks on the title and notices the url change.

As far as I can imagine, if one creates a subfolder in one’s section folder, one either wants content items in the corresponding subsection to NOT be included at all in the :baseUrl/section/ list, and be included instead in :baseUrl/section/subsection/ list instead, or one wants the subsection items to be included in :baseUrl/section/ list, but with some indication of a subsection, say a colored badge with the subsection name near post title—else what are subsections even for?

If you begin to consider the issue, you should also decide on a way in which .Paginator will respond to the changes made. If subsection items are shown on the :baseUrl/section/ list, there should be a way to count section and subsection items differently. Say all the items in section list are included in .Paginator.TotalNumberOfElements, then something like .Paginator.TotalNumberOfElements.Section / .Paginator.TotalNumberOfElements.Subsection could be introduced in order to have access to the different post counts.

Either way, :baseUrl/section/subsection/ should lead to some meaningful place and not to the snow desert it leads to now.

@peczony peczony changed the title subdirectories as subcategories /section/subsection/ leads nowhere Apr 1, 2015
@bep
Copy link
Member

bep commented Apr 1, 2015

Have you read the documentation?

http://gohugo.io/content/sections/

As to the "snow desert" -- are you using the built-in file server in Hugo (hugo server)?

@peczony
Copy link
Author

peczony commented Apr 1, 2015

Yes, I did, and I understand that the ‘subsectioning concept’ isn’t, in fact, introduced—but how is all the subdirectories system supposed to work? If the subdirectories do not in fact do anything except create ‘snow deserts’, it is logical to explicitly disallow them to be part of permalinks.

Yes, I used hugo server.

@peczony
Copy link
Author

peczony commented Apr 1, 2015

Also, suppose I wanted to get the behaviour described in the issue (‘subsection as a separate section’) using current methods. Then I would need to create, in fact, a section proper and then adjust the links. So my directory structure would be as follows:

content
 - section1
   - post1.md  # intended as section1/post1/
 - section2      # intended as subsection section1/section2
   - post2.md   # intended as section1/section2/post2/

It is easy to achive the right permalink for post2.md by setting the section2 permalink in the config to /section1/section2/:slug/

Though, the list for section2 would be still at section2/, not at section1/section2/ (and a snow desert at the latter address)

Am I right that, in current setting, it is impossible to achieve the behaviour described in Hugo?
Thank you.

@bep
Copy link
Member

bep commented May 11, 2015

The section is defined as the first level from root. No support for sub-sections.

@bep bep closed this as completed May 11, 2015
@dunn
Copy link
Contributor

dunn commented May 11, 2015

Looks like what you're requesting is similar to #465, is that right?

@github-actions
Copy link

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 Apr 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants