mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-09 15:17:23 +02:00
feat: make blog posts unlisted only in production
This commit is contained in:
parent
ffbc7a37f8
commit
49cfdeb42b
11 changed files with 62 additions and 561 deletions
|
@ -19,30 +19,31 @@ headerLinks: [
|
|||
|
||||
## Adding Posts
|
||||
|
||||
To publish in the blog, create a file within the blog directory with a formatted name of `YYYY-MM-DD-My-Blog-Post-Title.md`. The post date is extracted from the file name.
|
||||
To publish in the blog, create a file within the blog directory with a formatted name of `YYYY-MM-DD-my-blog-post-title.md`. The post date is extracted from the file name.
|
||||
|
||||
For example, at `website/blog/2017-08-18-Introducing-Docusaurus.md`:
|
||||
For example, at `website/blog/2017-12-14-introducing-docusaurus.md`:
|
||||
|
||||
```yml
|
||||
---
|
||||
author: Frank Li
|
||||
authorURL: https://twitter.com/foobarbaz
|
||||
authorFBID: 503283835
|
||||
title: Introducing Docusaurus
|
||||
author: Joel Marcey
|
||||
authorURL: http://twitter.com/JoelMarcey
|
||||
authorFBID: 611217057
|
||||
authorTwitter: JoelMarcey
|
||||
---
|
||||
|
||||
Lorem Ipsum...
|
||||
```
|
||||
|
||||
## Header Options
|
||||
|
||||
The only required field is `title`; however, we provide options to add author information to your blog post as well.
|
||||
The only required field is `title`; however, we provide options to add author information to your blog post as well along with other options.
|
||||
|
||||
* `author` - The text label of the author byline.
|
||||
* `authorURL` - The URL associated with the author. This could be a Twitter, GitHub, Facebook account, etc.
|
||||
* `authorFBID` - The Facebook profile ID that is used to fetch the profile picture.
|
||||
* `authorImageURL` - The URL to the author's image. (Note: If you use both `authorFBID` and `authorImageURL`, `authorFBID` will take precedence. Don't include `authorFBID` if you want `authorImageURL` to appear.)
|
||||
* `title` - The blog post title.
|
||||
- `author` - The text label of the author byline.
|
||||
- `authorURL` - The URL associated with the author. This could be a Twitter, GitHub, Facebook account, etc.
|
||||
- `authorFBID` - The Facebook profile ID that is used to fetch the profile picture.
|
||||
- `authorImageURL` - The URL to the author's image. (Note: If you use both `authorFBID` and `authorImageURL`, `authorFBID` will take precedence. Don't include `authorFBID` if you want `authorImageURL` to appear.)
|
||||
- `title` - The blog post title.
|
||||
- `unlisted` - The post will be accessible by directly visiting the URL but will not show up in the sidebar in the final build; during local development, the post will still be listed. Useful in situations where you want to share a WIP post with others for feedback.
|
||||
|
||||
## Summary Truncation
|
||||
|
||||
|
@ -52,7 +53,6 @@ Use the `<!--truncate-->` marker in your blog post to represent what will be sho
|
|||
---
|
||||
title: Truncation Example
|
||||
---
|
||||
|
||||
All this will be part of the blog post summary.
|
||||
|
||||
Even this.
|
||||
|
@ -120,18 +120,19 @@ To do this:
|
|||
You can use this template:
|
||||
|
||||
```html
|
||||
<!DOCTYPE HTML>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="refresh" content="0; url=blog/">
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="refresh" content="0; url=blog/" />
|
||||
<script type="text/javascript">
|
||||
window.location.href = 'blog/';
|
||||
</script>
|
||||
<title>Title of Your Blog</title>
|
||||
</head>
|
||||
<body>
|
||||
If you are not redirected automatically, follow this <a href="blog/">link</a>.
|
||||
If you are not redirected automatically, follow this
|
||||
<a href="blog/">link</a>.
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue