Skip to content

Commit

Permalink
Improve the nav-bar
Browse files Browse the repository at this point in the history
* Sort index pages first on the list.
* Add support for nav-title field for nav link title,
  falling back to the regular title if not present.

And add nav links to update sites section.
  • Loading branch information
ctrueden committed May 20, 2021
1 parent 11a803a commit 6d537d5
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 23 deletions.
13 changes: 9 additions & 4 deletions _includes/layout/nav-bar
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ A horizontal navigation bar with links.
{%- for p in site.pages -%}
{%- capture p-dir -%} {%- include util/dir path=p.url -%} {%- endcapture -%}
{%- if p-dir == page-dir -%}
{%- comment -%} Sort index page before the others. {%- endcomment -%}
{%- assign url = p.url | replace: "/index", "/_index" -%}
{%- assign title = p.nav-title | default: p.title | replace: " ", " " -%}
{%- capture link -%}
<li><a href="{{p.url}}">{{p.title | replace: " ", "&nbsp;"}}</a></li>
<li><a href="{{url}}">{{title}}</a></li>
{%- endcapture -%}
{%- unless links == "" -%}
{%- assign links = links | append: "|" -%}
Expand All @@ -39,7 +42,8 @@ A horizontal navigation bar with links.
<ul id="nav-bar" class="shadowed-box">
{%- capture page-ref -%} <a href="{{page.url}}"> {%- endcapture -%}
{%- for link in sorted-links -%}
{%- assign l = link -%} {%- comment -%} Loop vars are immutable! O_O {%- endcomment -%}
{%- comment -%} NB: Loop vars are immutable! O_O {%- endcomment -%}
{%- assign l = link | replace: "/_index", "/index" -%}
{%- if l contains page-ref -%}
{%- comment -%}
This link points at the current page; remove the <a> and </a> tags.
Expand All @@ -57,10 +61,11 @@ A horizontal navigation bar with links.
{%- endcomment -%}
<ul id="nav-bar" class="shadowed-box">
{% for p in pages %}
{%- assign title = p.title | replace: " ", "&nbsp;" -%}
{%- if p.url == page.url -%}
<li>{{p.title | replace: " ", "&nbsp;"}}</li>
<li>{{title}}</li>
{%- else -%}
<li><a href="{{p.url}}">{{p.title | replace: " ", "&nbsp;"}}</a></li>
<li><a href="{{p.url}}">{{title}}</a></li>
{%- endif -%}
{% endfor %}
</ul>
Expand Down
1 change: 1 addition & 0 deletions _pages/help/editing/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Editing the Wiki
section: Help:Editing the Wiki
nav-links: true
nav-title: Introduction
---

This page explains how to write and edit wiki pages. The simplest way to create
Expand Down
10 changes: 4 additions & 6 deletions _pages/update-sites/automatic-uploads.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
autogenerated: true
title: Automatic Update Site Uploads
section: Help:Update Sites
nav-links: true
nav-title: Automatic Uploads
---

{% include info-box content='This guide is intended for maintaining non-core update sites by automating builds with [Travis CI](https://travis-ci.org/).
\* The [core update sites](/update-sites/core-uploads) are updated manually or by [Travis CI](/develop/travis).

- Travis CI is useful because it can freely build any open source project with minimal effort.' %}



- The [core update sites](/update-sites/core-uploads) are updated manually or by [Travis CI](/develop/travis).
- Travis CI is useful because it can freely build any open source project with minimal effort.' %}

# Requirements

Expand Down
6 changes: 2 additions & 4 deletions _pages/update-sites/core-uploads.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
autogenerated: true
title: How to upload to core update sites
section: Help:Update Sites
nav-links: true
nav-title: Core Sites
---





## Introduction

This tutorial explains how to upload changes to core [ImageJ](/about) and [Fiji](/software/fiji) libraries.
Expand Down
7 changes: 3 additions & 4 deletions _pages/update-sites/faq.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
---
autogenerated: true
title: Update site FAQ
description: This pages answers frequently asked questions about update sites.
section: Help:Update Sites
nav-links: true
nav-title: FAQ
---





## How do I make my update site appear in ImageJ's *Manage update sites* dialog?

The dialog is based on the [list of update sites](/list-of-update-sites)
Expand Down
2 changes: 2 additions & 0 deletions _pages/update-sites/following.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
autogenerated: true
title: Following an update site
section: Help:Update Sites
nav-links: true
nav-title: How to Use
---

{% include notice icon="warning" content="Update sites are a fantastic way to
Expand Down
3 changes: 2 additions & 1 deletion _pages/update-sites/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
autogenerated: true
title: Update Sites
section: Help:Update Sites
nav-links: true
nav-title: Overview
---


An **update site** is web space used by the [Updater](/plugins/updater) which enables users to share their macros, scripts and plugins with other researchers. With update sites, you do not need to manually download and install anything; [ImageJ](/about) takes care of it for you.

## Following an update site
Expand Down
5 changes: 2 additions & 3 deletions _pages/update-sites/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
autogenerated: true
title: How to set up and populate an update site
section: Help:Update Sites
nav-links: true
nav-title: How to Create
---




## Introduction

This tutorial explains how to **set up a website to distribute your plugins**. It assumes that your plugins are correctly installed in your local ImageJ setup.
Expand Down
4 changes: 3 additions & 1 deletion _pages/update-sites/tos.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
autogenerated: true
title: Personal Update Site Terms of Service
description: This page describes the terms of service for personal update sites.
section: Help:Update Sites
nav-links: true
nav-title: TOS
---


By creating a personal update site, you agree to the following terms and conditions:

1. You agree to use your personal update site only for ImageJ extensions, and not hosting content for any other purpose.
Expand Down

0 comments on commit 6d537d5

Please sign in to comment.