I'm currently using one solution proposed at the forum, replacing
{{ blog_post.description_from_content }}
with a
{% if blog_post.gen_description %}
{{ blog_post.content|safe|truncatewords:60 }}
{% else %}
{{ blog_post.description|safe }}
{% endif %}
and it works pretty well, but I believe tha
I'm currently using one solution proposed at the forum, replacing
{{ blog_post.description_from_content }}
with a
{% if blog_post.gen_description %}
{{ blog_post.content|safe|truncatewords:60 }}
{% else %}
{{ blog_post.description|safe }}
{% endif %}
and it works pretty well, w
>
> description = content[:max_char_count]
>
> Isn't something like this viable?
I don't see how cutting off mid-word, or even mid-sentence could be an
improvement. But maybe capturing every sentence within a character limit
with something like:
description = re.sub(r"[!?.].*$", '', content[:max
Yes. This may be the best solution.
Em segunda-feira, 16 de maio de 2016 10:28:58 UTC-4, Eduardo Rivas escreveu:
>
> Another solution: let the developer point to a callable via settings.
>
--
You received this message because you are subscribed to the Google Groups
"Mezzanine Users" group.
To
Another solution: let the developer point to a callable via settings.
--
You received this message because you are subscribed to the Google Groups
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to mezzanine-users+unsubscr...@googlegroups
description = content[:max_char_count]
Isn't something like this viable?
Em segunda-feira, 16 de maio de 2016 09:54:53 UTC-4, Ryne Everett escreveu:
>
> Maybe a char count, or word count?
>>
>
> What happens when the first sentence is too small? Use the second sentence?
>
> My experience is tha
>
> Maybe a char count, or word count?
>
What happens when the first sentence is too small? Use the second sentence?
My experience is that it’s rather annoying to manually set the description
> - which you have to do every time your post begins with a short sentence,
> since the generated descrip
Isn’t there a better algorithm to automatically generate the description?
Maybe a char count, or word count?
My experience is that it’s rather annoying to manually set the description
- which you have to do every time your post begins with a short sentence,
since the generated description looks