In this ".hamlet" code I would like to know what is the meaning of ^{copyright}
line
$doctype 5
<html>
<head>
<title>#{pageTitle} - My Site
<link rel=stylesheet href=@{Stylesheet}>
<body>
<h1 .page-title>#{pageTitle}
<p>Here is a list of your friends:
$if null friends
<p>Sorry, I lied, you don't have any friends.
$else
<ul>
$forall Friend name age <- friends
<li>#{name} (#{age} years old)
<footer>^{copyright}
That example you have been linked might be slightly confusing because you don't see the
copyright
function anywhere.copyright
is just another function. You can use the^{..}
function to embed another widget within one. This example might help you:And on executing it:
I would recommend you to go through the widgets chapter to get a better understanding of this.