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
136 stars 7 forks source link

Plugin Assets and Media Folder are not copied #93

Open dustsucker opened 1 week ago

dustsucker commented 1 week ago

The Assets and media Folders(https://getkirby.com/docs/guide/plugins/custom-plugins#plugin-assets) inside of Plugins appear to be missing in build.

Expected Behavior

the Assets in the assets Folder of a plugin should be available at /media/plugins/$PLUGIN_NAME/** So, basically Copy the Assets from The Plugin into the folder under /media/plugins/$PLUGIN_NAME

Current Behavior

The Assets are not Available in the Build Folder

Possible Solution

For now, copy the assets' folder manual to the build output. For Fixing scaning the Plugin Folder For assets Folders and copy them to the correct Path

Steps to Reproduce

Create a test plugin, create an assets' folder, put in a File and build the Site. Check build folder for the Plugin under /media/plugins

Context

Kirby Version: 4.1.2 OS: Linux(Nixos)(Should not mater here) Plugin Instalation: Git submodule / Manual Plugin Usage: inside a generate.php file with these basic comands and some customRoutes: $staticSiteGenerator = new D4L\StaticSiteGenerator($kirby); $staticSiteGenerator->skipMedia(false); $staticSiteGenerator->setCustomRoutes($customRoutes); $files = $staticSiteGenerator->generate("./build");

Thank you for your good Work.

dustsucker commented 1 week ago

I have created a basic Repository for showing the Problem: https://github.com/dustsucker/PluginAssetsNotInBuild running it should be as simple as installing the composer dependencies and running PHP generate.php

jonathan-reisdorf commented 1 week ago

Fixed in https://github.com/jonathan-reisdorf/kirby-static-site-generator. Since I cannot close issues here anymore, feel free to close it yourself