expectocode / pagong

pagong - a site generator for slow connections
Apache License 2.0
7 stars 2 forks source link

Assets under a directory fail to be copied #5

Open Lonami opened 4 years ago

Lonami commented 4 years ago

If I have:

myblog/
└── content
    └── mypost
        ├── assets
        │   ├── bar.jpg
        │   └── foo.jpg
        └── post.md

Then the application will currently fail to copy assets because it's a directory and not a file with contents.

Personally, I think a separate assets/ directory just makes things cleaner. Users may choose to name it content/, or media/, or anything they like (as standalone assets). But currently everyone is forced to put everything in the root of mypost/ which can get messy.

expectocode commented 4 years ago

Happy to support this if it doesn't introduce too much complexity

Lonami commented 4 years ago

Should be a matter of supporting either files or directories in: https://github.com/expectocode/pagong/blob/642530c60f125bb7edd5e5c7b698fd079ff772a4/src/fs_action.rs#L8-L11

I'm okay with this working for both types of paths; adding another variant to copy directories would probably just be more annoying to handle (it now has to be done at construction-site of the variant).