Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[2474] Document the base.html and page.html files
- Loading branch information
Showing
2 changed files
with
112 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,92 @@ | ||
{# Allows the DOCTYPE to be set on a page by page basis #} | ||
{% block doctype %}<!DOCTYPE html>{% endblock %} | ||
|
||
{# Allows custom attributes to be added to the <html> tag #} | ||
{% block htmltag %}<html lang="en-gb">{% endblock %} | ||
|
||
{# Allows custom attributes to be added to the <head> tag #} | ||
{% block headtag %}<head>{% endblock %} | ||
{# | ||
Add custom meta tags to the page. Call super() to get the default tags | ||
such as charset, viewport and generator. | ||
|
||
Example: | ||
|
||
{% block meta %} | ||
{{ super() }} | ||
<meta name="description" value="My website description" /> | ||
{% endblock %} | ||
|
||
#} | ||
{% block meta %} | ||
<meta charset="utf-8" /> | ||
{% endblock %} | ||
<title>{% if title %}{{title}} - {% endif %}CKAN</title> | ||
|
||
{# | ||
Add a custom title to the page by extending the title block. Call super() | ||
to get the default page title. | ||
|
||
Example: | ||
|
||
{% block title %}My Subtitle - {{ super() }}{% endblock %} | ||
|
||
#} | ||
<title>{% block title %}CKAN{% title %}</title> | ||
|
||
{# | ||
The links block allows you to add additonal content before the stylesheets | ||
such as rss feeds and favicons in the same way as the meta block. | ||
#} | ||
{% block links %} | ||
<link rel="shortcut icon" href="/base/images/ckan.ico" /> | ||
{% endblock %} | ||
|
||
{# | ||
The styles block allows you to add additonal stylesheets to the page in | ||
the same way as the meta block. Use super() to include the default | ||
stylesheets before or after your own. | ||
|
||
Example: | ||
|
||
{% block styles %} | ||
{{ super() }} | ||
<link rel="stylesheet" href="/base/css/custom.css" /> | ||
{% endblock %} | ||
#} | ||
{% block styles %} | ||
<link rel="stylesheet/less" href="/base/less/main.less" /> | ||
<script src="/base/test/vendor/less.js"></script> | ||
{% endblock %} | ||
</head> | ||
|
||
{# Allows custom attributes to be added to the <body> tag #} | ||
{% block bodytag %}<body>{% endblock %} | ||
|
||
{# | ||
The page block allows you to add content to the page. Most of the time it is | ||
recommended that you extend one of the page.html templates in order to get | ||
the site header and footer. If you need a clean page then this is the | ||
block to use. | ||
|
||
Example: | ||
|
||
{% block page %} | ||
<div>Some other page content</div> | ||
{% endblock %} | ||
#} | ||
{% block page %}{% endblock %} | ||
|
||
{# | ||
The scripts block allows you to add additonal scripts to the page. Use the | ||
super() function to load the default scripts before/after your own. | ||
|
||
Example: | ||
|
||
{% block script %} | ||
{{ super() }} | ||
<script src="/base/js/custom.js"></script> | ||
{% endblock %} | ||
#} | ||
{% block scripts %}{% endblock %} | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters