Skip to content

Commit e2887f6

Browse files
committed
Improved search functionality and added tags to the search.
Change-Id: I08d8e6dab1268cfaccbd0aa9268d5c3209c263aa
1 parent 90e0f5c commit e2887f6

8 files changed

Lines changed: 74 additions & 10 deletions

File tree

_config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ collections:
5353
- cloud starter
5454
- launching
5555
- dashboard
56+
- create instances
57+
- creating instances
5658
difficulty: 1
5759
duration: 25
5860
status: draft

_includes/nav.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
<a class="nav-link" href="https://ardc.edu.au/contact-us/">Contact Us</a>
2121
</li>
2222
<li class="nav-item d-flex align-items-center">
23-
<a class="nav-icon icon-x ms-2" href="https://x.com/ARDC_AU"><i class="fab fa-x-twitter"></i></a>
2423
<a class="nav-icon icon-linkedin ms-2" href="https://www.linkedin.com/company/australian-research-data-commons/"><i class="fab fa-linkedin-in"></i></a>
2524
<a class="nav-icon icon-youtube ms-2" href="https://www.youtube.com/c/ARDC_AU"><i class="fab fa-youtube"></i></a>
2625
<a class="nav-icon icon-contact ms-2" href="https://ardc.edu.au/contact-us"><i class="fa fa-envelope"></i></a>

_layouts/tutorial.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ <h1 class="display-4">{{ collection.title }}</h1>
4545
<div class="p-2">
4646
<p class="mb-1"><i class="fa fa-info-circle"></i> This tutorial is part of the {{ collection.curriculum }} Series.</p>
4747
{% if collection.curriculum == "Cloud Starter" %}
48-
<a class="btn btn-link btn-sm p-0" href="{{ '/cloud-starter/02-tutorials' | prepend: site.baseurl }}"><i class="fa fa-arrow-left"></i> Back to Cloud Starter</a>
48+
<a class="btn btn-back btn-sm p-0" href="{{ '/cloud-starter/02-tutorials' | prepend: site.baseurl }}">Back to Cloud Starter</a>
4949
{% elsif collection.curriculum == "Cloud Two" %}
50-
<a class="btn btn-link btn-sm p-0" href="{{ '/cloud-two/02-tutorials' | prepend: site.baseurl }}"><i class="fa fa-arrow-left"></i> Back to Cloud Two</a>
50+
<a class="btn btn-back btn-sm p-0" href="{{ '/cloud-two/02-tutorials' | prepend: site.baseurl }}">Back to Cloud Two</a>
5151
{% elsif collection.curriculum == "Cloud Expert" %}
52-
<a class="btn btn-link btn-sm p-0" href="{{ '/cloud-expert/02-tutorials' | prepend: site.baseurl }}"><i class="fa fa-arrow-left"></i> Back to Cloud Expert</a>
52+
<a class="btn btn-back btn-sm p-0" href="{{ '/cloud-expert/02-tutorials' | prepend: site.baseurl }}">Back to Cloud Expert</a>
5353
{% endif %}
5454
</div>
5555
{% endif %}

_sass/_theme.scss

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,54 @@ ul.list-bullet {
178178
}
179179
}
180180

181+
.btn-back {
182+
color: $gray-900;
183+
font-weight: 600;
184+
text-decoration: none;
185+
position: relative;
186+
padding: 0;
187+
display: inline-block;
188+
&:after {
189+
content: "";
190+
position: absolute;
191+
bottom: -1px;
192+
left: 20px;
193+
height: 1px;
194+
width: 0;
195+
background-color: $ardc-purple;
196+
transition: all 0.3s ease-in-out 0s;
197+
}
198+
&:before {
199+
color: $ardc-blue;
200+
margin-right: 10px;
201+
vertical-align: initial;
202+
text-rendering: auto;
203+
font-family: 'Font Awesome 6 Free';
204+
content: "\f053";
205+
font-weight: 900;
206+
-webkit-font-smoothing: antialiased;
207+
transition: all 0.15s ease-in-out 0s;
208+
}
209+
&:hover {
210+
color: $gray-900;
211+
font-weight: 600;
212+
text-decoration: none;
213+
&:after {
214+
width: calc(100% - 20px);
215+
}
216+
&:before {
217+
color: $ardc-purple;
218+
margin-right: 12px;
219+
vertical-align: initial;
220+
text-rendering: auto;
221+
font-family: 'Font Awesome 6 Free';
222+
content: "\f053";
223+
font-weight: 900;
224+
-webkit-font-smoothing: antialiased;
225+
}
226+
}
227+
}
228+
181229
.btn-primary {
182230
color: $black;
183231
background-color: $yellow;

_sass/_variables.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ $grid-gutter-width: 1.5rem;
106106
$border-width: 1px;
107107
$border-color: $gray-300;
108108

109-
$border-radius: .25rem;
109+
$border-radius: 0;
110110
$border-radius-sm: .2rem;
111111
$border-radius-lg: .3rem;
112112
$border-radius-pill: 50rem;

assets/javascript/main.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,17 @@ $(function() {
1818

1919
$(function() {
2020
var tutorials = new Bloodhound({
21-
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('title', 'summary'),
21+
datumTokenizer: function(datum) {
22+
var tokens = [];
23+
if (datum.title) tokens = tokens.concat(Bloodhound.tokenizers.whitespace(datum.title));
24+
if (datum.summary) tokens = tokens.concat(Bloodhound.tokenizers.whitespace(datum.summary));
25+
if (datum.tags && Array.isArray(datum.tags)) {
26+
datum.tags.forEach(function(tag) {
27+
tokens = tokens.concat(Bloodhound.tokenizers.whitespace(tag));
28+
});
29+
}
30+
return tokens;
31+
},
2232
queryTokenizer: Bloodhound.tokenizers.whitespace,
2333
prefetch: baseurl + '/search.json?q=' + Date.now(), /* remove Date for production caching */
2434
});

assets/main.scss

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ section.banner {
3636
&.bg-image {
3737
background-image: url($baseurl + "/assets/images/tutorials-banner-bg.jpg");
3838
background-size: cover;
39-
}
39+
}
4040
}
4141

4242
.banner-hero-card {
@@ -55,6 +55,10 @@ section.banner {
5555
margin-bottom: -250px;
5656
}
5757

58+
#tutorial-page img {
59+
max-width: 100%;
60+
}
61+
5862
/*
5963
* Sidebar
6064
*/
@@ -204,8 +208,9 @@ code {
204208
color: #fff;
205209
background: $success;
206210
border-radius: 12px;
207-
&:after {
208-
font-family: 'Font Awesome 5 Free';
211+
&::before {
212+
font-family: "Font Awesome 6 Free";
213+
font-weight: 900;
209214
content: "\f00c";
210215
}
211216
}

search.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ layout: none
99
"summary": "{{ collection.summary }}",
1010
"category": "{{ collection.category }}",
1111
"level": "{{ collection.level }}",
12-
"tags": {{ collection.tags | jsonify }},
12+
"tags": [{% for tag in collection.tags %}"{{ tag }}"{% unless forloop.last %}, {% endunless %}{% endfor %}],
1313
"difficulty": {{ collection.difficulty }},
1414
"duration": "{{ collection.duration }} minutes",
1515
"status": "{{ collection.status }}",

0 commit comments

Comments
 (0)