Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support title field in Markdown front matter #23

Open
2 of 3 tasks
Tracked by #21
oliver-pham opened this issue Oct 27, 2021 · 0 comments
Open
2 of 3 tasks
Tracked by #21

Support title field in Markdown front matter #23

oliver-pham opened this issue Oct 27, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@oliver-pham
Copy link
Owner

oliver-pham commented Oct 27, 2021

Requirements

  • The title of the document is set to the value of title in the front matter (resolved by e592459)
  • By default, title is set to either the heading level 1 on the top of the Markdown document
  • By default, title is set to the name of the Markdown file if a heading level 1 doesn't exist inside it (resolved by e592459)

Examples

If the content of example-lyrics.md is:

---
title: Never Gonna Give You Up
---

We're no strangers to love
You know the rules and so do I

or

# Never Gonna Give You Up

We're no strangers to love
You know the rules and so do I

The title should then be added as a <h1> element to the <body> of the generated HTML file:

<html>
  <head>
  ...
  <title>Never Gonna Give You Up</title>
  </head>
  <body>
    <h1>Never Gonna Give You Up</h1>
    <p>We're no strangers to love</p>
    <p>You know the rules and so do I</p>
  </body>
</html>

If the content of example-lyrics.md is:

We're no strangers to love
You know the rules and so do I

The generated HTML file should be:

<html>
  <head>
  ...
  <title>example-lyrics</title>
  </head>
  <body>
    <h1>example-lyrics</h1>
    <p>We're no strangers to love</p>
    <p>You know the rules and so do I</p>
  </body>
</html>
@oliver-pham oliver-pham added the enhancement New feature or request label Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant