d4l-data4life / kirby3-static-site-generator

Static site generator plugin for Kirby 3+. With this plugin you can create a directory with assets, media and static html files generated from your pages. The result is an even faster site with less potential vulnerabilities.
MIT License
134 stars 8 forks source link

Error: Field "staticsitegenerator": The field type "staticSiteGenerator" does not exist #84

Closed Dhrumilcse closed 10 months ago

Dhrumilcse commented 10 months ago

Expected Behavior

Should be able to see the button to export the static site

Current Behavior

Throws Field "staticsitegenerator": The field type "staticSiteGenerator" does not exist when the field staticSiteGenerator is added in the site.yml blueprint.

Steps to Reproduce

  1. Manually download the content of the plugin (v1.21.1) and place it in the site/plugins. (For added detail - it comes up on the panel/system page, so assuming it was installed correctly.)

  2. Modify site/config/config.php

    
    <?php

return [ 'debug' => true, 'd4l' => [ 'static_site_generator' => [ 'endpoint' => 'generate-static-site', 'output_folder' => './static', ], ], ];


3. Modify site/blueprint/site.yml

title: Site fields: staticSiteGenerator: label: Generate a static version of the site



## Context

Kirby - v3.9.7
Plugin - v1.21.1
PHP - 8.2
OS - macOS
jonathan-reisdorf commented 10 months ago

Hi @Dhrumilcse,

thank you for reporting. Are you using the PHP built-in server, but did not specify the router file? This would be a common reason for the error showing up. In that case, try running e.g. php -S localhost:8765 kirby/router.php

Closing the issue, feel free to reopen if this does not solve the error.

Dhrumilcse commented 10 months ago

Thanks, @jonathan-reisdorf. Indeed I was using the built-in server. Using the router file worked. I appreciate the help.