mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-30 02:37:59 +02:00
fix(theme): add __ prefix to technical anchors, search crawlers (Algolia) should ignore them (#8909)
This commit is contained in:
parent
f154b2f870
commit
d220f481a7
12 changed files with 22 additions and 16 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -14,8 +14,11 @@ import {useLocationChange} from './useLocationChange';
|
||||||
* The id of the element that should become focused on a page
|
* The id of the element that should become focused on a page
|
||||||
* that does not have a <main> html tag.
|
* that does not have a <main> html tag.
|
||||||
* Focusing the Docusaurus Layout children is a reasonable fallback.
|
* Focusing the Docusaurus Layout children is a reasonable fallback.
|
||||||
|
*
|
||||||
|
* __ prefix allows search crawlers (Algolia/DocSearch) to ignore anchors
|
||||||
|
* https://github.com/facebook/docusaurus/issues/8883#issuecomment-1516328368
|
||||||
*/
|
*/
|
||||||
export const SkipToContentFallbackId = 'docusaurus_skipToContent_fallback';
|
export const SkipToContentFallbackId = '__docusaurus_skipToContent_fallback';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the skip to content element to focus when the link is clicked.
|
* Returns the skip to content element to focus when the link is clicked.
|
||||||
|
|
|
@ -5,7 +5,10 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const blogPostContainerID = 'post-content';
|
// __ prefix allows search crawlers (Algolia/DocSearch) to ignore anchors
|
||||||
|
// https://github.com/facebook/docusaurus/issues/8883#issuecomment-1516328368
|
||||||
|
export const blogPostContainerID = '__blog-post-container';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
default as applyTrailingSlash,
|
default as applyTrailingSlash,
|
||||||
type ApplyTrailingSlashParams,
|
type ApplyTrailingSlashParams,
|
||||||
|
|
|
@ -14,12 +14,12 @@ import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
||||||
// Double-security: critical CSS will hide the banner if CSS can load!
|
// Double-security: critical CSS will hide the banner if CSS can load!
|
||||||
import './styles.module.css';
|
import './styles.module.css';
|
||||||
|
|
||||||
const BannerContainerId = 'docusaurus-base-url-issue-banner-container';
|
// __ prefix allows search crawlers (Algolia/DocSearch) to ignore anchors
|
||||||
|
// https://github.com/facebook/docusaurus/issues/8883#issuecomment-1516328368
|
||||||
const BannerId = 'docusaurus-base-url-issue-banner';
|
const BannerContainerId = '__docusaurus-base-url-issue-banner-container';
|
||||||
|
const BannerId = '__docusaurus-base-url-issue-banner';
|
||||||
const SuggestionContainerId =
|
const SuggestionContainerId =
|
||||||
'docusaurus-base-url-issue-banner-suggestion-container';
|
'__docusaurus-base-url-issue-banner-suggestion-container';
|
||||||
|
|
||||||
const InsertBannerWindowAttribute = '__DOCUSAURUS_INSERT_BASEURL_BANNER';
|
const InsertBannerWindowAttribute = '__DOCUSAURUS_INSERT_BASEURL_BANNER';
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,6 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
:global(#docusaurus-base-url-issue-banner-container) {
|
:global(#__docusaurus-base-url-issue-banner-container) {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue