Skip to content

Commit 9859769

Browse files
committed
include homeworks in sidebar
1 parent 5ee65f5 commit 9859769

File tree

13 files changed

+749
-632
lines changed

13 files changed

+749
-632
lines changed

src/_includes/layout.jlhtml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,21 @@ $(pluto_head)
9898
desc = get(output.frontmatter, "description", nothing)
9999
active = page.url == other_page.url
100100

101-
@htl("""<li class=$([
102-
active ? "active" : nothing,
103-
])><a href=$(root_url * "/" * other_page.url) title=$(desc)>$(number) $(name)</a></li>""")
101+
homework_number = get(output.frontmatter, "homework_number", nothing)
102+
103+
href = root_url * "/" * other_page.url
104+
105+
if homework_number === nothing
106+
@htl("""<li class=$([
107+
active ? "active" : nothing,
108+
"lecture",
109+
])><a href=$(href) title=$(desc)><span class="entry-number">$(number)</span> $(name)</a></li>""")
110+
else
111+
@htl("""<li class=$([
112+
active ? "active" : nothing,
113+
"homework",
114+
])><a href=$(href) title=$(desc)><span class="entry-number">Homework $(homework_number):</span> $(name)</a></li>""")
115+
end
104116
end for other_page in pages
105117
])
106118
</ul>
@@ -129,7 +141,7 @@ $(pluto_head)
129141
</div>
130142
</nav>
131143
<div id="pages-content">
132-
$(any(contains("module"), f("tags", String[])) ? @htl("""
144+
$(any(contains("lecture"), f("tags", String[])) ? @htl("""
133145
<div class="lecture-header" >
134146
<p class="number">Section $(f("chapter", "-")).$(f("section", "-"))</p>
135147
<h1>$(

src/assets/styles/layout.css

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,42 @@
175175
align-items: stretch;
176176
}
177177

178+
179+
#pages-sidebar li li.homework {
180+
padding-left: 1ch;
181+
/* background: yellow; */
182+
}
183+
184+
#pages-sidebar li li a {
185+
margin: .2em 0;
186+
}
187+
188+
#pages-sidebar li li.homework a {
189+
/* background: #ffb60012; */
190+
margin: 0.4em 0px;
191+
outline: 3px dashed #92929278;
192+
outline-offset: -1px;
193+
}
194+
195+
/* #pages-sidebar li li.homework a::before {
196+
content: "👉 ";
197+
} */
198+
199+
#pages-sidebar li li span.entry-number {
200+
opacity: .6;
201+
}
202+
#pages-sidebar li li.homework span.entry-number {
203+
display: block;
204+
}
205+
178206
#pages-sidebar li li.active a {
179207
background-color: var(--sidebar-li-active-bg);
180208
}
181209
#pages-sidebar li li:hover a {
182210
background-color: var(--sidebar-li-hover-bg);
183211
}
184212

213+
185214
/* SIDEBAR LOGO */
186215

187216
#pages-sidebar .home_link img {

src/homework.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/week1/hw1.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
### A Pluto.jl notebook ###
22
# v0.19.14
33

4+
#> [frontmatter]
5+
#> chapter = 1
6+
#> section = 2.5
7+
#> order = 2.5
8+
#> homework_number = 1
9+
#> title = "Images and Arrays"
10+
#> layout = "layout.jlhtml"
11+
#> description = "Practice Julia basics by working with arrays of colors. At the end of this homework, you can see all of your filters applied to your webcam image!"
12+
#> tags = ["homework", "module1"]
13+
414
using Markdown
515
using InteractiveUtils
616

src/week10/hw9.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
### A Pluto.jl notebook ###
22
# v0.19.14
33

4+
#> [frontmatter]
5+
#> chapter = 3
6+
#> section = 1.5
7+
#> order = 1.5
8+
#> homework_number = 9
9+
#> title = "Epidemic modeling III"
10+
#> layout = "layout.jlhtml"
11+
#> tags = ["homework", "module3"]
12+
#> description = "In this problem set, we will look at a simple spatial agent-based epidemic model: agents can interact only with other agents that are nearby."
13+
414
using Markdown
515
using InteractiveUtils
616

src/week13/hw10.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
### A Pluto.jl notebook ###
22
# v0.19.14
33

4+
#> [frontmatter]
5+
#> chapter = 3
6+
#> section = 7.5
7+
#> order = 7.5
8+
#> homework_number = 10
9+
#> title = "Climate modeling I"
10+
#> layout = "layout.jlhtml"
11+
#> tags = ["homework", "module3"]
12+
#> description = "Play around with an energy balance model of the climate system, to explore the effect of doubling CO₂, and to examine the 'snowball earth' phenomenon."
13+
414
using Markdown
515
using InteractiveUtils
616

0 commit comments

Comments
 (0)