Skip to content

Instantly share code, notes, and snippets.

@mikeobrien
Created March 28, 2012 21:06
Show Gist options
  • Save mikeobrien/2230534 to your computer and use it in GitHub Desktop.
Save mikeobrien/2230534 to your computer and use it in GitHub Desktop.
<html>
<title><use content="title" /></title>
<head>
<!--
These url's are all relative to the master layout but will
not be valid for views that exist in different folders.
I'm hoping to keep the url's relative but I'm not sure if
there is a way to accomplish that in a master layout.
So a view at the root would have this:
<link rel="shortcut icon" href="images/favicon.ico">
And a view at /yada/yada/ would have this:
<link rel="shortcut icon" href="../../images/favicon.ico">
Maybe there is some special operator like the tilde or something?
<link rel="shortcut icon" href="~/../images/favicon.ico">
-->
<link rel="shortcut icon" href="../images/favicon.ico">
<link href="../styles/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
<link rel="StyleSheet" href="../styles/application.css" type="text/css"/>
<script data-main="main" src="../scripts/require/require.js"></script>
<use content="head" />
</head>
<body class="application-body">
<use content="view"/>
</body>
</html>
@RobertTheGrey
Copy link

Yup tilde is special in Spark - it gets calculated as the site root, and from there you can nav downawards

So you would actually have something like : <link href="~/content/js/blah.js" />

@mikeobrien
Copy link
Author

mikeobrien commented Mar 28, 2012 via email

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