liferay.design
liferay.design copied to clipboard
Prevent Drafts or Inactive Teammate Pages from Being Built
Describe the bug Currently, the "draft" mode just hides the cards from the various pages — would be great if there was a true "draft" mode where the page is built in the dev environment, but not production.
I don't really know if that is possible with the technology we are using.
anything is possible @victorvalle :)
I started looking into this briefly, for anyone interested in picking up, here's where I think would be a good place to start:
in gatsby-node.js
the createPages function at line 19:
exports.createPages = ({ actions, graphql }) => {
const { createPage } = actions
return new Promise((resolve, reject) => {
resolve(
graphql(`
query {
allMdx {
edges {
node {
id
fields {
slug
}
frontmatter {
tags
}
code {
scope
}
}
}
}
}
`)
I think it may be possible to filter the frontmatter for "draft" and "inactive" — but that is only half the equation. Need to think more about how to conditionally do it so they build during gatsby develop' but not
gatsby build`.
whats difficult about this is we still want posts from inactive teammates built — it's easy to say "if teammate is inactive, don't publish anything associated w/them" — what's harder is "if teammate is inactive, don't publish their profile"