Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(v1): fix page title render issue when referred by search result #1869

Commits on Nov 6, 2019

  1. 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.
    parkas2018 committed Nov 6, 2019
    Configuration menu
    Copy the full SHA
    aa274d8 View commit details
    Browse the repository at this point in the history
  2. 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/
    parkas2018 committed Nov 6, 2019
    Configuration menu
    Copy the full SHA
    4775d16 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    11fea22 View commit details
    Browse the repository at this point in the history