#55 use display_version instead of version for component
Merged 2 years ago by bcotton. Opened 2 years ago by darknao.
fedora-docs/ darknao/fedora-docs-ui main  into  master

@@ -2,7 +2,7 @@ 

    {{#if page.component}}

    <div class="context">

      <span class="title">{{page.component.title}}</span>

-     <span class="version">{{page.version}}</span>

+     <span class="version">{{page.componentVersion.displayVersion}}</span>

    </div>

    {{/if}}

    <ul class="components">
@@ -14,7 +14,7 @@ 

          <li class="version

            {{~#if (and (eq ../this @root.page.component) (eq this @root.page.componentVersion))}} is-current{{/if~}}

            {{~#if (eq this ../latestVersion)}} is-latest{{/if}}">

-           <a href="{{{relativize @root.page.url ./url}}}">{{./version}}</a>

+           <a href="{{{relativize @root.page.url ./url}}}">{{./displayVersion}}</a>

          </li>

          {{/each}}

        </ul>

@@ -1,11 +1,11 @@ 

  {{#if page.versions}}

  <div class="page-versions">

-   <button class="versions-menu-toggle" title="Show other versions of page">{{page.version}}</button>

+   <button class="versions-menu-toggle" title="Show other versions of page">{{page.componentVersion.displayVersion}}</button>

    <div class="versions-menu">

      {{#each page.versions}}

      <a class="version

        {{~#if (eq ./version @root.page.version)}} is-current{{/if~}}

-       {{~#if ./missing}} is-missing{{/if}}" href="{{{relativize @root.page.url ./url}}}">{{./version}}</a>

+       {{~#if ./missing}} is-missing{{/if}}" href="{{{relativize @root.page.url ./url}}}">{{./displayVersion}}</a>

      {{/each}}

    </div>

  </div>

Use display_version where it's needed to handle unversioned component that come with antora 3.0.0.

See: https://pagure.io/fedora-docs/template/pull-request/20#comment-164408

Metadata Update from @bcotton:
- Request assigned

2 years ago

Are we using 3.0 in production now? If so, I'll merge this. If not, what's the effect on 2.x? It seems like this is backwards compatible, but I'd like confirmation.

We are not on 3.0 yet and the display_version key is indeed compatible with antora 2.x.

Pull-Request has been merged by bcotton

2 years ago