docusaurus/packages/docusaurus-1.x/lib/core
PA 1bf590ea2b fix(v1): fix page title render issue when referred by search result (#1869)
* fix(v1): Fix page title render issue when referred by search result

When Algolia DocSearch query finds a match for a page's title, it attempts to generate
a permalink. Because the page title element (`h1`) does not have an `id`, Algolia
generates uses the `id` from closes parent element. Because of this, the page title
scrolls to a position that is slightly overlayed by the fixed top navigation bar.

This fix sets an `id` for the page title so that the search result is able to generate
a more accurate permalink.

* Adjust css for handling post title to be on the top when referred by an anchor

The post title can sometimes be referred by an anchor using the "id" of that element.
In that case the title will be automatically be the first element within the viewport.
Since we have a header fixed at the top of the view port, the title becomes hidden or
not visible. That's why some css adjustments are needed so that if any user ends up
with a link to a page that is referring to the post title (i.e. auto generated anchor
link by algolia DocSearch).

The css code uses pseudo element `:before` to make the adjustments. Details on this
can be found in the following article:

https://css-tricks.com/hash-tag-links-padding/

* Adjust CSS so that different selectors are on separate lines
2019-11-18 11:07:02 -08:00
..
__tests__ chore: bump dependencies 2019-11-01 01:25:10 +07:00
nav fix(v2): swizzle should receive correct load context (#1844) 2019-10-16 08:56:09 -07:00
anchors.js fix(v2): swizzle should receive correct load context (#1844) 2019-10-16 08:56:09 -07:00
BlogPageLayout.js feat: make blog posts unlisted only in production 2019-06-15 10:32:43 -07:00
BlogPost.js fix(v2): swizzle should receive correct load context (#1844) 2019-10-16 08:56:09 -07:00
BlogPostLayout.js chore: move to monorepo (#1297) 2019-03-23 14:21:36 +07:00
BlogSidebar.js feat: make blog posts unlisted only in production 2019-06-15 10:32:43 -07:00
CodeTabsMarkdownBlock.js chore: move to monorepo (#1297) 2019-03-23 14:21:36 +07:00
CompLibrary.js chore: move to monorepo (#1297) 2019-03-23 14:21:36 +07:00
Container.js chore: move to monorepo (#1297) 2019-03-23 14:21:36 +07:00
Doc.js fix(v1): fix page title render issue when referred by search result (#1869) 2019-11-18 11:07:02 -08:00
DocsLayout.js feat(v1): allow specifying meta desc in front matter (#1859) 2019-10-20 11:17:10 -07:00
DocsSidebar.js fix: remove the Container component from the docsNavContainer (#1599) 2019-06-13 09:05:41 -07:00
GridBlock.js chore: move to monorepo (#1297) 2019-03-23 14:21:36 +07:00
Head.js fix(v2): swizzle should receive correct load context (#1844) 2019-10-16 08:56:09 -07:00
MarkdownBlock.js chore: move to monorepo (#1297) 2019-03-23 14:21:36 +07:00
Redirect.js chore: move to monorepo (#1297) 2019-03-23 14:21:36 +07:00
Remarkable.js chore: move to monorepo (#1297) 2019-03-23 14:21:36 +07:00
renderMarkdown.js chore: bump dependencies 2019-11-01 01:25:10 +07:00
Site.js fix(v2): swizzle should receive correct load context (#1844) 2019-10-16 08:56:09 -07:00
toc.js chore: bump dependencies 2019-11-01 01:25:10 +07:00
toSlug.js fix: replace apostrophe with empty string in header slugification (#1618) 2019-06-21 17:40:04 -07:00
unindent.js chore: move to monorepo (#1297) 2019-03-23 14:21:36 +07:00
utils.js chore: move to monorepo (#1297) 2019-03-23 14:21:36 +07:00