Skip to content

Commit 4a1586c

Browse files
authored
Merge pull request #14485 from dotty-staging/scaladoc/blog-fix2
Scaladoc: Change default blog directory to 'blog'
2 parents 019f0ee + 05b5ea8 commit 4a1586c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scaladoc/src/dotty/tools/scaladoc/site/StaticSiteLoader.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ class StaticSiteLoader(val root: File, val args: Scaladoc.Args)(using StaticSite
116116
def loadBlog(): Option[LoadedTemplate] = {
117117
type Date = (String, String, String)
118118
val rootPath = ctx.blogPath
119+
val defaultDirectory = "blog"
119120
if (!Files.exists(rootPath)) None
120121
else {
121122
val indexPageOpt = Seq(
@@ -131,7 +132,7 @@ class StaticSiteLoader(val root: File, val args: Scaladoc.Args)(using StaticSite
131132
val indexTemplateOpt = indexPageOpt.map(p => loadTemplateFile(p.toFile))
132133

133134
val indexPage = indexTemplateOpt.getOrElse(emptyTemplate(rootPath.resolve("index.html").toFile, "Blog"))
134-
val indexDest = ctx.docsPath.resolve("_blog").resolve("index.html")
135+
val indexDest = ctx.docsPath.resolve(defaultDirectory).resolve("index.html")
135136
val regex = raw"(\d*)-(\d*)-(\d*)-(.*)".r
136137
def splitDateName(tf: TemplateFile): (Date, String) = tf.file.getName match
137138
case regex(year, month, day, name) => ((year, month, day), name)
@@ -150,7 +151,7 @@ class StaticSiteLoader(val root: File, val args: Scaladoc.Args)(using StaticSite
150151
.map { postFile =>
151152
val templateFile = loadTemplateFile(postFile)
152153
val ((year, month, day), name) = splitDateName(templateFile)
153-
val destPath = ctx.docsPath.resolve("_blog").resolve(year).resolve(month).resolve(day).resolve(name)
154+
val destPath = ctx.docsPath.resolve(defaultDirectory).resolve(year).resolve(month).resolve(day).resolve(name)
154155
val date = dateFrom(templateFile, s"$year-$month-$day")
155156
date -> LoadedTemplate(templateFile, List.empty, destPath.toFile)
156157
}.sortBy(_._1).reverse.map(_._2)

0 commit comments

Comments
 (0)