File tree Expand file tree Collapse file tree 6 files changed +20
-17
lines changed Expand file tree Collapse file tree 6 files changed +20
-17
lines changed Original file line number Diff line number Diff line change 13
13
{{content}}
14
14
</ div >
15
15
16
- {% assign doProjects = 0 %}
17
- {% assign sorted = site.pages | sort_natural: 'title' %}
18
- {% for mypage in sorted %}
19
- {% if mypage.pagetype == 'project' %}
20
16
{% assign page_focus_area = page.name | basename %}
21
- {% if mypage.focus-area contains page_focus_area %}
22
- {% assign doProjects = 1 %}
23
- {% break %}
24
- {% endif %}
25
- {% endif %}
26
- {% endfor %}
17
+ {% assign sorted = site.pages | smart_page_sort: "focus-area", page_focus_area %}
27
18
28
- {% if doProjects ==1 %}
19
+ {% unless sorted.empty %}
29
20
< div class ="container-fluid projects ">
30
21
< h2 class ="alt-h2 text-center mb-3 mt-lg-6 " id ="projects "> {{ page.short_title | upcase }} Projects</ h2 > < br >
31
22
< center >
32
23
< div class ="row ">
33
24
{% for mypage in sorted %}
34
- {% if mypage.pagetype == 'project' %}
35
- {% assign page_focus_area = page.name | basename %}
36
- {% if mypage.focus-area contains page_focus_area %}
37
25
< div class ="card " style ="width: 17rem; ">
38
26
< a href =/projects/{{mypage.shortname}}.html >
39
27
< img class ="card-img-top " src ="/assets/{{mypage.image | default: "logos /Iris-hep-5-just-graphic.png"}}" alt="Card image cap ">
@@ -46,14 +34,12 @@ <h2 class="alt-h2 text-center mb-3 mt-lg-6" id="projects">{{ page.short_title |
46
34
</ div >
47
35
</ div >
48
36
</ div >
49
- {% endif %}
50
- {% endif %}
51
37
{% endfor %}
52
38
</ div >
53
39
</ center >
54
40
< br >
55
41
</ div >
56
- {% endif %}
42
+ {% endunless %}
57
43
58
44
59
45
{% assign sorted_presentations = site.data['sorted_presentations'] %}
Original file line number Diff line number Diff line change
1
+ # frozen_string_literal: true
2
+
3
+ module IrisHep
4
+ # Adding useful file filters
5
+ module SmartSort
6
+ def smart_page_sort ( input , field , match )
7
+ input . select { |p | p [ 'pagetype' ] == 'project' && p [ field ] . include? ( match ) }
8
+ . sort_by { |p | [ p [ 'position' ] || 0 , p [ 'title' ] . downcase ] }
9
+ end
10
+ end
11
+ end
12
+
13
+ Liquid ::Template . register_filter ( IrisHep ::SmartSort )
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ pagetype: project
7
7
image : logos/Iris-hep-5-just-graphic.png
8
8
blurb : Provide network monitoring for LHC and OSG sites
9
9
focus-area : osglhc
10
+ position : -1
10
11
team :
11
12
- smckee
12
13
- djw8605
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ shortname: osg-operations
6
6
pagetype : project
7
7
image : logos/Iris-hep-5-just-graphic.png
8
8
blurb : Operate OSG-LHC services
9
+ position : -1
9
10
focus-area :
10
11
- doma
11
12
- osglhc
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ shortname: osg-security
6
6
pagetype : project
7
7
image : logos/Iris-hep-5-just-graphic.png
8
8
blurb : OSG Cybersecurity team
9
+ position : -1
9
10
focus-area : osglhc
10
11
team :
11
12
- mtstanfield
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ shortname: osg-software
6
6
pagetype : project
7
7
image : logos/Iris-hep-5-just-graphic.png
8
8
blurb : Provide integrated software for running dHTC services
9
+ position : -1
9
10
focus-area : osglhc
10
11
team :
11
12
- brianhlin
You can’t perform that action at this time.
0 commit comments