plerd
plerd copied to clipboard
Add ability to have static assets
This PR adds the ability to have static assets. Now after running plerdall
, all of the files in the assets/
directory will copied to the docroot/
directory.
Thanks for this! It will be a little bit before I can give it a proper examination, but I look forward to it.
No problem! Perl is far from my strongest language so I'm sure you will find many things that can be refactored 😆
At a glance, this code seems very well engineered!
Before I get nitpicky though, a question: What is the advantage of this approach versus placing asset files directly into the docroot as a separate step? I don't ask this rhetorically, I'm honestly curious about advantages here I may be overlooking.
In my years of using Plerd so far, when I (for example) prepare a post with an image attached, I will move the image into the docroot first, and then I'll publish the post. If I understand correctly, with this change in place, I'd instead move the image into a pre-declared asset directory, and then publish the post (at which point Plerd would copy it into the docroot for me). Is that correct?
@jmacdotorg Sorry for the late reply, I did not see this notification! Your assumption is correct. The only reason I made this change is because I would prefer to keep the docroot out of version control, but my static files in version control. This change allows you to keep your static files separate from your generated files.
Ugh, my turn to apologize... I didn't get the notification to your reply back in January. Dunno what's up with all those dropped telegrams...
Anyway, will ponder, in context of some re-thinking I hope to give to Plerd presently.