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

Allow disabling summarization #6296

Closed
mitar opened this issue Sep 1, 2019 · 19 comments
Closed

Allow disabling summarization #6296

mitar opened this issue Sep 1, 2019 · 19 comments
Labels

Comments

@mitar
Copy link

mitar commented Sep 1, 2019

Currently, if I want whole content to be used as the front-page summary, I have to add <!--more--> at the end of the post for whole content to be used without any "summarization" (text converted to plain text). It would be great if there would be a way to disable this content conversion and that I could configure that only a manual split should happen and only if <!--more--> is provided and in all cases that no special conversion should happen.

@divinerites
Copy link

divinerites commented Sep 2, 2019

May be you can test your inner and decide to use either summary or content ?

Making summary behave like content seems a bit strange ...

@mitar
Copy link
Author

mitar commented Sep 2, 2019

May be you can test your inner and decide to use either summary or content ?

Sorry, but I do not understand what you are asking here.

Making summary behave like content seems a bit strange ...

I mean, summary is initial content, and then the rest of the content follows. This is why you have manual summary splitting. I think this is a pretty common thing.

What I am asking for is that if there is no <!--more--> tag present, I would like the automatic summary splitting to not come into the effect, but would like full content to be used as a summary.

Currently I have the following in my template for the list of posts:

        {{ .Summary }}
        {{ if .Truncated }}
        <p class="read_more_container">
            <a href="{{ .Params.href | default .Permalink }}"
               class="read_more">
                Keep reading
            </a>
        </p>
        {{ end}}

I set summaryLength = 1000000000000000, but it looks like summary still gets passes through plainify automatically. But only if no <!--more--> is present. So I would like to disable this automatic conversion/splitting altogether?

@divinerites
Copy link

divinerites commented Sep 3, 2019

I mean : may be you can use and test if your {{ .Inner }} contains "< !-- more -- >" and then use either {{ .Summary }} or {{ .Content }}

@mitar
Copy link
Author

mitar commented Sep 18, 2019

I see. I didn't know I could access raw content or that I could check if it contains <!--more--> and that that will not be extracted out. I tried to see how to get this to work but could not make it. Could you write the syntax how to implement such check, please?

@patdavid
Copy link

Can't you just switch based on the presence of .Truncated?

{{ if .Truncated }}
    {{ .Summary }}
{{ else }}
    {{ .Content }}
{{ end }}

@mitar
Copy link
Author

mitar commented Sep 19, 2019

No, .Truncated does not apply here at all. The problem is not about that.

So if I have content <!-- more --> content then .Truncated is set. But if I have just content <!-- more --> or just content then .Truncated is not set. I think this is expected behavior.

What is not expected is that if I have content, then plainify happens, but if I have content <!-- more --> then plainify does not happen.

@stale
Copy link

stale bot commented Jan 19, 2020

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.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@stale stale bot added the Stale label Jan 19, 2020
@mitar
Copy link
Author

mitar commented Jan 19, 2020

Existing workaround do not address the issue really.

@stale stale bot removed the Stale label Jan 19, 2020
@stale
Copy link

stale bot commented May 18, 2020

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.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@stale stale bot added the Stale label May 18, 2020
@mitar
Copy link
Author

mitar commented May 26, 2020

Existing workaround do not address the issue really.

@stale stale bot removed the Stale label May 26, 2020
@stale
Copy link

stale bot commented Oct 4, 2020

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.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@stale stale bot added the Stale label Oct 4, 2020
@mitar
Copy link
Author

mitar commented Oct 4, 2020

Still relevant.

@github-actions
Copy link

github-actions bot commented Mar 8, 2022

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.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@github-actions github-actions bot added the Stale label Mar 8, 2022
@mitar
Copy link
Author

mitar commented Mar 8, 2022

Still relevant.

@github-actions
Copy link

github-actions bot commented Mar 9, 2023

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.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@github-actions github-actions bot added the Stale label Mar 9, 2023
@mitar
Copy link
Author

mitar commented Mar 9, 2023

Still relevant.

@github-actions github-actions bot removed the Stale label Mar 10, 2023
@jmooring
Copy link
Member

Unless I'm missing something, this addresses the use case as described:

{{ if findRE `<!--more-->` .RawContent }}
  {{ .Summary }}
{{ else }}
  {{ .Content }}
{{ end }}

We are not adding a configuration option to provide this behavior.

@mitar
Copy link
Author

mitar commented May 17, 2023

Thank you. This indeed works. No need then for a setting.

@github-actions
Copy link

github-actions bot commented Jun 8, 2023

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 Jun 8, 2023
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

4 participants