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

Custom title should also be used for the actual headline #14

Closed
juliusknorr opened this issue Feb 23, 2019 · 7 comments
Closed

Custom title should also be used for the actual headline #14

juliusknorr opened this issue Feb 23, 2019 · 7 comments

Comments

@juliusknorr
Copy link
Contributor

When specifying a custom title with the @vuepress annotation, it should also be used in the generated markdown file.

Using:

/**
 * @vuepress
 * ---
 * title: Your custom title
 * ---
 */

Actual output:

---
title: Your custom title
---
# action 

Expected output:

---
title: Your custom title
---
# Your custom title 
@ph1p
Copy link
Owner

ph1p commented Feb 23, 2019

Goo idea! I'll implement it tomorrow ;)

ph1p added a commit that referenced this issue Feb 24, 2019
Now the frontmatter title is used as the main title
Updated the example

#14
@ph1p
Copy link
Owner

ph1p commented Feb 24, 2019

Added in 1.5.0

@ph1p ph1p closed this as completed Feb 24, 2019
@juliusknorr
Copy link
Contributor Author

Awesome. Thanks a lot @ph1p for the quick implementation.

@ph1p
Copy link
Owner

ph1p commented Feb 25, 2019

Your welcome (:

@ChasLui
Copy link

ChasLui commented Mar 22, 2019

I want to control whether to use h1 or a custom title via the Options parameter.

@ph1p
Copy link
Owner

ph1p commented Mar 22, 2019

I want to control whether to use h1 or a custom title via the Options parameter.

I'll add it. Do you have a suggestion as to what I could call the parameter?

ph1p added a commit that referenced this issue Apr 2, 2019
@ph1p
Copy link
Owner

ph1p commented Apr 2, 2019

@ChasLui now you can use

/*
 * @vuepress
 * ---
 * title: Your custom title
 * headline: You custom headline
 * ---
 */

The headline is your custom h1 tag. title is used as fallback and the filename is used as title fallback. Hope this is what you wanted.

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

No branches or pull requests

3 participants