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

feat(docs,blog,pages): add support for "unlisted" front matter - hide md content in production #8004

Merged
merged 54 commits into from
Nov 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
e0acbd0
Exclude unlisted docs
jodyheavener Aug 24, 2022
9e19e0f
Exclude unlisted pages
jodyheavener Aug 24, 2022
760dca9
Exclude unlisted blog posts
jodyheavener Aug 24, 2022
cdb1822
Merge branch 'main' into jh/unlisted
slorber Oct 21, 2022
d03283d
dedup unlisted/draft logic
slorber Oct 21, 2022
f25969a
add page unlisted metadata
slorber Oct 21, 2022
62b1ecf
use unlisted metadata in mdx page
slorber Oct 21, 2022
bda2d10
optimize unlisted global data size: no attribute if unlisted false/un…
slorber Oct 21, 2022
8b84d30
deduplicate blog sidebar item filtering
slorber Oct 21, 2022
de872c2
improve project draft/unlisted dogfood
slorber Oct 21, 2022
0aa11e1
extract theme visibility filtering logic to theme-common
slorber Oct 21, 2022
c92b5ab
refactor DocSidebarItems
slorber Oct 21, 2022
149382d
revert category return null
slorber Oct 21, 2022
66e1d8f
revert useless Link changes
slorber Oct 21, 2022
799c6dc
blog post metadata is required
slorber Oct 21, 2022
82a93f1
revert weird sortPosts dogfood
slorber Oct 21, 2022
f488c50
remove linebreak
slorber Oct 21, 2022
fc6d0cc
Merge branch 'main' into jh/unlisted
slorber Oct 27, 2022
c4430ae
exclude unlisted blog posts from feed
slorber Oct 27, 2022
55dd501
Add unlisted tag dogfooding
slorber Oct 27, 2022
80a110a
add better visibility dogfooding + ability to simulate prod content v…
slorber Oct 27, 2022
1da33a3
extract toSidebarDocItemLinkProp, fix edge case + add test to prevent…
slorber Oct 27, 2022
bb1b17b
Add support for unlisted blog tags
slorber Oct 27, 2022
0266f6d
Add support for unlisted blog tags
slorber Oct 27, 2022
94de481
Add theme <Unlisted/> banner/metadata component
slorber Oct 27, 2022
6fef19e
fix test
slorber Oct 27, 2022
ebbf832
improve dogfooding for visibility
slorber Oct 27, 2022
56006ae
replicate unlisted tag logic to docs, extract getTagVisibility
slorber Oct 27, 2022
1b1bb83
add getTagVisibility test + fix bug
slorber Oct 27, 2022
b24a2a0
filter unlisted tags from the docs tags index
slorber Oct 27, 2022
73e28be
fix blog test snapshots
slorber Oct 27, 2022
6bf9f89
fix docs tests snapshots
slorber Oct 27, 2022
a887b9b
Merge branch 'main' into jh/unlisted
slorber Oct 28, 2022
b750f12
fix addDocNavigation => unlistedIds should be computed inside
slorber Oct 28, 2022
0746def
refactor method with 4 params to take 1 object param, use Set instead…
slorber Oct 28, 2022
b8d802a
fix MDX page unlisted position
slorber Oct 28, 2022
fa5823f
draftIds comment
slorber Oct 28, 2022
810ad5d
blog processing: make it use Error Cause like docs
slorber Oct 28, 2022
c974473
add error cause for page source file processing
slorber Oct 28, 2022
b56ba7f
add page draft support
slorber Oct 28, 2022
2730365
add "unlisted" doc + missing FrontMatter doc section for pages plugin
slorber Oct 28, 2022
59d3453
Merge branch 'main' into jh/unlisted
slorber Nov 2, 2022
7ad04e0
improve unlisted default messages
slorber Nov 2, 2022
86801b3
improve unlisted frontMatter docs
slorber Nov 2, 2022
3bf18c5
shared validation of draft/unlisted + add "draft XOR unlisted" rule
slorber Nov 2, 2022
7dde1eb
add more dogfood cases for unlisted/draft category indexes
slorber Nov 3, 2022
d81b518
filter unlisted category index from navigation
slorber Nov 3, 2022
d720989
better unlisted tests covering more edge cases
slorber Nov 3, 2022
cddd5ec
remove useless extra env param
slorber Nov 3, 2022
638dbe3
extract useVisibleSidebarItems
slorber Nov 3, 2022
54f1dc7
category doc link should be removed if linking to an unlisted doc
slorber Nov 3, 2022
5a2726d
add limitation comment
slorber Nov 3, 2022
6840195
fix draft dogfood typo
slorber Nov 3, 2022
3c81af8
breadcrumb of unlisted category index shouldn't be clickable
slorber Nov 3, 2022
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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ exports[`blog plugin works on blog tags without pagination 1`] = `
},
],
"permalink": "/blog/tags/tag-1",
"unlisted": false,
},
"/blog/tags/tag-2": {
"items": [
Expand Down Expand Up @@ -57,6 +58,33 @@ exports[`blog plugin works on blog tags without pagination 1`] = `
},
],
"permalink": "/blog/tags/tag-2",
"unlisted": false,
},
"/blog/tags/unlisted": {
"items": [
"/another/blog-with-tags-unlisted",
],
"label": "unlisted",
"pages": [
{
"items": [
"/another/blog-with-tags-unlisted",
],
"metadata": {
"blogDescription": "Blog",
"blogTitle": "Blog",
"nextPage": undefined,
"page": 1,
"permalink": "/blog/tags/unlisted",
"postsPerPage": 1,
"previousPage": undefined,
"totalCount": 1,
"totalPages": 1,
},
},
],
"permalink": "/blog/tags/unlisted",
"unlisted": false,
},
}
`;
Expand Down Expand Up @@ -106,6 +134,7 @@ exports[`blog plugin works with blog tags 1`] = `
},
],
"permalink": "/blog/tags/tag-1",
"unlisted": false,
},
"/blog/tags/tag-2": {
"items": [
Expand Down Expand Up @@ -133,6 +162,33 @@ exports[`blog plugin works with blog tags 1`] = `
},
],
"permalink": "/blog/tags/tag-2",
"unlisted": false,
},
"/blog/tags/unlisted": {
"items": [
"/another/blog-with-tags-unlisted",
],
"label": "unlisted",
"pages": [
{
"items": [
"/another/blog-with-tags-unlisted",
],
"metadata": {
"blogDescription": "Blog",
"blogTitle": "Blog",
"nextPage": undefined,
"page": 1,
"permalink": "/blog/tags/unlisted",
"postsPerPage": 2,
"previousPage": undefined,
"totalCount": 1,
"totalPages": 1,
},
},
],
"permalink": "/blog/tags/unlisted",
"unlisted": false,
},
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ async function testGenerateFeeds(
);

await createBlogFeedFiles({
blogPosts: blogPosts.filter((post) => !post.metadata.frontMatter.draft),
blogPosts,
options,
siteConfig: context.siteConfig,
outDir: context.outDir,
Expand Down
Loading