Skip to content

Commit

Permalink
Improve docs for visibility config and add samples
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffreymcgill committed Jan 28, 2025
1 parent 3eeaba9 commit 7358494
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 8 deletions.
20 changes: 12 additions & 8 deletions configuration/page.md
Original file line number Diff line number Diff line change
Expand Up @@ -694,23 +694,23 @@ Some content here.

Configure the visibility of the page to be `public`, `hidden`, `protected`, or `private`. Default is `public`.

| Mode | In search results? | Description |
| --- | :---: | --- |
`public` | :white_check_mark: | The page is public and visible in the main navigation.
`hidden` | :no_entry_sign: | The page is created but will not be included in the navigation or search results. Useful for sharing a draft page before making public.
`protected` | :no_entry_sign: | The page is added to the navigation but requires a password to access.
`private` | :no_entry_sign:| The page is hidden and is not added to the navigation.
| Mode | Navigation? | Search? | Password? | Description |
| --- | :---: | :---: | :---: | --- |
`public` | :white_check_mark: | :white_check_mark: | :no_entry_sign: | The page is public and visible in the main navigation.
[`hidden`](#hidden) | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | The page is created but will not be included in the navigation or search results. Useful for sharing a draft page before making public ([sample](/samples/hidden.md)).
[`protected`](#protected) | :white_check_mark: | :no_entry_sign: | :white_check_mark: | The page is added to the navigation but requires a password to access ([sample](/samples/protected.md) password: `test`).
[`private`](#private) | :no_entry_sign: | :no_entry_sign: | :white_check_mark: | The page is hidden and is not added to the navigation ([sample](/samples/private.md) password: `test`).

===


### hidden

With hidden, the page will still be created and added to the final website, but it is _hidden_. You can still link to the page or share a link to the page.
With `hidden`, the page will still be created and added to the final website, but it is _hidden_. You can still link to the page or share a link to the page.

Retype would ensure no automatically generated links or references to the hidden page are created. If on a public page, a link to a hidden page is made by an author, the link will work and the hidden page will be visible.

The following sample demonstrates hiding a page:
The following [sample](/samples/hidden.md) demonstrates hiding a page:

```md
---
Expand All @@ -729,6 +729,8 @@ Setting `visibility: hidden` on a page is a good way to create a _draft_ or _sec

To create a protected page, add `visibility: protected` and then set the password for the project using the `--password` flag.

The following [sample](/samples/protected.md) demonstrates creating a protected page:

```md
---
visibility: protected
Expand Down Expand Up @@ -757,6 +759,8 @@ visibility: protected
To create a private page, add `visibility: private` and then set the password for the project using the `--password` flag.

The following [sample](/samples/private.md) demonstrates creating a private page:

```md
---
visibility: private
Expand Down
10 changes: 10 additions & 0 deletions samples/hidden.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
visibility: hidden
---
# Hidden page

This page will be hidden from the menu and search results.

The password is `test`.

See [`visibility`](/configuration/page.md#visibility) documentation.
10 changes: 10 additions & 0 deletions samples/private.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
visibility: private
---
# Private page

This page will not be visible in the main navigation and will require a password to view the page.

The password is `test`.

See [`visibility`](/configuration/page.md#visibility) documentation.
11 changes: 11 additions & 0 deletions samples/protected.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
icon: file
visibility: protected
---
# Protected page

This page will be visible in the main navigation, but will require a password to view the page.

The password is `test`.

See [`visibility`](/configuration/page.md#visibility) documentation.

0 comments on commit 7358494

Please sign in to comment.