Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added faq page. #502

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions assets/scss/_components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
@import "components/faq";
@import "components/faq-question";
@import "components/faq-topic";
@import "components/faq-overview";
@import "components/footer";
@import "components/hack_the_tunnels";
@import "components/header";
Expand Down
53 changes: 53 additions & 0 deletions assets/scss/components/_faq-overview.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
.faq {
&__page {
background: #faf9f8;
height: fit-content;
padding-bottom: 5rem;
}

&__content {
max-width: 65rem;
margin: 0 auto;
height: fit-content;
padding: 2.5rem;
}

&__header {
.page-section-image {
min-height: 20rem;
}

.page-section {
padding: 2rem 0rem;
margin-bottom: 3rem;
}
}

.page-section-grid-primary {
display: grid;
grid-template-columns: 1fr;
}
.page-section-grid-secondary {
display: block;
height: 200px;
background-size: cover;
background-position: center;
}

&__topic_name {
display: inline-block;
}

&__questions {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 2.5rem;
}
@media (max-width: 768px) {
&__questions {
grid-template-columns: 1fr;
gap: 2.5rem;
}
}
}

9 changes: 9 additions & 0 deletions content/resources/faq/faq-overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file should be named _index.md

title: "Frequently Asked Questions"
description: "Find answers to all your frequently asked questions in one place. Below is a list of topics you maybe have questions about!"
url: "/faq/"
layout: faq-overview
header_image_url: images/general/game_lab.jpg
Topics:
- course-registration
---
44 changes: 44 additions & 0 deletions layouts/_default/faq-overview.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{{ define "main" }}
{{- partial "navbar_temp.html" . -}}
<div class="faq__page">
<div class="faq__content">
<div class="faq__header">
<div class="page-section">
<div class="page-section-content page-section-grid-primary">
<div class="page-section-text">{{ .Title }}</div>
<div class="page-section-body">
{{ .Description }}
</div>
</div>
<div
class="page-section-image page-section-grid-secondary"
style="background-image: url({{ absURL .Params.header_image_url }})"
></div>
</div>
</div>
<div class="faq__topics">
{{ range .Params.Topics }}
{{ $page := printf "resources/faq/topics/%s" . }}
{{ with $.Site.GetPage $page }}
<div class="faq__topic">
<a href="{{ .RelPermalink }}">
<div class=faq__topic_name><h3>{{ .Title }} <i class="fas fa-arrow-right read-more-arrow"></i></h3></div>
</a>
<div class = "faq-topic__questions">
{{ range first 2 .Params.questions }}
{{ $questionPage := printf "resources/faq/questions/%s" . }}
{{ with $.Site.GetPage $questionPage }}
<div class="faq__question">
<div>{{- partial "curated-questions.html" (dict "Title" .Title "summary" .Params.summary) -}}</div>
<div>{{- partial "read-more.html" (dict "label" "Read More " "link" .RelPermalink) -}}</div>
</div>
Comment on lines +31 to +34
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We seem to be loosing some of the style on this code because the old code is wrapped within the.faq-topic block.

Could we instead create a common partial with it's styling setup in any page can access it?

image

{{ end }}
{{ end }}
</div>
</div>
{{ end }}
{{ end }}
</div>
</div>
</div>
{{ end }}
2 changes: 1 addition & 1 deletion layouts/_default/faq-topic.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
></div>
</div>
</div>
<div class="faq-topic__questions">
<div class="faq__questions">
{{ range .Params.questions }}
{{ $page := printf "resources/faq/questions/%s" . }}
{{ with $.Site.GetPage $page }}
Comment on lines -22 to 25
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could create a common partial called like "faq question group" to reuse across the 2 pages

Expand Down
4 changes: 4 additions & 0 deletions layouts/partials/curated-questions.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div>
<h4>{{ .Title }}</h4>
<p>{{ .summary }}</p>
</div>
Loading