<%
local function fixUrlIfRelative( url )
url = tostring( url ) or ""
if string.find( url, "[a-z]+:" ) then
-- this url starts with something like http: or mailto:, so leave it alone
else
-- this url is probably relative, so we need to tack on theRoot to the beginning
-- of it, so no matter where the page we're currently viewing is placed in the
-- output hierarchy, this link will still point to the same page
url = theRoot .. "/" .. url;
end
return url
end
--[[ Include the identity plate during preview to enable quick live update ]]
local includeIdentityPlate = mode == 'preview' or model.appearance.logo.display
if includeIdentityPlate then
local url = fixUrlIfRelative( model.metadata.homePage.value )
%>
<%
end --[[ End conditionalize identity plate ]]
%>
<% --[[ Page header titles ]] %>
$model.metadata.siteTitle.value