PHP code example of stillat / statamic-bard-heading-permalinks

1. Go to this page and download the library: Download stillat/statamic-bard-heading-permalinks library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

stillat / statamic-bard-heading-permalinks example snippets




namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Stillat\StatamicBardHeadingPermalinks\HeadingPermalinkExtension;

class AppServiceProvider
{
    public function boot()
    {
        // Register all heading permalink extensions.
        HeadingPermalinkExtension::registerAll();
    }
}



use League\CommonMark\Extension\HeadingPermalink\HeadingPermalinkRenderer;

return [
    'config' => [
        'html_class' => config('statamic.markdown.configs.default.heading_permalink.html_class', 'heading-permalink'),
        'id_prefix' => config('statamic.markdown.configs.default.heading_permalink.id_prefix', 'content'),
        'apply_id_to_heading' => config('statamic.markdown.configs.default.heading_permalink.apply_id_to_heading', false),
        'heading_class' => config('statamic.markdown.configs.default.heading_permalink.heading_class', ''),
        'fragment_prefix' => config('statamic.markdown.configs.default.heading_permalink.fragment_prefix', 'content'),
        'insert' => config('statamic.markdown.configs.default.heading_permalink.insert', 'before'),
        'min_heading_level' => config('statamic.markdown.configs.default.heading_permalink.min_heading_level', 1),
        'max_heading_level' => config('statamic.markdown.configs.default.heading_permalink.max_heading_level', 6),
        'title' => config('statamic.markdown.configs.default.heading_permalink.title', 'Permalink'),
        'symbol' => config('statamic.markdown.configs.default.heading_permalink.symbol', HeadingPermalinkRenderer::DEFAULT_SYMBOL),
        'aria_hidden' => config('statamic.markdown.configs.default.heading_permalink.aria_hidden', true),
    ],
];

bash
php artisan vendor:publish --tag=bard-permalinks-config