Static Site Generator Plugin

anything else i can provide you with to solve this issue?

Thanks for posting your config. It looks alright, unfortunately I can not reproduce your issue, yet. I didn’t test on a Mac, but on Linux it works just fine together with the starterkit and your config + blueprint.
Just to be sure: This is how you run kirby with php-cli:

php -S localhost:8000 kirby/router.php

right? (If you use a different port that doesn’t matter, but the kirby/router.php part at the end is relevant.)

yes i do use the router.php but instsead of localhost i’m using my macs IP so that i can test the website on my iphone on the same network as well.

i’ll try using git and uploading it to a real server today. maybe the problem will silve itself then…

THANKS FOR YOUR HELP SO FAR! really impressed by this community!

Please let me know how it goes :slight_smile: I’ve also tried to reproduce on a Mac (OS 10.15.4) without success. What we didn’t fully rule out is if you’re using other plugins etc. which might influence some behavior. Would be great if you could test if it works if you clone the latest starterkit, then clone the plugin into the plugins folder, adapt the config and blueprint as you posted and then try if it works (without any other plugins etc.)
Thanks and good luck!

ok so i found out was is causing your plugin to break within my kirby install. Its the “kirby modules” plugin by @thguenther. I couldn’t excactly figure out what part is causing the problems but when i delete it from my install the static html plugin works fine. Maybe you could install it in your testenvironment and take a look if you can find the issue? I can’t delete the modules plugin since its a key part of my install…
thanks so much in advance for any kind of help!

@antonlinus Did you try updating to 3.4.0-rc.2? There was an issue with my modules plugin: https://github.com/medienbaecker/kirby-modules/issues/10#issuecomment-648894740

i tried using git checkout develop but that didn’t work, so i downloaded the attached source code from your link and replaced the contents of my kirby folder with the ones inside the source code zip. this seems to have worked since i now get version 3.4.0 rc2 displayed when login on to the panel site. Yet when i throw the static site generator plugin into the plugins folder i now immediatly get this errormessage:

Error thrown with message "Using $this when not in object context"

Stacktrace:
#8 Error in /Users/antonlinus/Library/Mobile Documents/com~apple~CloudDocs/Documents/Git/odds_without_ends_kirby/www/kirby/src/Cms/App.php:363
#7 Kirby\Cms\App:component in /Users/antonlinus/Library/Mobile Documents/com~apple~CloudDocs/Documents/Git/odds_without_ends_kirby/www/site/plugins/kirby-static-site-generator/media.class.php:7
#6 require_once in /Users/antonlinus/Library/Mobile Documents/com~apple~CloudDocs/Documents/Git/odds_without_ends_kirby/www/site/plugins/kirby-static-site-generator/index.php:7
#5 include_once in /Users/antonlinus/Library/Mobile Documents/com~apple~CloudDocs/Documents/Git/odds_without_ends_kirby/www/kirby/src/Toolkit/F.php:415
#4 Kirby\Toolkit\F:loadOnce in /Users/antonlinus/Library/Mobile Documents/com~apple~CloudDocs/Documents/Git/odds_without_ends_kirby/www/kirby/src/Cms/AppPlugins.php:798
#3 Kirby\Cms\App:pluginsLoader in /Users/antonlinus/Library/Mobile Documents/com~apple~CloudDocs/Documents/Git/odds_without_ends_kirby/www/kirby/src/Cms/AppPlugins.php:769
#2 Kirby\Cms\App:plugins in /Users/antonlinus/Library/Mobile Documents/com~apple~CloudDocs/Documents/Git/odds_without_ends_kirby/www/kirby/src/Cms/AppPlugins.php:601
#1 Kirby\Cms\App:extensionsFromPlugins in /Users/antonlinus/Library/Mobile Documents/com~apple~CloudDocs/Documents/Git/odds_without_ends_kirby/www/kirby/src/Cms/App.php:129
#0 Kirby\Cms\App:__construct in /Users/antonlinus/Library/Mobile Documents/com~apple~CloudDocs/Documents/Git/odds_without_ends_kirby/www/index.php:5

heres a screenshot as well:

@antonlinus thank you, that makes sense. Can you try if this fix works for you?


(branch bugfix/media-original-fns)

The command to clone directly to the branch and name the folder static-site-generator is:

git clone -b bugfix/media-original-fns https://github.com/d4l-data4life/kirby3-static-site-generator.git static-site-generator

Thanks!

1 Like

thanks @jonathan-reisdorf & @thguenther i installed your fix but now i can’t seem to log into panel anymore haha. it just shows a blank page. website is working fine but panel is not accesible anymore. i also installed your fix on a 3.3 kirby install and it threw an call on member function (null) error or something but it did create a static folder and an html file.

ok looks like your fix might work for the 3.3 install. this call on member function (null) error might be on my end… i’ll keep you guys posted. thanks a lot

@jonathan-reisdorf Thank you fo this great plugin. I am trying it out and everything seems to work fine except one thing. I am using strftime as documented here so I can translate month names in a multilingual setup. Static version does not seem to respect the locale and returns names in English. Any ideas?

Hello,
this plugin serves us very well, but I’m wondering about the .kirbystatic file, that is created in the output folder. Why is it created? Is it necessary for the website to work?
It doesn’t seem so, but just wanted to make sure.
Kind regards,
Alex

Hi Alex,
the plugin has a built-in check to make sure that the specified output folder either does not exist, is empty or contains a previously built static website before the generation starts. The reason for that is that all files in the output folder (except the protected ones) are erased before the build and in order to avoid accidental deletion of files this safety check is in place. The empty .kirbystatic file is created when generating the static site for the first time and from that moment on acts as a flag to tell the generator that it’s safe to overwrite the contents of this folder. Of course e.g. when uploading the files to a CDN you can safely skip this one, it serves no function other than for the kirby plugin.
Best regards,
Jonathan

Hi @phrase,
sorry for the late response. :see_no_evil: Does your problem still exist? I have a working setup with strftime in a statically generated multilanguage site, and can’t reproduce it there. I just had some initial troubles setting up the locales in the system if I remember correctly.
I’m happy to research this issue further if it still exists! Thanks and best regards!