Skip to content

Commit

Permalink
make search aware of instructor/learner
Browse files Browse the repository at this point in the history
Fixes #135
  • Loading branch information
ErinBecker authored May 17, 2024
1 parent 9d98f8c commit b4d56a9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions inst/pkgdown/templates/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,10 @@
</form>
-->
{{^overview}}
{{^instructor}}
<a class="btn btn-primary" href="{{#site}}{{root}}{{/site}}aio.html" role="button" aria-label="{{ translate.SearchButton }}">{{ translate.SearchButton }}</a>
{{/instructor}}
<a class="btn btn-primary" href="{{#site}}{{root}}{{/site}}instructor/aio.html" role="button" aria-label="{{ translate.SearchButton }}">{{ translate.SearchButton }}</a>
{{/overview}}
</div><!--/div.container-fluid -->
</nav>
Expand Down

3 comments on commit b4d56a9

@froggleston
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @ErinBecker - thanks for moving this forward! I think the syntax needs a bit more refining however. The overview open and closing tags are fine, but the instructor check needs to match the way conditionals work, i.e.

{{^overview}}

  ## if we're not in an overview
  {{#instructor}}
    ## if instructor is set link to the instructor AIO
  {{/instructor}}
  {{^instructor}}
    ## if instructor is NOT set link to the learner AIO
  {{/instructor}}

{{/overview}}

@ErinBecker
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, yes, I wasn't done testing this and forgot to mark it as in progress. I'll be working on finishing this up today.

@froggleston
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah perfect! Sorry for jumping in too early! :)

Please sign in to comment.