Publish a Typesafe Activator Template
Template Developer Documentation
Create a New Template
Activator templates are just sbt projects with some metadata, a license, and a tutorial. When creating your own template either create an sbt project from scratch or start with an existing project. You can then open that project in the Activator UI to make sure it works as expected and to test the tutorial. Once you are ready to publish your template put it on GitHub and then use the form above to submit it to the template directory.
Update a Template
Once your changes have been pushed to your git repo, use the form above to publish a new version.
You may also configure a GitHub repository to auto-republish when you push. To add a Webhook to a GitHub repository go to the settings for the repository, select Webhooks & Services, then select Add webhook, and enter the following URL:
The Payload version should be
application/vnd.github.v3+form and the event is
Just the push event. Save the new webhook and now every time you push to
master in your repo the new template version will be automatically published.
There are four main parts to a template:
- sbt Build
These four pieces are combined into a project that can be used in Activator and as a regular sbt project. With Activator, when a user creates a new app from a template, the tutorial and the metadata are not included in the new project.
Activator templates must provide an
activator.properties file which contains the template metadata. The required properties are:
name- A globally unique, URL friendly name for the template
title- A human readable name for the template
description- A plain text description for the template
tags- A comma-seperated list of tags for the template
These values will be verified when you publish your template.
name=play-with-angular title=Play Framework with AngularJS description=A starter application with Play Framework and AngularJS. tags=playframework,angularjs,java,scala
Activator templates must have a license which permits others to build an app based on the template. This template must be in a file that has a name beginning with
LICENSE and can be in plain text or Markdown. Markdown licenses should be named
LICENSE.md. Generally boilerplate & skeleton templates should use a very liberal license like CC0 while sample applications can use something slightly more restrictive like Apache 2. Inclusion of copyright headers is up to the author.
The project must set a required sbt version in the
project/build.properties file, like:
Projects can use the legacy Maven layout (which is the default for plain sbt projects) or Play Framework's layout.
The tutorial for a template is in a
Each section of the tutorial must be in a
<div> tag that is inside the
<body> tag. Each section must have a single
<h2> tag that contains the section's title.
The tutorial can provide shortcut links to places in Activator by using an anchor link (
#) and the
shortcut class, like:
<a href="#code/tutorial/index.html" class="shortcut">/tutorial/index.html</a>
Code blocks can use
<pre><code></code></pre> tags, like:
<pre><code>println("hello, Scala!") val foo = "Bar"</code></pre>
In-line code can use just the
<code></code> tag, like:
The <code>val foo = "Bar"</code> statement sets <code>foo</code> to <code>Bar</code>
Images can be embedded by putting them in the
tutorial directory and using a relative URL to the image, like: