plerd icon indicating copy to clipboard operation
plerd copied to clipboard

Add ability to have static assets

Open danbarbarito opened this issue 6 years ago • 5 comments

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.

danbarbarito avatar Nov 17 '18 21:11 danbarbarito

Thanks for this! It will be a little bit before I can give it a proper examination, but I look forward to it.

jmacdotorg avatar Nov 19 '18 14:11 jmacdotorg

No problem! Perl is far from my strongest language so I'm sure you will find many things that can be refactored 😆

danbarbarito avatar Nov 19 '18 14:11 danbarbarito

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 avatar Dec 23 '18 22:12 jmacdotorg

@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.

danbarbarito avatar Jan 22 '19 00:01 danbarbarito

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.

jmacdotorg avatar May 15 '19 16:05 jmacdotorg