0

I recently discovered markdown and the online editor stackedit. I saw that we could use YAML to configure the metadata of the file and I would like to use the title, author, and date markup into the header of my HTML document.

From here I've tried to use the {{ page.title }} line into a custom HTML template to first try to print it (gonna focus on the style after).

Here is the HTML output-template from the styled HTML with toc I'm using:

<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>{{ page.title }}</title>
  <link rel="stylesheet" href="https://stackedit.io/style.css" />
</head>

{{#if pdf}}
<body class="stackedit stackedit--pdf">
{{else}}
<body class="stackedit">
{{/if}}

  <div class="stackedit__left">
    <div class="stackedit__toc">
      {{#tocToHtml files.0.content.toc 3}}{{/tocToHtml}}
    </div>
  </div>
  <div class="stackedit__right">
    <div class="stackedit__html">
      {{page.title}}<br/>
      {{{files.0.content.html}}}
    </div>
  </div>
</body>

</html>

Is there a list of the defined variables in stackedit? I couldn't find it online. Some manual where I could find the meaning of each of those files.0.content.html-like variables.

Basically, I just want to print the title of the document as well as the author and date with a formatted style.

I am currently using a level one header to produce the title but it would also print it to the table of contents which is not what I want. Moreover, with this technic printing, the author and date is tricky.

How to use the YAML metadata which can be defined into the file properties?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.