Skip to content

Commit

Permalink
feat(images): Add images to session data
Browse files Browse the repository at this point in the history
  • Loading branch information
pham committed Oct 19, 2022
1 parent b0415a5 commit 9a994b3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions _data/sessions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ session-02:
header: 'Session 2'
sequence: 2
url: 'session-02'
images:
- desc: AskClass Logo
src: /assets/logo.svg

assignment-01:
segment: 'week-01'
Expand Down
6 changes: 6 additions & 0 deletions _includes/session/images.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% for i in include.images %}
<img width="100%" src="{{ i.src }}" alt="{{ i.desc }}" />
{% assign _size = include.images | size %}
{% if forloop.index != _size %}<hr />{% endif %}
{% endfor %}

2 changes: 2 additions & 0 deletions _layouts/session.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

<section class="center-align spacer content">
<article>
{% include session/images.html images=session_data.images %}

{% include session/points.html %}

{% include session/videos.html videos=session_data.videos %}
Expand Down
2 changes: 2 additions & 0 deletions content/_session/parts/theme_intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,11 @@ Key | Description
`header` | Header for the session usually part of a series (e.g. `Session 1`)
`sequence` | An optional sequence number (e.g. `3`)
`url` | Link to the content of this session
`images` | Array of `src` & `desc` for main image(s) to display
`videos` | Arrray of YouTube video IDs to render at the top of the session
`due` | A date that this assignment or quiz is due (e.g. `2022-10-10`)
`points` | Optional value of this assignment (e.g. `30`)
`part` | OPtional partition identifier for current lession (e.g. `1`)

<sub>Folder</sub>
### `content/_segment`
Expand Down

0 comments on commit 9a994b3

Please sign in to comment.