mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-12 01:50:52 +01:00
Truncate search result text for performance reasons
This commit is contained in:
parent
675a75e000
commit
d77d900479
File diff suppressed because one or more lines are too long
@ -151,7 +151,7 @@
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% block scripts %}
|
||||
<script src="{{ base_url }}/assets/javascripts/application-1380e43b15.js"></script>
|
||||
<script src="{{ base_url }}/assets/javascripts/application-c5d094b286.js"></script>
|
||||
<script>app.initialize({url:{base:"{{ base_url }}"}})</script>
|
||||
{% for path in extra_javascript %}
|
||||
<script src="{{ path }}"></script>
|
||||
|
@ -205,14 +205,16 @@ export default class Result {
|
||||
</h1>
|
||||
{section.text.length ?
|
||||
<p class="md-search-result__teaser">
|
||||
{{ __html: section.text.replace(match, highlight) }}
|
||||
{{ __html: this.truncate_(
|
||||
section.text.replace(match, highlight), 400)
|
||||
}}
|
||||
</p> : {}}
|
||||
</article>
|
||||
</a>
|
||||
)
|
||||
})}
|
||||
</li>
|
||||
) /* {this.truncate_(doc.text, 140)} */
|
||||
)
|
||||
})
|
||||
|
||||
/* Bind click handlers for anchors */
|
||||
|
Loading…
Reference in New Issue
Block a user