Rollup merge of #109977 - notriddle:notriddle/data-nosnippet, r=jsha,the8472
rustdoc: avoid including line numbers in Google SERP snippets 
This commit is contained in:
commit
08ab38a703
@ -352,7 +352,7 @@ pre.item-decl {
|
|||||||
.source .content pre {
|
.source .content pre {
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
}
|
}
|
||||||
.rustdoc.source .example-wrap > pre.src-line-numbers {
|
.rustdoc.source .example-wrap pre.src-line-numbers {
|
||||||
padding: 20px 0 20px 4px;
|
padding: 20px 0 20px 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -537,17 +537,17 @@ ul.block, .block li {
|
|||||||
margin-bottom: 0px;
|
margin-bottom: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rustdoc .example-wrap > pre {
|
.rustdoc .example-wrap pre {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rustdoc:not(.source) .example-wrap > pre {
|
.rustdoc:not(.source) .example-wrap pre {
|
||||||
overflow: auto hidden;
|
overflow: auto hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rustdoc .example-wrap > pre.example-line-numbers,
|
.rustdoc .example-wrap pre.example-line-numbers,
|
||||||
.rustdoc .example-wrap > pre.src-line-numbers {
|
.rustdoc .example-wrap pre.src-line-numbers {
|
||||||
flex-grow: 0;
|
flex-grow: 0;
|
||||||
min-width: fit-content; /* prevent collapsing into nothing in truncated scraped examples */
|
min-width: fit-content; /* prevent collapsing into nothing in truncated scraped examples */
|
||||||
overflow: initial;
|
overflow: initial;
|
||||||
@ -558,7 +558,7 @@ ul.block, .block li {
|
|||||||
color: var(--src-line-numbers-span-color);
|
color: var(--src-line-numbers-span-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.rustdoc .example-wrap > pre.src-line-numbers {
|
.rustdoc .example-wrap pre.src-line-numbers {
|
||||||
padding: 14px 0;
|
padding: 14px 0;
|
||||||
}
|
}
|
||||||
.src-line-numbers a, .src-line-numbers span {
|
.src-line-numbers a, .src-line-numbers span {
|
||||||
@ -706,7 +706,7 @@ h2.small-section-header > .anchor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.main-heading a:hover,
|
.main-heading a:hover,
|
||||||
.example-wrap > .rust a:hover,
|
.example-wrap .rust a:hover,
|
||||||
.all-items a:hover,
|
.all-items a:hover,
|
||||||
.docblock a:not(.test-arrow):not(.scrape-help):not(.tooltip):hover,
|
.docblock a:not(.test-arrow):not(.scrape-help):not(.tooltip):hover,
|
||||||
.docblock-short a:not(.test-arrow):not(.scrape-help):not(.tooltip):hover,
|
.docblock-short a:not(.test-arrow):not(.scrape-help):not(.tooltip):hover,
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<div class="example-wrap"> {# #}
|
<div class="example-wrap"> {# #}
|
||||||
<pre class="src-line-numbers">
|
{# https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag#data-nosnippet-attr
|
||||||
|
Do not show "1 2 3 4 5 ..." in web search results. #}
|
||||||
|
<div data-nosnippet><pre class="src-line-numbers">
|
||||||
{% for line in lines.clone() %}
|
{% for line in lines.clone() %}
|
||||||
{% if embedded %}
|
{% if embedded %}
|
||||||
<span>{{line|safe}}</span>
|
<span>{{line|safe}}</span>
|
||||||
@ -7,7 +9,7 @@
|
|||||||
<a href="#{{line|safe}}" id="{{line|safe}}">{{line|safe}}</a>
|
<a href="#{{line|safe}}" id="{{line|safe}}">{{line|safe}}</a>
|
||||||
{%~ endif %}
|
{%~ endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</pre> {# #}
|
</pre></div> {# #}
|
||||||
<pre class="rust"> {# #}
|
<pre class="rust"> {# #}
|
||||||
<code>
|
<code>
|
||||||
{% if needs_expansion %}
|
{% if needs_expansion %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user