Skip to content

Commit 6b5dbfb

Browse files
author
Alan Yeung
committed
The project cards page is up... Beware fat load times
1 parent e08f21c commit 6b5dbfb

File tree

3 files changed

+45
-4
lines changed

3 files changed

+45
-4
lines changed

_config_handbook.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ collections:
5252
handbookchapters:
5353
output: true
5454

55+
projects:
56+
output: true
57+
5558
defaults:
5659
- scope:
5760
path: "_themes"
@@ -124,3 +127,10 @@ defaults:
124127
values:
125128
layout: handbook_chapter
126129
permalink: /handbook/:categories/:title.html
130+
131+
- scope:
132+
path: "_projects"
133+
type: projects
134+
values:
135+
layout: project
136+

projects.html

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,20 @@
77
<section>
88
<div class="container">
99
<div class="row header-row">
10-
<div class="col-lg-12 text-center">
10+
<div class="col-lg-12 text-center">
1111
<h1>Projects</h1>
12-
<!--<p class="text-primary">Prizes that everyone across Australia and New Zealand can compete for!</p>-->
13-
</div>
12+
</div>
1413
</div>
1514
<div class="row">
1615
{% for project in site.projects %}
17-
<a href="{{ project.url }}">{{ project.project_title }}</a><br>
16+
{% assign image_url = project.image_url | default: 'https://assets.govhack.org/img/logo/govhack-original-transp.png' %}
17+
<a href="{{ project.url }}" class="project-card" style="background-image: url('{{ image_url }}')">
18+
<article class="project-card-caption">
19+
<strong>{{ project.project_title | truncatewords: 10 }}</strong><br>
20+
{{ project.team_name | truncatewords: 10 }}<br>
21+
{% assign location = site.locations | where: "gid", project.event | first %}{{ location.name }}, {{ location.jurisdiction }}
22+
</article>
23+
</a>
1824
{% endfor %}
1925
</div>
2026
</div>

resources/css/portal.css

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,3 +1158,28 @@ div.bg-primary.card,
11581158
div.bg-primary.card a {
11591159
color: #fff;
11601160
}
1161+
1162+
1163+
.project-card {
1164+
float: right;
1165+
position: relative;
1166+
margin: 10px;
1167+
width: 300px;
1168+
height: 300px;
1169+
background: none center center/cover no-repeat scroll transparent;
1170+
border: 1px solid ghostwhite;
1171+
}
1172+
a.project-card {
1173+
display: block;
1174+
text-decoration: none;
1175+
}
1176+
.project-card-caption {
1177+
position: absolute;
1178+
height: 40%;
1179+
bottom: 0;
1180+
left: 0;
1181+
right: 0;
1182+
background: rgba(0,0,0,.6);
1183+
color: white;
1184+
padding: 20px;
1185+
}

0 commit comments

Comments
 (0)