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

Add force show drafts configuration option #693

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions docs/configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,17 @@ Valid values for `homepage`: `pages` (default), `posts`, `<collection_name>`,
jekyll_admin:
homepage: "posts"
```


#### `force_show_drafts`

On some cases you want to use multiple config files or `--drafts` command line switch that won't be properly
detected by jekyll-admin. This flag can force jekyll-admin to display the draft section in the sidebar
even if `show_draft: true` hasn't been detected in the config file.

It will only force display, not enable drafts. So be sure to have enabled drafts on jekyll.

```yaml
jekyll_admin:
force_show_drafts: true
```
5 changes: 4 additions & 1 deletion src/containers/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ export class Sidebar extends Component {

const collectionsPanel = this.renderCollections(hiddenLinks);
const postsPanel = !hiddenLinks.includes('posts');
const draftsPanel = config && config.show_drafts;
const draftsPanel =
config &&
(config.show_drafts ||
(config.jekyll_admin && config.jekyll_admin.force_show_drafts));

return (
<div className="sidebar">
Expand Down