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

Fix Node vs Page #2297

Closed
bep opened this Issue Jul 21, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@bep
Member

bep commented Jul 21, 2016

This issue tracks improvements as described in https://discuss.gohugo.io/t/node-improvements/1593

Related issues dangling around will be closed as they must be considered when fixing this.

@bep bep added the Enhancement label Jul 21, 2016

bep added a commit that referenced this issue Jul 26, 2016

Add Translations and AllTranslations to Node
This commit also consolidates URLs on Node vs Page, so now .Permalink should be interoperable.

Note that this implementations should be fairly short-livded, waiting for #2297, but the API should be stable.

bep added a commit that referenced this issue Jul 30, 2016

Add Translations and AllTranslations to Node
This commit also consolidates URLs on Node vs Page, so now .Permalink should be interoperable.

Note that this implementations should be fairly short-livded, waiting for #2297, but the API should be stable.

bep added a commit that referenced this issue Aug 4, 2016

Add Translations and AllTranslations to Node
This commit also consolidates URLs on Node vs Page, so now .Permalink should be interoperable.

Note that this implementations should be fairly short-livded, waiting for #2297, but the API should be stable.

bep added a commit that referenced this issue Aug 8, 2016

Add Translations and AllTranslations to Node
This commit also consolidates URLs on Node vs Page, so now .Permalink should be interoperable.

Note that this implementations should be fairly short-livded, waiting for #2297, but the API should be stable.

bep added a commit that referenced this issue Aug 10, 2016

Create a Node map to get proper node translations
In a multi-language setup, before this commit the Node's Translations() method
would return some "dummy nodes" that would point to the correct page (Permalink),
but would not be the same as the node it points to -- it would not have the translated
title etc.

The node creation is, however, so mingled with rendering, whihc is too early to have any global state,
so the nodes has to be split in a prepare and a render phase. This commits does that with as small
a change as possible. This implementation is a temp solution until we fix #2297.

Updates #2309

bep added a commit that referenced this issue Aug 13, 2016

Add Translations and AllTranslations to Node
This commit also consolidates URLs on Node vs Page, so now .Permalink should be interoperable.

Note that this implementations should be fairly short-livded, waiting for #2297, but the API should be stable.

bep added a commit that referenced this issue Aug 13, 2016

Create a Node map to get proper node translations
In a multi-language setup, before this commit the Node's Translations() method
would return some "dummy nodes" that would point to the correct page (Permalink),
but would not be the same as the node it points to -- it would not have the translated
title etc.

The node creation is, however, so mingled with rendering, whihc is too early to have any global state,
so the nodes has to be split in a prepare and a render phase. This commits does that with as small
a change as possible. This implementation is a temp solution until we fix #2297.

Updates #2309

bep added a commit that referenced this issue Aug 15, 2016

Add Translations and AllTranslations to Node
This commit also consolidates URLs on Node vs Page, so now .Permalink should be interoperable.

Note that this implementations should be fairly short-livded, waiting for #2297, but the API should be stable.

bep added a commit that referenced this issue Aug 15, 2016

Create a Node map to get proper node translations
In a multi-language setup, before this commit the Node's Translations() method
would return some "dummy nodes" that would point to the correct page (Permalink),
but would not be the same as the node it points to -- it would not have the translated
title etc.

The node creation is, however, so mingled with rendering, whihc is too early to have any global state,
so the nodes has to be split in a prepare and a render phase. This commits does that with as small
a change as possible. This implementation is a temp solution until we fix #2297.

Updates #2309

bep added a commit that referenced this issue Aug 20, 2016

Add Translations and AllTranslations to Node
This commit also consolidates URLs on Node vs Page, so now .Permalink should be interoperable.

Note that this implementations should be fairly short-livded, waiting for #2297, but the API should be stable.

bep added a commit that referenced this issue Aug 20, 2016

Create a Node map to get proper node translations
In a multi-language setup, before this commit the Node's Translations() method
would return some "dummy nodes" that would point to the correct page (Permalink),
but would not be the same as the node it points to -- it would not have the translated
title etc.

The node creation is, however, so mingled with rendering, whihc is too early to have any global state,
so the nodes has to be split in a prepare and a render phase. This commits does that with as small
a change as possible. This implementation is a temp solution until we fix #2297.

Updates #2309

bep added a commit that referenced this issue Aug 20, 2016

Add Translations and AllTranslations to Node
This commit also consolidates URLs on Node vs Page, so now .Permalink should be interoperable.

Note that this implementations should be fairly short-livded, waiting for #2297, but the API should be stable.

bep added a commit that referenced this issue Aug 20, 2016

Create a Node map to get proper node translations
In a multi-language setup, before this commit the Node's Translations() method
would return some "dummy nodes" that would point to the correct page (Permalink),
but would not be the same as the node it points to -- it would not have the translated
title etc.

The node creation is, however, so mingled with rendering, whihc is too early to have any global state,
so the nodes has to be split in a prepare and a render phase. This commits does that with as small
a change as possible. This implementation is a temp solution until we fix #2297.

Updates #2309

bep added a commit that referenced this issue Sep 6, 2016

Add Translations and AllTranslations to Node
This commit also consolidates URLs on Node vs Page, so now .Permalink should be interoperable.

Note that this implementations should be fairly short-livded, waiting for #2297, but the API should be stable.

@bep bep closed this in a07293c Sep 6, 2016

@VoidingWarranties

This comment has been minimized.

Show comment
Hide comment
@VoidingWarranties

VoidingWarranties Sep 14, 2016

Has this been resolved? Curious because in a07293c the commit message says

... This implementation is a temp solution until we fix #2297.

VoidingWarranties commented Sep 14, 2016

Has this been resolved? Curious because in a07293c the commit message says

... This implementation is a temp solution until we fix #2297.

@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Sep 14, 2016

Member

No it was closed by mistake.

Member

bep commented Sep 14, 2016

No it was closed by mistake.

bep added a commit that referenced this issue Nov 22, 2016

bep added a commit that referenced this issue Nov 22, 2016

bep added a commit that referenced this issue Nov 22, 2016

bep added a commit that referenced this issue Nov 22, 2016

bep added a commit that referenced this issue Nov 22, 2016

bep added a commit that referenced this issue Nov 22, 2016

bep added a commit that referenced this issue Nov 22, 2016

node to page: Do not create section node for root
Because that will overwrite the home page, which is bad.

Updates #2297

bep added a commit that referenced this issue Nov 22, 2016

bep added a commit that referenced this issue Nov 22, 2016

bep added a commit that referenced this issue Nov 22, 2016

bep added a commit that referenced this issue Nov 22, 2016

bep added a commit that referenced this issue Nov 22, 2016

bep added a commit that referenced this issue Nov 22, 2016

node to page: Refactor the build process
To make it easier to follow and understand.

Both building and rebuilding now follow a four step flow:

1. Init
2. Process
3. Assemble
4. Render

And now there are only one Build method, used for both builds and rebuilds.

Updates #2297

bep added a commit that referenced this issue Nov 22, 2016

node to page: Make Nodes into Pages
* `.Site.Pages` now contains all page types, including sections etc.
* `.Data.Pages` will also contain "node type" pages where relevant.

Updates #2297

bep added a commit that referenced this issue Nov 22, 2016

node to page: Add Pages to Page
As an alias to .Data.Pages for home page etc.

Also renamte NodeType to PageType and make it a string so it can be used in `where`.

Updates #2297

bep added a commit that referenced this issue Nov 22, 2016

bep added a commit that referenced this issue Nov 22, 2016

bep added a commit that referenced this issue Nov 22, 2016

node to page: Rename PageType to Kind
And embed that on Page.

Updates #2297

bep added a commit that referenced this issue Nov 22, 2016

node to page: Make Kind a string
Having a custom string type isn't worth it when it doesn't work
with `where`, `eq` etc.

Fixes #2689
Updates #2297

bep added a commit that referenced this issue Nov 22, 2016

node to page: Remove Node
And misc. TODO-fixes

Updates #2297

bep added a commit that referenced this issue Nov 22, 2016

node to page: Handle URLs
This includes removing the error return value from Permalink and RelPermalink.

We ignore that error all over the place, so we might as well remove it.

Updates #2297

bep added a commit that referenced this issue Nov 22, 2016

bep added a commit that referenced this issue Nov 22, 2016

node to page: Fix the Page copy()
By embeding the init sync.Once var in a pointer so we can reset it when we copy the page.

Updates #2297

bep added a commit that referenced this issue Nov 22, 2016

bep added a commit that referenced this issue Nov 22, 2016

node to page: Only return regular pages in home.Data.Pages
Returning all types is both confusing and too breaking.

All page types can be fetched in .Site.Pages.

Updates #2297

bep added a commit that referenced this issue Nov 22, 2016

bep added a commit that referenced this issue Nov 22, 2016

node to page: Render aliases before pages
Some sites, Hugo docs included, have faulty alias definitions that point
to itself or another real page. These will be overwritten in the next step.

This is how it behaves in Hugo 0.17, too.

Updates #2297

bep added a commit that referenced this issue Nov 22, 2016

bep added a commit that referenced this issue Nov 22, 2016

docs: Make the tools content page a section page
Because it is the right solution and it the avoids naming conflict with section vs page.

Updates #2297

bep added a commit that referenced this issue Nov 22, 2016

bep added a commit that referenced this issue Nov 22, 2016

bep added a commit that referenced this issue Nov 22, 2016

bep added a commit that referenced this issue Nov 22, 2016

bep added a commit that referenced this issue Nov 22, 2016

bep added a commit that referenced this issue Nov 22, 2016

bep added a commit that referenced this issue Nov 22, 2016

docs: Add Pages to variables section
And some other minor doc fixes.

Closes #2297
Closes #2649

tychoish added a commit to tychoish/hugo that referenced this issue Aug 13, 2017

Add Translations and AllTranslations to Node
This commit also consolidates URLs on Node vs Page, so now .Permalink should be interoperable.

Note that this implementations should be fairly short-livded, waiting for #2297, but the API should be stable.

tychoish added a commit to tychoish/hugo that referenced this issue Aug 13, 2017

Create a Node map to get proper node translations
In a multi-language setup, before this commit the Node's Translations() method
would return some "dummy nodes" that would point to the correct page (Permalink),
but would not be the same as the node it points to -- it would not have the translated
title etc.

The node creation is, however, so mingled with rendering, whihc is too early to have any global state,
so the nodes has to be split in a prepare and a render phase. This commits does that with as small
a change as possible. This implementation is a temp solution until we fix #2297.

Updates #2309
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment