Skip to content

Commit

Permalink
restore old hidden docs implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahs committed Oct 20, 2020
1 parent 9f10fdd commit d818c9f
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 7 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
node_modules
npm-debug.log
coverage
content/early-access
content/early-access-test

# blc: broken link checker
blc_output.log
blc_output_internal.log
dist
dist
5 changes: 3 additions & 2 deletions crowdin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ files:
- source: /content/**/*.md
translation: /translations/%locale%/%original_path%/%original_file_name%
ignore: [
"/content/README.md"
"/content/README.md",
"/content/early-access"
]
- source: /data/**/*.yml
translation: /translations/%locale%/%original_path%/%original_file_name%
Expand All @@ -22,4 +23,4 @@ project_id_env: CROWDIN_PROJECT_ID
api_token_env: CROWDIN_PERSONAL_TOKEN

# https://support.crowdin.com/configuration-file-v3/#saving-directory-structure-on-server
preserve_hierarchy: true
preserve_hierarchy: true
2 changes: 2 additions & 0 deletions data/ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ header:
product_in_progress:
👋 Hello, explorer! This page is under active development. For the
most up-to-date and accurate information, please visit our <a href="https://developer.github.com">developer documentation</a>.
early_access:
👋 This page contains content about an early access feature. Please do not share this URL publicly.
search:
need_help: Need help?
placeholder: Search topics, products...
Expand Down
4 changes: 4 additions & 0 deletions includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
{% elsif currentLanguage == 'en' and site.data.ui.header.notices.flags.product_in_progress == true %}
{% assign header_notification_type = "product_in_progress" %}
{% assign header_notification = site.data.ui.header.notices.product_in_progress %}

{% elsif page.hidden %}
{% assign header_notification_type = "early_access" %}
{% assign header_notification = site.data.ui.header.notices.early_access %}
{% endif %}

{% if header_notification %}
Expand Down
2 changes: 2 additions & 0 deletions lib/algolia/find-indexable-pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ module.exports = async function findIndexablePages () {
const indexablePages = allPages
// exclude pages that are part of WIP products
.filter(page => !page.parentProduct || !page.parentProduct.wip)
// exclude hidden pages
.filter(page => !page.hidden)
// exclude index homepages
.filter(page => !page.relativePath.endsWith('index.md'))

Expand Down
6 changes: 2 additions & 4 deletions lib/frontmatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@ const schema = {
mapTopic: {
type: 'boolean'
},
// The `hidden` frontmatter property is no longer used, but leaving it here
// with an enum of `[false]` will help us catch any possible regressions.
// allow hidden articles under `early-access`
hidden: {
type: 'boolean',
enum: [false]
type: 'boolean'
},
layout: {
type: ['string', 'boolean'],
Expand Down

0 comments on commit d818c9f

Please sign in to comment.