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

meta.title and meta.description only renders first character #553

Closed
martinbira opened this issue Nov 1, 2017 · 5 comments
Closed

meta.title and meta.description only renders first character #553

martinbira opened this issue Nov 1, 2017 · 5 comments
Assignees

Comments

@martinbira
Copy link
Contributor

@martinbira martinbira commented Nov 1, 2017

Description

The content in <title></title> and <description></description> derived from the page meta title and description only consist of the first character for the page meta value.

Expected behavior

<title></title> should consist of full content from the page meta title
<description></description> should consist of full content from the page meta description

Actual behavior

<title></title> consist of only the first character from the page meta title
<description></description> consist of only the first character from the page meta description

Steps to reproduce the bug

  1. In page.md set the following meta data:
---
title: Page title
description: Page description
---
  1. Verify that mkdocs builds page.
  2. Check page source for <title>P</title> and <description>P</description>

Package versions

  • Python: 3.6.1
  • MkDocs: 0.17.1
  • Material: 2.01

System information

  • OS: Windows 10
@martinbira martinbira changed the title meta.title only renders first letter in title-tag meta.title and meta.description only renders first character Nov 1, 2017
@coliff
Copy link
Contributor

@coliff coliff commented Nov 1, 2017

I could reproduce this issue but it's easily fixed by using the following:

---
page.title: Page title
page.description: Page description
---

I got those variable names from the MkDocs 0.17.0 Release Notes:
http://www.mkdocs.org/about/release-notes/#version-0170-2017-10-19

@coliff
Copy link
Contributor

@coliff coliff commented Nov 1, 2017

An update from me. I realised that using the above does correctly populates the title and description - but it also adds the title and description within the HTML of the page. Looks like a bug.

Using the following works though:

---
page_title: Page title
page_description: Page description
---
@squidfunk
Copy link
Owner

@squidfunk squidfunk commented Nov 1, 2017

Fixed in #554, release will follow today.

@StephenTaylor-Kx
Copy link

@StephenTaylor-Kx StephenTaylor-Kx commented Nov 3, 2019

The same is true for author metadata. For example,

---
author: John Doe
---

yields in the HTML head

<meta name="author" content="J">

and the same workaround succeeds:

---
page.author: John Doe
---

yields

<meta name="author" content="John Doe">
@squidfunk
Copy link
Owner

@squidfunk squidfunk commented Nov 3, 2019

Same fix as in #554 - I can't remember why I put the first modifier on it, maybe the format was different some time ago. Feel free to open a new issue for this so it doesn’t get forgotten.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants