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

Page variables for Identifier and Name ignored #817

Closed
bguiz opened this issue Jan 22, 2015 · 8 comments
Closed

Page variables for Identifier and Name ignored #817

bguiz opened this issue Jan 22, 2015 · 8 comments
Assignees
Milestone

Comments

@bguiz
Copy link

bguiz commented Jan 22, 2015

In the documentation for menus, under the "Nesting" section:

http://gohugo.io/extras/menus/#toc_5

The following order is used to determine identity Identifier > Name > LinkTitle > Title. This means that the title will be used unless linktitle is present, etc. In practice Name and Identifier are never displayed and only used to structure relationships.

This is excellent, and precisely what I need, because I have two different pages under different submenus, which I wish to generate, where they have the same name (but should have different identities).

However, when I insert either a name or an identifier to the front matter yaml of my page, it appears to ignored, an I continue getting the same error as before:

ERROR: 2015/01/22 Two or more menu items have the same name/identifier in "main" Menu. Identified as "Comments".
Rename or set a unique identifier.

Checking elsewbhere in the documentation, I find the list of accepted fields for the pages' front matter:

http://gohugo.io/templates/variables/#toc_0

  • This list does include .Title and .LinkTitle
  • This list does not, however, include .Identifierand .Name, which I expect it to

.. which does explain why it is getting ignored.

Could we please get the method described in the "menu" documentation, "The following order is used to determine identity Identifier > Name > LinkTitle > Title" implemented please?

@bep
Copy link
Member

bep commented Jan 22, 2015

Thanks for the detailed report.

I will check this (as I have rumbled around in the menu code).

.Identifier and .Name is mentioned in http://gohugo.io/extras/menus/ -- one could argue that since a Page can be a menu item, it also should be listed there, but ...

@bep bep self-assigned this Jan 22, 2015
@bguiz
Copy link
Author

bguiz commented Jan 22, 2015

Yeah, that would make sense - from reading the documentation I expect
to be able to set either .Identifier or .Name on a page.

Thanks for looking into this.
W: http://bguiz.com

On 22 January 2015 at 20:28, Bjørn Erik Pedersen
notifications@github.com wrote:

Thanks for the detailed report.

I will check this (as I have rumbled around in the menu code).

.Identifier and .Name is mentioned in http://gohugo.io/extras/menus/ -- one
could argue that since a Page can be a menu item, it also should be listed
there, but ...


Reply to this email directly or view it on GitHub.

@bep bep added the Bug label Jan 22, 2015
@bep bep added this to the v0.13 milestone Jan 22, 2015
@bep
Copy link
Member

bep commented Jan 22, 2015

  • Can I ask which Hugo version you are using (the output of hugo version)?
  • At which level do you put the identifier?
  • YAML or TOML? (remember someone mentioning a issue with menus and YAML)

The correct would be (in YAML):

menu:
  main:
    identifier: "someid"

@bep
Copy link
Member

bep commented Jan 22, 2015

I'm not able to reproduce this the latest codebase.

Do you have any public project that reproduces this?

@bguiz
Copy link
Author

bguiz commented Jan 22, 2015

13-DEV built off master as of yesterday

And yes http://github.com/bguiz/js-standards

I don't think that I committed name and identifier since they didn't work,
but you can take a look at

  • content/es5/naming.md
  • content/angularjs/naming.md

I would like to have both of these define the same linktitle in their front
matter, and simply have different values for identifier, but it doesn't
work, so I needed to define them with slightly different linktitle's.
On 23 Jan 2015 03:23, "Bjørn Erik Pedersen" notifications@github.com
wrote:

I'm not able to reproduce this the latest codebase.

Do you have any public project that reproduces this?


Reply to this email directly or view it on GitHub
#817 (comment).

@bguiz
Copy link
Author

bguiz commented Jan 22, 2015

$ hugo version
Hugo Static Site Generator v0.13-DEV BuildDate:

2015-01-22T11:46:04+11:00

W: http://bguiz.com

On 23 January 2015 at 08:49, Brendan Graetz brendan.graetz@gmail.com
wrote:

13-DEV built off master as of yesterday

And yes http://github.com/bguiz/js-standards

I don't think that I committed name and identifier since they didn't work,
but you can take a look at

  • content/es5/naming.md
  • content/angularjs/naming.md

I would like to have both of these define the same linktitle in their
front matter, and simply have different values for identifier, but it
doesn't work, so I needed to define them with slightly different
linktitle's.
On 23 Jan 2015 03:23, "Bjørn Erik Pedersen" notifications@github.com
wrote:

I'm not able to reproduce this the latest codebase.

Do you have any public project that reproduces this?


Reply to this email directly or view it on GitHub
#817 (comment).

@bguiz
Copy link
Author

bguiz commented Jan 22, 2015

Bjørn, I'm sorry, it looks like this was a mistake on my part. I re-read
your comment above, and it looks like my YAML was indeed incorrect.

W: http://bguiz.com

On 23 January 2015 at 09:19, Brendan Graetz brendan.graetz@gmail.com
wrote:

$ hugo version
Hugo Static Site Generator v0.13-DEV BuildDate:

2015-01-22T11:46:04+11:00

W: http://bguiz.com

On 23 January 2015 at 08:49, Brendan Graetz brendan.graetz@gmail.com
wrote:

13-DEV built off master as of yesterday

And yes http://github.com/bguiz/js-standards

I don't think that I committed name and identifier since they didn't
work, but you can take a look at

  • content/es5/naming.md
  • content/angularjs/naming.md

I would like to have both of these define the same linktitle in their
front matter, and simply have different values for identifier, but it
doesn't work, so I needed to define them with slightly different
linktitle's.
On 23 Jan 2015 03:23, "Bjørn Erik Pedersen" notifications@github.com
wrote:

I'm not able to reproduce this the latest codebase.

Do you have any public project that reproduces this?


Reply to this email directly or view it on GitHub
#817 (comment).

@bguiz bguiz closed this as completed Jan 22, 2015
tychoish pushed a commit to tychoish/hugo that referenced this issue Aug 13, 2017
@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 18, 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

2 participants