PHP code example of bnomei / kirby3-htmlhead

1. Go to this page and download the library: Download bnomei/kirby3-htmlhead 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/ */

    

bnomei / kirby3-htmlhead example snippets


<!DOCTYPE html>
<html>
    <head>
        <?= htmlhead()
            ->recommended_minimum()
            ->title()
            ->base()
            // ->link_preconnect(...)
            ->script_js(['/assets/app-async.js'], async: true)
            ->script_js(['/assets/app.js'])
            ->link_css(['/assets/app.css'])
            // ->link_a11ycss()
            // ->link_csswizardry_ct()
            // ->link_preload(...)
            // ->script_js(['/assets/app-defer.js'], defer: true)
            // ->link_prefetch(...)
            // ->link_prerender(...)
            // ->link_canonical(...)
            // ->link_alternates(...)
            ->meta_robots()
            ->meta_author(site()->author())
            ->meta_description($page->seoDesc())
            ->meta_opengraph(description: $page->seoDesc())
            ->link_feedrss()
            // site/snippets/my-snippet.php
            ->my_snippet(['key' => 'value'])