Skip to content

Commit a732083

Browse files
website 2025 (#844)
* update website branch for 2025 * refresh GitHub Actions stuff * modernize syntax * add day 0 2205 exception --------- Co-authored-by: Jamie Thompson <[email protected]>
1 parent 142773c commit a732083

File tree

12 files changed

+105
-21
lines changed

12 files changed

+105
-21
lines changed

.github/workflows/scripts/addDay.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
//> using scala "3.2.0"
2-
//> using lib "com.lihaoyi::sourcecode:0.3.0"
3-
//> using lib "com.lihaoyi::os-lib:0.8.1"
4-
//> using lib "org.jsoup:jsoup:1.15.3"
1+
//> using scala 3.7.4
2+
//> using dep com.lihaoyi::sourcecode:0.4.4
3+
//> using dep com.lihaoyi::os-lib:0.11.6
4+
//> using dep org.jsoup:jsoup:1.15.4
55

66
import java.time.LocalDate
77
import java.time.Month

.github/workflows/website.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ jobs:
66
publish:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
9+
- uses: actions/checkout@v5
1010
with:
1111
submodules: true
12-
- uses: coursier/cache-action@v6
13-
- uses: VirtusLab/scala-cli-setup@v0.1.18
12+
- uses: coursier/cache-action@v7
13+
- uses: VirtusLab/scala-cli-setup@v1.10.1
1414
with:
15-
jvm: "temurin:17"
15+
jvm: "temurin:21"
1616
apps: sbt
1717
- name: Publish ${{ github.ref }}
1818
run: sbt docs/docusaurusPublishGhpages

build.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import java.io.File
22

3-
ThisBuild / scalaVersion := "3.5.2"
3+
ThisBuild / scalaVersion := "3.7.4"
44

55
lazy val adventOfCode = project
66
.in(file("."))
77
.enablePlugins(ScalaJSPlugin)
88
.settings(
9-
Seq("2021", "2022", "2023", "2024")
9+
Seq("2021", "2022", "2023", "2024", "2025")
1010
.map(year => (Compile / sourceGenerators) += taskPatchSolutions(year).taskValue),
1111
Compile / managedSourceDirectories := Nil,
1212
run / fork := true,

docs/2025/puzzles/day0.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Day 0
2+
3+
[Advent of Code 2025](https://adventofcode.com/) has not started yet.
4+
See you soon!

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.9.7
1+
sbt.version=1.11.7

project/plugins.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.6.1")
2-
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.17.0")
1+
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.8.0")
2+
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.20.1")

solver/src/main/scala/adventofcode/Solver.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ import scala.util.{Try, Failure, Success}
66
import scala.scalajs.js.annotation.JSExportTopLevel
77

88
object Solver:
9+
private val solutions2025: Map[String, String => Any] =
10+
// import adventofcode2025.*
11+
Map(
12+
)
13+
914
private val solutions2024: Map[String, String => Any] =
1015
import adventofcode2024.*
1116
Map(
@@ -125,6 +130,7 @@ object Solver:
125130

126131
private val solutions: Map[String, Map[String, String => Any]] =
127132
Map(
133+
"2025" -> solutions2025,
128134
"2024" -> solutions2024,
129135
"2023" -> solutions2023,
130136
"2022" -> solutions2022,

website/docusaurus.config.js

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ const buildDropdown = (dir) => {
2727
n
2828
})
2929
});
30-
const sorted = days.sort((a, b) => a.n - b.n).filter((day) => day.n > 0);
30+
const sorted = days.sort((a, b) => a.n - b.n).filter((day) => day.n > 0
31+
|| dir.includes('2025') && day.n === 0 // TODO remove after Dec 1, 2025
32+
);
3133
return sorted
3234
};
3335

@@ -95,6 +97,12 @@ const config = {
9597
position: 'left',
9698
label: 'Setup',
9799
},
100+
{
101+
type: 'dropdown',
102+
position: 'left',
103+
label: 'Puzzles 2025',
104+
items: buildDropdown('2025/puzzles')
105+
},
98106
{
99107
type: 'dropdown',
100108
position: 'left',
@@ -139,6 +147,14 @@ const config = {
139147
label: 'Setup',
140148
to: '/setup',
141149
},
150+
{
151+
label: 'Puzzles 2025',
152+
to: '2025/puzzles/day01',
153+
},
154+
{
155+
label: 'Puzzles 2024',
156+
to: '2024/puzzles/day01',
157+
},
142158
{
143159
label: 'Puzzles 2023',
144160
to: '2023/puzzles/day01',
@@ -161,8 +177,12 @@ const config = {
161177
href: 'https://discord.com/channels/632150470000902164/913451015246868530'
162178
},
163179
{
164-
label: 'Twitter',
165-
href: 'https://twitter.com/scala_lang',
180+
label: 'Bluesky',
181+
href: 'https://bsky.app/profile/scala-lang.org',
182+
},
183+
{
184+
label: 'Mastodon',
185+
href: 'https://fosstodon.org/@scala_lang',
166186
},
167187
],
168188
},

website/sidebars.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ const buildSidebar = (dir) => {
2626
}
2727
const days = fs.readdirSync(`target/mdoc/${dir}`).map(extractDay);
2828
const sorted = days.sort((a, b) => a.n - b.n);
29-
return sorted.filter((day) => day.n > 0).map((day) => day.id);
29+
return sorted.filter((day) => day.n > 0
30+
|| dir.includes('2025') && day.n === 0 // remove after day 1 2025
31+
).map((day) => day.id);
3032
};
3133

3234
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
@@ -38,6 +40,9 @@ const sidebars = {
3840
adventOfCodeSidebar: [
3941
'introduction',
4042
'setup',
43+
{
44+
"2025 Puzzles": buildSidebar('2025/puzzles'),
45+
},
4146
{
4247
"2024 Puzzles": buildSidebar('2024/puzzles'),
4348
},

website/src/components/DocsLinks.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,16 @@ const DocsLinks = (props) => {
1616
const globalData = useGlobalData();
1717
const docs = globalData["docusaurus-plugin-content-docs"].default.versions[0].docs
1818
const days = docs.filter(doc => rx.test(doc.id))
19-
const sorted = days.sort((a, b) => dayN(rx, a) - dayN(rx, b)).filter(day => dayN(rx, day) > 0);
19+
const sorted = days.sort((a, b) => dayN(rx, a) - dayN(rx, b)).filter(day => dayN(rx, day) > 0
20+
|| dir.includes('2025') && dayN(rx, day) === 0 // TODO remove after Dec 1, 2025
21+
);
2022
return sorted
21-
.map((day, i) => {
23+
.map(day => {
2224
return (
2325
<Link
2426
className={linkStyle}
2527
to={`/${day.id}`}>
26-
Day {i + 1}
28+
Day {dayN(rx, day)}
2729
</Link>
2830
)
2931
});

0 commit comments

Comments
 (0)