Fixed README documentation.

This commit is contained in:
Nicolás Ortega Froysa 2020-10-25 10:24:44 +01:00
parent fc82364449
commit 5e99d49dee

19
README
View File

@ -31,8 +31,8 @@ generated site directories, looking for includes of templates and
parsing variables. parsing variables.
## Templates ## Templates
To include a template into an HTML file, you would simply add To include a template into an HTML file, you would simply add the line
`#{<file>}` to the HTML document, where `<file>` is the name of the `#/<file>` to the HTML document where `<file>` is the name of the
template file relative to the `_templates/` directory. For example, template file relative to the `_templates/` directory. For example,
supposing the following file structure: supposing the following file structure:
@ -41,7 +41,7 @@ supposing the following file structure:
/_templates/header.html /_templates/header.html
In order to include `header.html` into the `index.html` document, one In order to include `header.html` into the `index.html` document, one
would write `#{header.html}` within `index.html`, and likewise could be would write `#/header.html` within `index.html`, and likewise could be
done with `footer.html`. done with `footer.html`.
## Variables ## Variables
@ -52,15 +52,14 @@ be defined in each individual page, and referenced in the templates. All
variables are strings. variables are strings.
To define a variable in an HTML file, a section must be declared at the To define a variable in an HTML file, a section must be declared at the
beginning of the file which starts and ends with `%%%`. Within this beginning of the file which ends with `%%%`. Within this section,
section, variables are declared and defined by the syntax variables are declared and defined by the syntax `<name>=<string>`. Note
`<name>=<string>`. Note that there is no need to use quotes, as that there is no need to use quotes, as everything after the `=` is
everything after the `=` is considered part of the string until the end considered part of the string until the end of the line. These variables
of the line. These variables can then be used in the template files can then be used in the template files which are imported with the
which are imported with the syntax `${<name>}`. For example: syntax `${<name>}`. For example:
index.html: index.html:
%%%
my-title=Home Page my-title=Home Page
%%% %%%
#{header.html} #{header.html}