bootstrap
https://getbootstrap.com
Download the compiled css and js.

Make sure you have the two files below.
bootstrap-4/css/bootstrap.min.cssbootstrap-4/js/bootstrap.min.jsjQuery https://jquery.com
I downloaded jquery-3.3.1.min.js.
popper https://popper.js.org
Download popper.js.
Play Framework project
In project_name / public / javascripts /
bootstrap-4/js/bootstrap.min.jsjquery-3.3.1.min.jspopper.jsInstall three of.

Play Framework project
In project_name / public / stylesheets /
bootstrap-4 / css / bootstrap.min.css.

main.scala.html
Add the code below to <head> of main.scala.html.
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" media="screen" href="@routes.Assets.versioned("stylesheets/bootstrap.min.css")">
Add the code below to <body> of main.scala.html.
(In the order of jQuery, Popper, Bootstrap!)
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script type="text/javascript" src="@routes.Assets.versioned("javascripts/jquery-3.3.1.min.js")"></script>
<script type="text/javascript" src="@routes.Assets.versioned("javascripts/popper.min.js")"></script>
<script type="text/javascript" src="@routes.Assets.versioned("javascripts/bootstrap.min.js")"></script>
@(title: String)(content: Html)
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" media="screen" href="@routes.Assets.versioned("stylesheets/bootstrap.min.css")">
<title>@title</title>
<link rel="stylesheet" media="screen" href="@routes.Assets.versioned("stylesheets/main.css")">
<link rel="shortcut icon" type="image/png" href="@routes.Assets.versioned("images/favicon.png ")">
<script src="@routes.Assets.versioned("javascripts/hello.js")" type="text/javascript"></script>
</head>
<body>
@content
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script type="text/javascript" src="@routes.Assets.versioned("javascripts/jquery-3.3.1.min.js")"></script>
<script type="text/javascript" src="@routes.Assets.versioned("javascripts/popper.min.js")"></script>
<script type="text/javascript" src="@routes.Assets.versioned("javascripts/bootstrap.min.js")"></script>
</body>
</html>
https://hackerthemes.com/bootstrap-cheatsheet/
Paste your favorite parts into main.scala.html.
I was able to confirm that it was enabled. Thank you for your hard work.
Recommended Posts