Write content directly from HTML files
2022-09-18
Use HTML syntax directly
Write content directly in HTML syntax.
This file is written directly in html, click on the source code at the top right edit this page
view
Also supports Jinja2 syntax
{% extends "article.html" %}
Note that "article.html" needs to be enclosed in quotation marks, otherwise it will prompt that the article cannot be found
{% block title %}
Write content directly from HTML files
{% endblock %}
{% block content %}
Use HTML syntax directly
{% endblock %}
Here you can see that this page inherits from article.html
and modifies title
and content
so that the navigation bar and side can be preserved bar, and use themes too.
For the specific content that can be modified, you can view the source code of the template, the templates that can be used, and refer to the template files provided by the theme, such as the template files of the default theme at here
And the variables that the page can use refer to the variable description in Custom Page Template.
html files are used as template files
In addition to writing pages directly in html, you can also write a template in html first, put it in thelayout
directory, and use this template in the .md
file.
The content in the .md
file will be passed to html
in the body
variable, directly through {{ body| safe }}
use,
Here safe
means no escaping, so that html can be written directly in the .md
file.
See Custom Page Templates for more custom template content.