You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WIP change Try play page example from starter project to tutorials (#231)
@dwijnand, @ignasi35, The objective of this is to change the recommended example (Follow the Hello World Tutorial) on the https://www.playframework.com/getting-started page to point to the correct Hello World Tutorial examples. In addition, I made some edits to simplify and clarify the page.
The changes I made look good when I build the web pages except, they do not display the links to download the Hello World Tutorials from Tech Hub:

No links appear here.
Maybe it needs to be live to pull in the links from the example-code-service? If not, could you take a look at the Application controller, I might have made a mistake while switching out the starters examples for tutorials. For your reference, on Tech Hub, the play-templates.conf file defines them like this:
```hocon
tutorials = [
{
display-name = "Play Scala Hello World Tutorial"
name = "play-scala-hello-world-tutorial"
url = "git@github.com:playframework/play-scala-hello-world-tutorial.git"
github-repo = "playframework/play-scala-hello-world-tutorial"
branch = "2.6.x"
keywords = [ "play", "scala", "tutorial", "hello-world", "2.6.x" ]
"featured": {
"play": 0
},
summary = "Play Hello World tutorial in Scala"
description = "This tutorial introduces Play Framework, describes how Play web applications work, and walks you through steps to create page that displays a Hello World greeting."
},
{
display-name = "Play Java Hello World Tutorial"
name = "play-java-hello-world-tutorial"
url = "git@github.com:playframework/play-java-hello-world-tutorial.git"
github-repo = "playframework/play-java-hello-world-tutorial"
branch = "2.6.x"
keywords = [ "play", "java", "tutorial", "hello-world", "2.6.x" ]
summary = "Play Hello World tutorial in Java"
description = "This tutorial introduces Play Framework, describes how Play web applications work, and walks you through steps to create page that displays a Hello World greeting."
}
]
```
Copy file name to clipboardExpand all lines: app/views/gettingStarted.scala.html
+24-18Lines changed: 24 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -20,52 +20,57 @@ <h1>Getting Started with Play Framework</h1>
20
20
21
21
<divclass="try-section">
22
22
<h2>New to Play?</h2>
23
-
<p>Start with <ahref="@controllers.documentation.ReverseRouter.latest(None)">our documentation</a> or the <ahref="@controllers.documentation.ReverseRouter.latest(None, "HelloWorldTutorial")">Hello World Tutorial</a>.</p>
24
-
25
23
<divclass="try-option">
26
24
<h3><span>»</span> Learn whether Play Framework is right for your project</h3>
27
25
<divclass="try-option-content">
28
26
<ul>
29
-
<li><ahref="@controllers.documentation.ReverseRouter.latest(None, "Introduction")">Introduction to Play</a></li>
30
-
<li><ahref="@controllers.documentation.ReverseRouter.latest(None, "Requirements")">Requirements for using Play</a></li>
<li><ahref="@controllers.documentation.ReverseRouter.latest(None, "Requirements")" target="_blank">Requirements for using Play</a></li>
32
30
</ul>
33
31
</div>
34
32
</div>
35
-
36
33
<divclass="try-option">
37
-
<h3><span>»</span>Follow the Hello World Tutorial</h3>
34
+
<h3><span>»</span>Try the Hello World Tutorial</h3>
38
35
<divclass="try-option-content">
39
-
<p>Play requires Java 8 or higher. You can check your version with the <code>java -version</code> command or install it from <ahref="//www.oracle.com/technetwork/java/javase/downloads/index.html" rel="noopener">Oracle's site</a>. See details about <ahref="@controllers.documentation.ReverseRouter.latest(None, "Requirements")">Play's system requirement</a>.</p>
40
-
<p>First, download the starter project:</p>
36
+
<p>The Java and Scala Hello World projects are self-contained tutorials that include a distribution of the sbt build tool.</p>
37
+
<p>Play requires Java 8 or higher. Check your version with the <code>java -version</code> command and if needed, install it from <ahref="//www.oracle.com/technetwork/java/javase/downloads/index.html" rel="noopener">Oracle's site</a>.</p>
38
+
<p>To try the tutorial, first download the Java or Scala project:</p>
41
39
<table>
42
40
@examples.sections.map { case (version, section) =>
<p>Then, unzip the project in a convenient location and follow the directions in the <code>README.md</code> file to build and run the tutorial.</p>
52
+
<p>To run the tutorial:</p>
53
+
<ol>
54
+
<li>Unzip the project in a convenient location.</li>
55
+
<li>In a command window, change to the top-level project directory.</li>
56
+
<li>Enter <code>sbt run</code>.</li>
57
+
<li>After the message <code>Server started, ...</code> displays, enter the following URL in a browser: <http://localhost:9000>
58
+
<p>The tutorial welcome page displays.</p></li>
59
+
<ol>
55
60
</div>
56
61
</div>
57
62
</div>
58
63
59
64
<divclass="try-section">
60
65
<h2>Already know a bit about Play?</h2>
61
-
<p>Check out our <ahref="//developer.lightbend.com/start/?group=play">example projects for Java or Scala</a>. The downloadable zip files include everything you need, including <ahref="//www.scala-sbt.org/index.html">sbt</a>, Play Framework, and an HTTP server. Examples also support <ahref="//docs.gradle.org/current/userguide/play_plugin.html">Gradle</a>. You can also create a Play project from the command line using a template if you have sbt installed already.</p>
62
-
<p>Play requires Java 8 or higher. You can check your version with the <code>java -version</code> command or install it from <ahref="//www.oracle.com/technetwork/java/javase/downloads/index.html" rel="noopener">Oracle's site</a>. See details about the <ahref="@controllers.documentation.ReverseRouter.latest(None, "Requirements")">requirements to work with Play</a>.</p>
63
-
66
+
<p>Lightbend Tech Hub offers a variety of Play example projects for Java and Scala that are focused on a particular use case. The downloadable zip files include everything you need, including <ahref="//www.scala-sbt.org/index.html">sbt</a>, Play Framework, and an HTTP server. The examples also support <ahref="//docs.gradle.org/current/userguide/play_plugin.html">Gradle</a>.</p>
67
+
<p>If you are ready to start your own project and have sbt installed, you can create a Play project from the command line.</p>
64
68
<divclass="try-option">
65
69
<h3><span>»</span> Try a focused example</h3>
66
70
<divclass="try-option-content">
67
71
<p>Follow these steps to try an example project:</p>
68
72
<ol>
73
+
<li>Check that your Java version is 8 or higher with the <code>java -version</code> command and if needed, install it from <ahref="//www.oracle.com/technetwork/java/javase/downloads/index.html" rel="noopener">Oracle's site</a>.
69
74
<li>Choose an example from <ahref="https://developer.lightbend.com/start/?group=play">Lightbend's Tech Hub</a>.</li>
70
75
<li>Click "CREATE A PROJECT FOR ME" to download the zipped project.</li>
71
76
<li>Unzip the project in a convenient location.</li>
@@ -87,7 +92,7 @@ <h3><span>»</span> Try a focused example</h3>
87
92
<divclass="try-option">
88
93
<h3><span>»</span> Create a Play Java or Scala project using <code>sbt new</code></h3>
89
94
<divclass="try-option-content">
90
-
<p>In a command window, enter one of the following lines to create a new project:</p>
95
+
<p>In a command window, enter one of the following and respond to the prompts to create a new project:</p>
91
96
92
97
<h4>Java seed template</h4>
93
98
<pre>sbt new playframework/play-java-seed.g8</pre>
@@ -97,7 +102,8 @@ <h4>Scala seed template</h4>
97
102
98
103
<p>After the template creates the project:</p>
99
104
<ol>
100
-
<li>Enter <code>sbt run</code> command to download dependencies and start the system.</li>
105
+
<li>Change into the top level project directory.</li>
106
+
<li>Enter <code>sbt run</code> to download dependencies and start the system.</li>
101
107
<li>In a browser, enter <ahref="http://localhost:9000">http://localhost:9000</a> to view the welcome page.</li>
0 commit comments