Skip to content

Instantly share code, notes, and snippets.

@saml
Last active December 18, 2015 07:59
Show Gist options
  • Save saml/5750748 to your computer and use it in GitHub Desktop.
Save saml/5750748 to your computer and use it in GitHub Desktop.
base template with default stylesheet and scripts
@(title: String, stylesheets: Html = null, scripts: Html = null)(content: Html)
@defaultStylesheets = {
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet" />
}
@defaultScripts = {
}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>@title</title>
<link rel="shortcut icon" type="image/png" href="@routes.Assets.at("images/favicon.png")" />
@if(stylesheets == null) {
@defaultStylesheets
} else {
@stylesheets
}
</head>
<body>
<div id="content">
@content
</div>
@if(scripts == null) {
@defaultScripts
} else {
@scripts
}
</body>
</html>
@saml
Copy link
Author

saml commented Jun 10, 2013

@(title: String, stylesheets: Html = Html("""
    <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet" />
"""), scripts: Html = Html(""))(content: Html)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment