mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03: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 %}
|
{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
{% block scripts %}
|
{% 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>
|
<script>app.initialize({url:{base:"{{ base_url }}"}})</script>
|
||||||
{% for path in extra_javascript %}
|
{% for path in extra_javascript %}
|
||||||
<script src="{{ path }}"></script>
|
<script src="{{ path }}"></script>
|
||||||
|
@ -205,14 +205,16 @@ export default class Result {
|
|||||||
</h1>
|
</h1>
|
||||||
{section.text.length ?
|
{section.text.length ?
|
||||||
<p class="md-search-result__teaser">
|
<p class="md-search-result__teaser">
|
||||||
{{ __html: section.text.replace(match, highlight) }}
|
{{ __html: this.truncate_(
|
||||||
|
section.text.replace(match, highlight), 400)
|
||||||
|
}}
|
||||||
</p> : {}}
|
</p> : {}}
|
||||||
</article>
|
</article>
|
||||||
</a>
|
</a>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</li>
|
</li>
|
||||||
) /* {this.truncate_(doc.text, 140)} */
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
/* Bind click handlers for anchors */
|
/* Bind click handlers for anchors */
|
||||||
|
Loading…
Reference in New Issue
Block a user