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

Auto-summary isn't always set #4655

Closed
bep opened this Issue Apr 21, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@bep
Member

bep commented Apr 21, 2018

I haven't found at the "what" and a failing test case for it, but this was discovered when diffing the output of my test site when working on #4632 -- which fixes this issue.

The auto summary is the .Summary you get when not having a <!--more--> in your content files.

@bep bep self-assigned this Apr 21, 2018

@bep bep added the Bug label Apr 21, 2018

@bep bep added this to the v0.40 milestone Apr 21, 2018

bep added a commit to bep/hugo that referenced this issue Apr 21, 2018

Make .Content (almost) always available in shortcodes
This resolves some surprising behaviour when reading other pages' content from shortcodes. Note that this has never been an issue from regular templates.

Note that it will still not be possible to get **the current shortcode's  page's rendered content**. That would have made Einstein impressed.

Benchmarks shows that doing this is as fast as the old approach. Only better.

Fixes gohugoio#4632
Fixes gohugoio#4653
Fixes gohugoio#4655

bep added a commit to bep/hugo that referenced this issue Apr 21, 2018

Make .Content (almost) always available in shortcodes
This resolves some surprising behaviour when reading other pages' content from shortcodes. Note that this has never been an issue from regular templates.

Note that it will still not be possible to get **the current shortcode's  page's rendered content**. That would have made Einstein impressed.

So the current simple rules are:

* `.Page.Content` will be empty. The related `.Page.Truncated` `.Page.Summary`, `.WordCount`, `.ReadingTime`, `.Plain` and `.PlainWords` will also have empty values.
* For _other pages_ (retrieved via `.Page.Site.GetPage`, `.Site.Pages` etc.) the `.Content` there to use as long as you don't have infinite content recursion in your shortcode/content setup. See below.

If you get into a situation of infinite recursion, the `.Content` will be empty. Run `hugo -v` for more information.

Fixes gohugoio#4632
Fixes gohugoio#4653
Fixes gohugoio#4655

bep added a commit to bep/hugo that referenced this issue Apr 21, 2018

Make .Content (almost) always available in shortcodes
This resolves some surprising behaviour when reading other pages' content from shortcodes. Note that this has never been an issue from regular templates.

Note that it will still not be possible to get **the current shortcode's  page's rendered content**. That would have made Einstein impressed.

So the current simple rules are:

* `.Page.Content` will be empty. The related `.Page.Truncated` `.Page.Summary`, `.WordCount`, `.ReadingTime`, `.Plain` and `.PlainWords` will also have empty values.
* For _other pages_ (retrieved via `.Page.Site.GetPage`, `.Site.Pages` etc.) the `.Content` there to use as long as you don't have infinite content recursion in your shortcode/content setup. See below.

If you get into a situation of infinite recursion, the `.Content` will be empty. Run `hugo -v` for more information.

Fixes gohugoio#4632
Fixes gohugoio#4653
Fixes gohugoio#4655

bep added a commit to bep/hugo that referenced this issue Apr 21, 2018

Make .Content (almost) always available in shortcodes
This resolves some surprising behaviour when reading other pages' content from shortcodes. Note that this has never been an issue from regular templates.

Note that it will still not be possible to get **the current shortcode's  page's rendered content**. That would have made Einstein impressed.

So the current simple rules are:

* `.Page.Content` will be empty. The related `.Page.Truncated` `.Page.Summary`, `.WordCount`, `.ReadingTime`, `.Plain` and `.PlainWords` will also have empty values.
* For _other pages_ (retrieved via `.Page.Site.GetPage`, `.Site.Pages` etc.) the `.Content` there to use as long as you don't have infinite content recursion in your shortcode/content setup. See below.

If you get into a situation of infinite recursion, the `.Content` will be empty. Run `hugo -v` for more information.

Fixes gohugoio#4632
Fixes gohugoio#4653
Fixes gohugoio#4655

bep added a commit to bep/hugo that referenced this issue Apr 21, 2018

Make .Content (almost) always available in shortcodes
This resolves some surprising behaviour when reading other pages' content from shortcodes. Note that this has never been an issue from regular templates.

Note that it will still not be possible to get **the current shortcode's  page's rendered content**. That would have made Einstein impressed.

So the current simple rules are:

* `.Page.Content` will be empty. The related `.Page.Truncated` `.Page.Summary`, `.WordCount`, `.ReadingTime`, `.Plain` and `.PlainWords` will also have empty values.
* For _other pages_ (retrieved via `.Page.Site.GetPage`, `.Site.Pages` etc.) the `.Content` is there to use as you please as long as you don't have infinite content recursion in your shortcode/content setup. See below.

If you get into a situation of infinite recursion, the `.Content` will be empty. Run `hugo -v` for more information.

Fixes gohugoio#4632
Fixes gohugoio#4653
Fixes gohugoio#4655

bep added a commit to bep/hugo that referenced this issue Apr 21, 2018

Make .Content (almost) always available in shortcodes
This resolves some surprising behaviour when reading other pages' content from shortcodes. Note that this has never been an issue from regular templates.

Note that it will still not be possible to get **the current shortcode's  page's rendered content**. That would have made Einstein impressed.

So the current simple rules are:

* `.Page.Content` will be empty. The related `.Page.Truncated` `.Page.Summary`, `.WordCount`, `.ReadingTime`, `.Plain` and `.PlainWords` will also have empty values.
* For _other pages_ (retrieved via `.Page.Site.GetPage`, `.Site.Pages` etc.) the `.Content` is there to use as you please as long as you don't have infinite content recursion in your shortcode/content setup. See below.

If you get into a situation of infinite recursion, the `.Content` will be empty. Run `hugo -v` for more information.

Fixes gohugoio#4632
Fixes gohugoio#4653
Fixes gohugoio#4655

bep added a commit to bep/hugo that referenced this issue Apr 21, 2018

Make .Content (almost) always available in shortcodes
This resolves some surprising behaviour when reading other pages' content from shortcodes. Note that this has never been an issue from regular templates.

Note that it will still not be possible to get **the current shortcode's  page's rendered content**. That would have made Einstein impressed.

So the current simple rules are:

* `.Page.Content` will be empty. The related `.Page.Truncated` `.Page.Summary`, `.WordCount`, `.ReadingTime`, `.Plain` and `.PlainWords` will also have empty values.
* For _other pages_ (retrieved via `.Page.Site.GetPage`, `.Site.Pages` etc.) the `.Content` is there to use as you please as long as you don't have infinite content recursion in your shortcode/content setup. See below.

If you get into a situation of infinite recursion, the `.Content` will be empty. Run `hugo -v` for more information.

Fixes gohugoio#4632
Fixes gohugoio#4653
Fixes gohugoio#4655

bep added a commit to bep/hugo that referenced this issue Apr 21, 2018

Make .Content (almost) always available in shortcodes
This resolves some surprising behaviour when reading other pages' content from shortcodes. Note that this has never been an issue from regular templates.

Note that it will still not be possible to get **the current shortcode's  page's rendered content**. That would have made Einstein impressed.

So the current simple rules are:

* `.Page.Content` from a shortcode will be empty. The related `.Page.Truncated` `.Page.Summary`, `.Page.WordCount`, `.Page.ReadingTime`, `.Page.Plain` and `.Page.PlainWords` will also have empty values.
* For _other pages_ (retrieved via `.Page.Site.GetPage`, `.Site.Pages` etc.) the `.Content` is there to use as you please as long as you don't have infinite content recursion in your shortcode/content setup. See below.
* `.Page.TableOfContents` is good to go (but does not support shortcodes in headlines; this is unchanged)

If you get into a situation of infinite recursion, the `.Content` will be empty. Run `hugo -v` for more information.

Fixes gohugoio#4632
Fixes gohugoio#4653
Fixes gohugoio#4655

bep added a commit to bep/hugo that referenced this issue Apr 21, 2018

Make .Content (almost) always available in shortcodes
This resolves some surprising behaviour when reading other pages' content from shortcodes. Before this commit, that behaviour has been undefined. Note that this has never been an issue from regular templates.

It will still not be possible to get **the current shortcode's  page's rendered content**. That would have impressed Einstein.

The new and well defined rules are:

* `.Page.Content` from a shortcode will be empty. The related `.Page.Truncated` `.Page.Summary`, `.Page.WordCount`, `.Page.ReadingTime`, `.Page.Plain` and `.Page.PlainWords` will also have empty values.
* For _other pages_ (retrieved via `.Page.Site.GetPage`, `.Site.Pages` etc.) the `.Content` is there to use as you please as long as you don't have infinite content recursion in your shortcode/content setup. See below.
* `.Page.TableOfContents` is good to go (but does not support shortcodes in headlines; this is unchanged)

If you get into a situation of infinite recursion, the `.Content` will be empty. Run `hugo -v` for more information.

Fixes gohugoio#4632
Fixes gohugoio#4653
Fixes gohugoio#4655

bep added a commit to bep/hugo that referenced this issue Apr 21, 2018

Make .Content (almost) always available in shortcodes
This resolves some surprising behaviour when reading other pages' content from shortcodes. Before this commit, that behaviour has been undefined. Note that this has never been an issue from regular templates.

It will still not be possible to get **the current shortcode's  page's rendered content**. That would have impressed Einstein.

The new and well defined rules are:

* `.Page.Content` from a shortcode will be empty. The related `.Page.Truncated` `.Page.Summary`, `.Page.WordCount`, `.Page.ReadingTime`, `.Page.Plain` and `.Page.PlainWords` will also have empty values.
* For _other pages_ (retrieved via `.Page.Site.GetPage`, `.Site.Pages` etc.) the `.Content` is there to use as you please as long as you don't have infinite content recursion in your shortcode/content setup. See below.
* `.Page.TableOfContents` is good to go (but does not support shortcodes in headlines; this is unchanged)

If you get into a situation of infinite recursion, the `.Content` will be empty. Run `hugo -v` for more information.

Fixes gohugoio#4632
Fixes gohugoio#4653
Fixes gohugoio#4655

bep added a commit to bep/hugo that referenced this issue Apr 21, 2018

Make .Content (almost) always available in shortcodes
This resolves some surprising behaviour when reading other pages' content from shortcodes. Before this commit, that behaviour has been undefined. Note that this has never been an issue from regular templates.

It will still not be possible to get **the current shortcode's  page's rendered content**. That would have impressed Einstein.

The new and well defined rules are:

* `.Page.Content` from a shortcode will be empty. The related `.Page.Truncated` `.Page.Summary`, `.Page.WordCount`, `.Page.ReadingTime`, `.Page.Plain` and `.Page.PlainWords` will also have empty values.
* For _other pages_ (retrieved via `.Page.Site.GetPage`, `.Site.Pages` etc.) the `.Content` is there to use as you please as long as you don't have infinite content recursion in your shortcode/content setup. See below.
* `.Page.TableOfContents` is good to go (but does not support shortcodes in headlines; this is unchanged)

If you get into a situation of infinite recursion, the `.Content` will be empty. Run `hugo -v` for more information.

Fixes gohugoio#4632
Fixes gohugoio#4653
Fixes gohugoio#4655

bep added a commit to bep/hugo that referenced this issue Apr 21, 2018

Make .Content (almost) always available in shortcodes
This resolves some surprising behaviour when reading other pages' content from shortcodes. Before this commit, that behaviour has been undefined. Note that this has never been an issue from regular templates.

It will still not be possible to get **the current shortcode's  page's rendered content**. That would have impressed Einstein.

The new and well defined rules are:

* `.Page.Content` from a shortcode will be empty. The related `.Page.Truncated` `.Page.Summary`, `.Page.WordCount`, `.Page.ReadingTime`, `.Page.Plain` and `.Page.PlainWords` will also have empty values.
* For _other pages_ (retrieved via `.Page.Site.GetPage`, `.Site.Pages` etc.) the `.Content` is there to use as you please as long as you don't have infinite content recursion in your shortcode/content setup. See below.
* `.Page.TableOfContents` is good to go (but does not support shortcodes in headlines; this is unchanged)

If you get into a situation of infinite recursion, the `.Content` will be empty. Run `hugo -v` for more information.

Fixes gohugoio#4632
Fixes gohugoio#4653
Fixes gohugoio#4655

bep added a commit to bep/hugo that referenced this issue Apr 21, 2018

Make .Content (almost) always available in shortcodes
This resolves some surprising behaviour when reading other pages' content from shortcodes. Before this commit, that behaviour has been undefined. Note that this has never been an issue from regular templates.

It will still not be possible to get **the current shortcode's  page's rendered content**. That would have impressed Einstein.

The new and well defined rules are:

* `.Page.Content` from a shortcode will be empty. The related `.Page.Truncated` `.Page.Summary`, `.Page.WordCount`, `.Page.ReadingTime`, `.Page.Plain` and `.Page.PlainWords` will also have empty values.
* For _other pages_ (retrieved via `.Page.Site.GetPage`, `.Site.Pages` etc.) the `.Content` is there to use as you please as long as you don't have infinite content recursion in your shortcode/content setup. See below.
* `.Page.TableOfContents` is good to go (but does not support shortcodes in headlines; this is unchanged)

If you get into a situation of infinite recursion, the `.Content` will be empty. Run `hugo -v` for more information.

Fixes gohugoio#4632
Fixes gohugoio#4653
Fixes gohugoio#4655

bep added a commit to bep/hugo that referenced this issue Apr 21, 2018

Make .Content (almost) always available in shortcodes
This resolves some surprising behaviour when reading other pages' content from shortcodes. Before this commit, that behaviour was undefined. Note that this has never been an issue from regular templates.

It will still not be possible to get **the current shortcode's  page's rendered content**. That would have impressed Einstein.

The new and well defined rules are:

* `.Page.Content` from a shortcode will be empty. The related `.Page.Truncated` `.Page.Summary`, `.Page.WordCount`, `.Page.ReadingTime`, `.Page.Plain` and `.Page.PlainWords` will also have empty values.
* For _other pages_ (retrieved via `.Page.Site.GetPage`, `.Site.Pages` etc.) the `.Content` is there to use as you please as long as you don't have infinite content recursion in your shortcode/content setup. See below.
* `.Page.TableOfContents` is good to go (but does not support shortcodes in headlines; this is unchanged)

If you get into a situation of infinite recursion, the `.Content` will be empty. Run `hugo -v` for more information.

Fixes gohugoio#4632
Fixes gohugoio#4653
Fixes gohugoio#4655

bep added a commit to bep/hugo that referenced this issue Apr 21, 2018

Make .Content (almost) always available in shortcodes
This resolves some surprising behaviour when reading other pages' content from shortcodes. Before this commit, that behaviour was undefined. Note that this has never been an issue from regular templates.

It will still not be possible to get **the current shortcode's  page's rendered content**. That would have impressed Einstein.

The new and well defined rules are:

* `.Page.Content` from a shortcode will be empty. The related `.Page.Truncated` `.Page.Summary`, `.Page.WordCount`, `.Page.ReadingTime`, `.Page.Plain` and `.Page.PlainWords` will also have empty values.
* For _other pages_ (retrieved via `.Page.Site.GetPage`, `.Site.Pages` etc.) the `.Content` is there to use as you please as long as you don't have infinite content recursion in your shortcode/content setup. See below.
* `.Page.TableOfContents` is good to go (but does not support shortcodes in headlines; this is unchanged)

If you get into a situation of infinite recursion, the `.Content` will be empty. Run `hugo -v` for more information.

Fixes gohugoio#4632
Fixes gohugoio#4653
Fixes gohugoio#4655

bep added a commit to bep/hugo that referenced this issue Apr 21, 2018

Make .Content (almost) always available in shortcodes
This resolves some surprising behaviour when reading other pages' content from shortcodes. Before this commit, that behaviour was undefined. Note that this has never been an issue from regular templates.

It will still not be possible to get **the current shortcode's  page's rendered content**. That would have impressed Einstein.

The new and well defined rules are:

* `.Page.Content` from a shortcode will be empty. The related `.Page.Truncated` `.Page.Summary`, `.Page.WordCount`, `.Page.ReadingTime`, `.Page.Plain` and `.Page.PlainWords` will also have empty values.
* For _other pages_ (retrieved via `.Page.Site.GetPage`, `.Site.Pages` etc.) the `.Content` is there to use as you please as long as you don't have infinite content recursion in your shortcode/content setup. See below.
* `.Page.TableOfContents` is good to go (but does not support shortcodes in headlines; this is unchanged)

If you get into a situation of infinite recursion, the `.Content` will be empty. Run `hugo -v` for more information.

Fixes gohugoio#4632
Fixes gohugoio#4653
Fixes gohugoio#4655

@bep bep closed this in #4651 Apr 21, 2018

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