๐ชInheritance (Extending)
If multiple of your files have a repetitive structure, you can define a template that your other files can extend. Templates can even extend other templates.
In your template you can define several blocks which you can then fill in the extending file.
block vars
- lang := "en"
html(lang=lang)
head
link(rel="stylesheet", href="/foo.css")
title: block title
block head
body: block bodyextend "github.com/me/myproject/corgi/base.corgi"
block title Learn Corgi
block body
p
> Head over to
#a(href="https://mavolin.gitbook.io/corgi")[GitBook]
to learn corgi!
<!doctype html>
<html lang="en">
<head>
<link rel="stylesheet" href="/foo.css">
<title>Learn Corgi</title>
</head>
<body>
<p>
Head over to
<a href="https://mavolin.gitbook.io/corgi">GitBook</a>
to learn corgi!
</p>
</body>
</html>Last updated
Was this helpful?