Skip to content

Commit f6a49d1

Browse files
authored
Merge pull request #20 from ELIXIR-Belgium/sidebar-title-url
General improvements
2 parents 2bb2603 + b8899e6 commit f6a49d1

File tree

8 files changed

+48
-29
lines changed

8 files changed

+48
-29
lines changed

Gemfile.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
activesupport (6.0.4.4)
4+
activesupport (6.0.4.6)
55
concurrent-ruby (~> 1.0, >= 1.0.2)
66
i18n (>= 0.7, < 2)
77
minitest (~> 5.1)
@@ -27,7 +27,7 @@ GEM
2727
eventmachine (1.2.7)
2828
eventmachine (1.2.7-x64-mingw32)
2929
execjs (2.8.1)
30-
faraday (1.9.3)
30+
faraday (1.10.0)
3131
faraday-em_http (~> 1.0)
3232
faraday-em_synchrony (~> 1.0)
3333
faraday-excon (~> 1.1)
@@ -228,17 +228,17 @@ GEM
228228
rb-fsevent (~> 0.10, >= 0.10.3)
229229
rb-inotify (~> 0.9, >= 0.9.10)
230230
mercenary (0.3.6)
231-
mini_portile2 (2.7.1)
231+
mini_portile2 (2.8.0)
232232
minima (2.5.1)
233233
jekyll (>= 3.5, < 5.0)
234234
jekyll-feed (~> 0.9)
235235
jekyll-seo-tag (~> 2.1)
236236
minitest (5.15.0)
237237
multipart-post (2.1.1)
238-
nokogiri (1.13.1)
239-
mini_portile2 (~> 2.7.0)
238+
nokogiri (1.13.3)
239+
mini_portile2 (~> 2.8.0)
240240
racc (~> 1.4)
241-
nokogiri (1.13.1-x64-mingw32)
241+
nokogiri (1.13.3-x64-mingw32)
242242
racc (~> 1.4)
243243
octokit (4.22.0)
244244
faraday (>= 0.9)
@@ -247,7 +247,7 @@ GEM
247247
forwardable-extended (~> 2.6)
248248
public_suffix (4.0.6)
249249
racc (1.6.0)
250-
rb-fsevent (0.11.0)
250+
rb-fsevent (0.11.1)
251251
rb-inotify (0.10.1)
252252
ffi (~> 1.0)
253253
rexml (3.2.5)

_data/sidebars/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# title: About
2+
# version: 2.0
3+
# title_url: /events.html
14
subitems:
25
- title: About
36
subitems:

_includes/section-navigation-tiles.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,19 +98,19 @@
9898
{%- if affiliation.size == 2 %}
9999
{%- assign country_link = site.pages | where:"country_code",country | first %}
100100
{%- if country_link %}
101-
<a role="button" href="{{country_link.url}}" data-bs-toggle="tooltip" title="{{allcountries[country]}}" class="btn btn-sm bg-white hover-primary"><div class="flag-icon flag-icon-{{affiliation | downcase}} h-30px"></div></a>
101+
<a role="button" href="{{country_link.url}}" data-bs-toggle="tooltip" title="{{allcountries[country]}}" class="btn btn-sm bg-white hover-primary">
102102
{%- else %}
103-
<span class="d-inline-block" tabindex="0" data-bs-toggle="tooltip" title="{{allcountries[country]}}">
104-
<button class="btn btn-sm text-dark bg-white pe-none" title="{{allcountries[country]}}"><div class="flag-icon flag-icon-{{affiliation | downcase}} h-30px"></div></button>
105-
</span>
103+
<a role="button" data-bs-toggle="tooltip" title="{{allcountries[country]}}" class="btn btn-sm bg-white hover-primary disabled" aria-disabled="true">
106104
{%- endif %}
107-
{%- elsif affiliation == "ALL" %}
108-
<span class="d-inline-block" tabindex="0" data-bs-toggle="tooltip" title="All people">
109-
<button class="btn btn-sm text-dark bg-white pe-none" title="ALL"><div class="h-30px">ALL</div></button>
110-
</span>
105+
<div class="d-block h-24px">
106+
<span class="flag-icon flag-icon-{{affiliation | downcase}} align-items-center"></span>
107+
</div>
108+
</a>
111109
{%- elsif filter_affiliation %}
112110
{%- for result in filter_affiliation %}
113-
<a role="button" href="{{result.url}}" data-bs-toggle="tooltip" data-bs-original-title="{{affiliation}}" class="btn btn-sm bg-white hover-primary"><img alt="logo of {{result.name}}" src="{{result.image_url | relative_url }}" class="d-inline h-30px"></a>
111+
<a role="button" href="{{result.url}}" data-bs-toggle="tooltip" data-bs-original-title="{{affiliation}}" class="btn btn-sm bg-white hover-primary">
112+
<img alt="logo of {{result.name}}" src="{{result.image_url | relative_url }}" class="d-inline h-24px">
113+
</a>
114114
{%- endfor %}
115115
{%- endif %}
116116
{%- endfor %}

_includes/sidebar.html

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,19 @@
1010
{{ page.sidebar | capitalize | replace: "_", " " }} menu <i title="navbar-toggler" class="fa fa-bars ms-2"></i>
1111
</button>
1212
<nav class="collapse" id="side-nav" aria-label="Side navigation">
13-
<ul id="menu" class="menu list-unstyled mb-4 mb-lg-0">
13+
<ul id="menu" class="list-unstyled mb-4 mb-lg-0">
1414
{%- if sidebar.title or sidebar.version %}
15-
<li class="sidebar-title">{{sidebar.title}} {{sidebar.version}}</li>
15+
{%- if sidebar.title_url and page.url == sidebar.title_url %}
16+
<li class="sidebar-title active">
17+
{%- else %}
18+
<li class="sidebar-title">
19+
{%- endif %}
20+
{%- if sidebar.title_url %}
21+
<a class="btn active hover-primary text-start d-block mb-1" href="{{ sidebar.title_url | relative_url }}">{{sidebar.title}} {{sidebar.version}}</a>
22+
{%- else %}
23+
<a class="btn active hover-primary text-start d-block mb-1 disabled" aria-disabled="true">{{sidebar.title}} {{sidebar.version}}</a>
24+
{%- endif %}
25+
</li>
1626
{%- endif %}
1727
{%- for folder in sidebar.subitems %}
1828
{%- if page.url == folder.url %}

_layouts/page.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33
---
44
<main id="main" class="mb-5">
55
{%- if page.title %}
6+
{%- if page.type %}
67
{%- assign subtitle = page.type | replace: "_", " " | capitalize %}
7-
<h1>{% unless subtitle == nil or subtitle == blank or subtitle == "" %}<span class="d-block text-secondary fs-4 ff-body">{{subtitle}}</span><span class="visually-hidden">:</span> {% endunless %}{{ page.title }}
8+
<h1 class="has-subtitle"><span class="d-block text-secondary fs-4 ff-body">{{subtitle}}</span><span class="visually-hidden">:</span> {{ page.title }}
9+
{%- else %}
10+
<h1>{{ page.title }}
11+
{%- endif %}
812
<div class="btn-group">
913
{%- if page.custom-editme %}
1014
<a role="button" data-bs-toggle="tooltip" title="Propose changes to the content of this page on GitHub" href="{{site.github.repository_url}}/blob/master/{{page.custom-editme}}" class="btn hover-primary text-primary"><i class="fas fa-pencil-alt"></i></a>

assets/css/main.scss

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -266,12 +266,8 @@ header .navbar {
266266
background-color: $sidebar-bg-active;
267267
}
268268

269-
.sidebar-title {
270-
font-size: 1.3em;
271-
}
272-
273269
ul#menu {
274-
> li > a {
270+
> li:not(.sidebar-title) > a {
275271
background-color: $sidebar-bg;
276272
color: $sidebar-color;
277273
}
@@ -573,7 +569,7 @@ footer {
573569
height: 40px;
574570
}
575571

576-
.h-30px {
572+
.h-24px {
577573
height: 24px;
578574
}
579575

@@ -630,6 +626,14 @@ li.past_event,
630626
}
631627
}
632628

629+
/*-----Country flags-----*/
630+
631+
.flag-icon {
632+
border-radius: 3px;
633+
background-size: cover;
634+
}
635+
636+
633637
/*-----Section navigation tiles-----*/
634638

635639
.navigation-tiles {
@@ -655,9 +659,6 @@ li.past_event,
655659
color: $nav-card-badge-color-hover;
656660
background-color: $nav-card-badge-bg-hover;
657661
}
658-
.card-footer .flag-icon {
659-
display: block;
660-
}
661662
}
662663
}
663664

pages/example_pages/general_page.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ type: example_pages
44
contributors: [Bert Droesbeke]
55
description: This description is used when the page is listed
66
page_id: gp1
7-
affiliations: [ELIXIR Europe]
7+
affiliations: [ELIXIR Europe, BE, SE]
88
faircookbook:
99
- name: Link towards a FAIRCOOKBOOK recipe
1010
url: https://fairplus.github.io/

pages/example_pages/general_page_3.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: General page example 3
33
type: example_pages
44
description: This page has page level resources
5+
country_code: BE
56
page_id: gp3
67
resources:
78
- name: Resource name

0 commit comments

Comments
 (0)