Skip to content

Commit d8955ce

Browse files
authored
Merge pull request #2465 from Varunram/branch1
Add timestamp to generated docs
2 parents d204179 + 8248a9d commit d8955ce

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

doc-tool/resources/_layouts/main.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!-- This page was last generated on {{ page.date | date: "%b-%d-%Y" }} -->
12
<!DOCTYPE html>
23
<html lang="en">
34
<head>

doc-tool/src/dotty/tools/dottydoc/staticsite/DefaultParams.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ package staticsite
55
import model.{ Entity, Package, NonEntity }
66

77
import java.util.{ HashMap, List => JList, Map => JMap }
8+
import java.time.LocalDateTime
9+
import java.time.format.DateTimeFormatter
810
import scala.collection.JavaConverters._
911

1012
case class DefaultParams(
@@ -58,7 +60,7 @@ case class DefaultParams(
5860
def withDate(d: String) = copy(page = PageInfo(page.url, d))
5961
}
6062

61-
case class PageInfo(url: String, date: String = "") {
63+
case class PageInfo(url: String, date: String = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")).toString ) {
6264
val path: Array[String] = url.split('/').reverse.drop(1)
6365
}
6466

0 commit comments

Comments
 (0)