Skip to content

Commit

Permalink
Up
Browse files Browse the repository at this point in the history
  • Loading branch information
oodamien committed May 30, 2024
1 parent 7d151cf commit 27476ed
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 36 deletions.
12 changes: 12 additions & 0 deletions src/partials/version-nav.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<ul class="versions">
{{#each this}}
<li class="version
{{~#if (and (eq .. @root.page.component) (eq this @root.page.componentVersion))}} is-current{{/if~}}
{{~#if (eq this ../latest)}} is-latest{{/if}}">
<a href="{{{relativize ./url}}}">
{{./displayVersion}}
{{~#if (eq this ../latest)}}<span class="current">current</span>{{/if}}
</a>
</li>
{{/each}}
</ul>
40 changes: 4 additions & 36 deletions src/partials/version.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<a class="title" href="{{{relativize ./url}}}">{{{./title}}}</a>
</div>


{{~#if (notEmpty ./versions.stable)}}
<div class="version-item is-active">
<div>
Expand All @@ -23,18 +24,7 @@
Stable
</button>
</div>
<ul class="versions">
{{#each ./versions.stable}}
<li class="version
{{~#if (and (eq .. @root.page.component) (eq this @root.page.componentVersion))}} is-current{{/if~}}
{{~#if (eq this ../latest)}} is-latest{{/if}}">
<a href="{{{relativize ./url}}}">
{{./displayVersion}}
{{~#if (eq this ../latest)}}<span class="current">current</span>{{/if}}
</a>
</li>
{{/each}}
</ul>
{{> version-nav ./versions.stable}}
</div>
{{/if}}

Expand All @@ -46,18 +36,7 @@
Preview
</button>
</div>
<ul class="versions">
{{#each ./versions.preview}}
<li class="version
{{~#if (and (eq .. @root.page.component) (eq this @root.page.componentVersion))}} is-current{{/if~}}
{{~#if (eq this ../latest)}} is-latest{{/if}}">
<a href="{{{relativize ./url}}}">
{{./displayVersion}}
{{~#if (eq this ../latest)}}<span class="current">current</span>{{/if}}
</a>
</li>
{{/each}}
</ul>
{{> version-nav ./versions.preview}}
</div>
{{/if}}

Expand All @@ -69,18 +48,7 @@
Snapshot
</button>
</div>
<ul class="versions">
{{#each ./versions.snapshot}}
<li class="version
{{~#if (and (eq .. @root.page.component) (eq this @root.page.componentVersion))}} is-current{{/if~}}
{{~#if (eq this ../latest)}} is-latest{{/if}}">
<a href="{{{relativize ./url}}}">
{{./displayVersion}}
{{~#if (eq this ../latest)}}<span class="current">current</span>{{/if}}
</a>
</li>
{{/each}}
</ul>
{{> version-nav ./versions.snapshot}}
</div>
{{/if}}

Expand Down

0 comments on commit 27476ed

Please sign in to comment.