geolexica / jekyll-geolexica

Geolexica using Jekyll
2 stars 0 forks source link

adding semantic search link on all pages #8

Closed HassanAkbar closed 1 year ago

HassanAkbar commented 1 year ago

Adding semantic search links on all pages

ronaldtse commented 1 year ago

@HassanAkbar however we don’t have semantic search in all deployed geolexica sites, it is only deployed in the TC 211 one. Can we tailor it only for TC 211?

Or better yet, allow the gem to discover if it exists before creating the links?

In fact, it is best to integrate the semantic search build functionality within the Geolexica deployment itself just with Ruby, not requiring a Makefile.

HassanAkbar commented 1 year ago

@ronaldtse Currently, this is the code that we are using to add nav_items on a page written here. As you can see that we are only showing those links which are in the config file (i.e in the site.nav.items) so this will not show semantic-search link for other geolexica sites that do not have semantic-search present in the config file.

{%- assign nav_items = page.nav_items | default: layout.nav_items %}
{%- if nav_items %}
  <nav class="priority-nav">
    <ul>
      {%- for item in site.nav.items %}
        {%- if nav_items contains item.id %}
          <li>
            <a href="{{ item.url }}">{{ item.title }}</a>
          </li>
        {%- endif %}
      {%- endfor %}
    </ul>
  </nav>
{%- endif %}
ronaldtse commented 1 year ago

Excellent, thanks! Please merge when ready.