Skip to content

fix(): Change logic of hiding context menu #248

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

Merged
merged 1 commit into from
Nov 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/_includes/sidebar/menu-side.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
{% assign maxHeader = include.h_max | default: 6 %}
{% assign nodes = include.html | split: '<h' %}
{% assign firstHeader = true %}
{% assign amount = 0 %}

{% capture listModifier %}{% if orderedList %}1.{% else %}-{% endif %}{% endcapture %}

Expand All @@ -45,6 +46,8 @@

{% if headerLevel < minHeader or headerLevel > maxHeader %}
{% continue %}
{% else %}
{% assign amount = i | plus:1 %}
{% endif %}

{% if firstHeader %}
Expand Down Expand Up @@ -95,7 +98,7 @@
{% endif %}
{% endcapture %}{% assign tocWorkspace = '' %}

{% assign amount = _hAttrToStrip | size %}

{% if amount > 0 %}
<p class="destination-menu__title">On this page</p>
{{ my_toc | markdownify | strip }}
Expand Down
74 changes: 53 additions & 21 deletions src/_layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,62 @@
layout: main
---

<article class="home page">
<div class="home__body">
<div>
{%- if page.title -%}
<h1 id="{{ page.title | downcase }}" class="home__heading page__heading">
{{ page.title }} {% unless page.landing %}{{ page.integration_type | capitalize }}{% endunless %}
</h1>
{%- endif -%}

{%- if page.beta -%}
{% include content/beta.md %}
{%- endif -%}

<div class="home__markdown markdown" data-headings-anchors>
{{ content }}
</div>
<main class="docs__body stage__body">
<div>
<div class="search">
{% include_cached navbar/search.html placeholder="Search the Segment documentation..." %}
</div>

<hr>
{% include_cached navbar/navbar-mobile.html %}
</div>

<div class="stage__content">
<article class="home page">
<div class="home__body">
<div>
{%- if page.title -%}
<h1 id="{{ page.title | downcase }}" class="home__heading page__heading">
{{ page.title }} {% unless page.landing %}{{ page.integration_type | capitalize }}{% endunless %}
</h1>
{%- endif -%}

{%- if page.beta -%}
{% include content/beta.md %}
{%- endif -%}

<div class="home__markdown markdown" data-headings-anchors>
{{ content }}
</div>
</div>

<hr>

{% unless page.hide-feedback %}
{% include components/feedback.html %}
{% endunless %}

{% include components/callout.html %}
</div>
</article>
</div>
</main>

<div class="docs__sidebar stage__sidebar">
{% include_cached navbar/nav.html %}

<div class="sidebar sidebar--sticky">
{%- unless page.hide_toc -%}
<div data-anchors-indicator data-sections="h2" data-active-class="menu-side__link--active">
{% include_cached sidebar/menu-side.html class="menu-side" anchor_class="menu-side__link" html=content h_min=2 h_max=2 %}
</div>
{%- endunless -%}

{% if page.related %}
{% include sidebar/related-content.html items=page.related %}
{% endif %}

{% unless page.hide-feedback %}
{% include components/feedback.html %}
{% include_cached sidebar/feedback.html %}
{% endunless %}

{% include components/callout.html %}
</div>
</article>
</div>
34 changes: 1 addition & 33 deletions src/_layouts/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,39 +19,7 @@
{% endif %}
</div>

<main class="docs__body stage__body">
<div>
<div class="search">
{% include_cached navbar/search.html placeholder="Search the Segment documentation..." %}
</div>

{% include_cached navbar/navbar-mobile.html %}
</div>

<div class="stage__content">
{{ content }}
</div>
</main>

<div class="docs__sidebar stage__sidebar">
{% include_cached navbar/nav.html %}

<div class="sidebar sidebar--sticky">
{%- unless page.hide_toc -%}
<div data-anchors-indicator data-sections="h2" data-active-class="menu-side__link--active">
{% include_cached sidebar/menu-side.html class="menu-side" anchor_class="menu-side__link" html=content h_min=2 h_max=2 %}
</div>
{%- endunless -%}

{% if page.related %}
{% include sidebar/related-content.html items=page.related %}
{% endif %}

{% unless page.hide-feedback %}
{% include_cached sidebar/feedback.html %}
{% endunless %}
</div>
</div>
{{ content }}
</div>

<footer>
Expand Down
100 changes: 67 additions & 33 deletions src/_layouts/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,84 @@
layout: main
---

<article class="page">
{% include components/breadcrumbs.html %}
<main class="docs__body stage__body">
<div>
<div class="search">
{% include_cached navbar/search.html placeholder="Search the Segment documentation..." %}
</div>

<div class="page__body" data-headings-anchors>
{%- if page.title -%}
<h1 id="{{ page.title | downcase }}" class="page__heading">
{{ page.title }} {% unless page.landing %}{{ page.integration_type | capitalize }}{% endunless %}
</h1>
{%- endif -%}
{% include_cached navbar/navbar-mobile.html %}
</div>

{%- if page.beta -%}
{% include content/beta.md %}
{%- endif -%}
<div class="stage__content">
<article class="page">
{% include components/breadcrumbs.html %}

{%- unless page.hide_toc -%}
{% include sidebar/mobile-menu-side.html %}
{%- endunless -%}
<div class="page__body" data-headings-anchors>
{%- if page.title -%}
<h1 id="{{ page.title | downcase }}" class="page__heading">
{{ page.title }} {% unless page.landing %}{{ page.integration_type | capitalize }}{% endunless %}
</h1>
{%- endif -%}

<div class="markdown">
{{ content }}
</div>
{%- if page.beta -%}
{% include content/beta.md %}
{%- endif -%}

{% if page.faq %}
<hr>
{%- unless page.hide_toc -%}
{% include sidebar/mobile-menu-side.html %}
{%- endunless -%}

{% include components/faq.html items=page.faq %}
{% endif %}
<div class="markdown">
{{ content }}
</div>

{% if page.contributors %}
{% include components/avatar.html contributors=page.contributors %}
{% endif %}
{% if page.faq %}
<hr>

{% if page.related %}
<hr>
{% include components/faq.html items=page.faq %}
{% endif %}

{% include components/related.html items=page.related %}
{% endif %}
{% if page.contributors %}
{% include components/avatar.html contributors=page.contributors %}
{% endif %}

{% if page.related %}
<hr>

{% include components/related.html items=page.related %}
{% endif %}

<hr>

<hr>
{% unless page.hide-feedback %}
{% include components/feedback.html %}
{% endunless %}

{% include components/callout.html %}
</div>
</article>
</div>
</main>

<div class="docs__sidebar stage__sidebar">
{% include_cached navbar/nav.html %}

<div class="sidebar sidebar--sticky">
{%- unless page.hide_toc -%}
<div data-anchors-indicator data-sections="h2" data-active-class="menu-side__link--active">
{% include_cached sidebar/menu-side.html class="menu-side" anchor_class="menu-side__link" html=content h_min=2 h_max=2 %}
</div>
{%- endunless -%}

{% if page.related %}
{% include sidebar/related-content.html items=page.related %}
{% endif %}

{% unless page.hide-feedback %}
{% include components/feedback.html %}
{% include_cached sidebar/feedback.html %}
{% endunless %}

{% include components/callout.html %}
</div>
</article>
</div>