Skip to content

Commit

Permalink
Remove the enabled key from the permalinks configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Dec 3, 2024
1 parent 4e80297 commit f53eb4d
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion config/markdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@
*/

'permalinks' => [
'enabled' => true,
'pages' => [
\Hyde\Pages\DocumentationPage::class,
],
Expand Down
4 changes: 1 addition & 3 deletions docs/digging-deeper/advanced-markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,11 @@ Hyde automatically adds clickable permalink anchors to headings in documentation

The feature is enabled by default for documentation pages. When enabled, Hyde will automatically add permalink anchors to headings between levels 2-4 (h2-h4). The permalinks are hidden by default and appear when hovering over the heading.


You can disable the feature, or enable it for other page types, in the `config/markdown.php` file.
You can enable it for other page types by adding the page class to the `permalinks.pages` array in the `config/markdown.php` file, or disable it for all pages by setting the array to an empty array.

```php
// filepath: config/markdown.php
'permalinks' => [
'enabled' => true,
'pages' => [
\Hyde\Pages\DocumentationPage::class,
],
Expand Down
1 change: 0 additions & 1 deletion packages/framework/config/markdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@
*/

'permalinks' => [
'enabled' => true,
'pages' => [
\Hyde\Pages\DocumentationPage::class,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public function testPermalinkConfigurationLevels()

public function testDisablingPermalinksGlobally()
{
config(['markdown.permalinks.enabled' => false]);
config(['markdown.permalinks.pages' => []]);

$markdown = '## Heading';
$html = (new MarkdownService($markdown, DocumentationPage::class))->parse();
Expand Down

0 comments on commit f53eb4d

Please sign in to comment.