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 setting HTML metadata #66

Merged
merged 13 commits into from
Jan 31, 2019
Merged

Support setting HTML metadata #66

merged 13 commits into from
Jan 31, 2019

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Jan 31, 2019

This PR adds the support to recognize HTML metadata from Markdown front-matter, powered by custom directives support in Marpit v0.7.0.

---
title: Slide deck
description: A beautiful slide deck created by Marp
url: https://marp.app/example
image: https://marp.app/ogp.jpg

theme: default
---

# Hello!

Marp CLI will recognize 4 new global directives.

  • title: Setting title for <title> tag and OGP title.
  • description: Setting description for <meta name="description"> and OGP description.
  • url: Setting canonical URL for <link rel="canonical"> and OGP URL.
  • image: Setting OGP image URL. Twitter's Summary Card will be used the large image by setting image and title.

You can also use HTML comment like Marpit global directive for setting meta values, but it would not common usage.

We also added CLI options for setting these values. It is useful within building HTML in CI and Netlify, to use canonical URL getting from environment variables.

marp --url $URL slide-deck.md
// marp.config.js
module.exports = {
  url: process.env.URL,
}

ToDo

  • Add tests
  • Update docs

@yhatt yhatt changed the title Support setting SEO meta values [WIP] Support setting SEO meta values Jan 31, 2019
@yhatt yhatt changed the title [WIP] Support setting SEO meta values Support setting SEO meta values Jan 31, 2019
@yhatt yhatt changed the title Support setting SEO meta values Support setting HTML metadata Jan 31, 2019
@yhatt yhatt merged commit 40d6fb6 into master Jan 31, 2019
@yhatt yhatt deleted the seo-meta branch January 31, 2019 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant