seankross / postcards

💌 Create simple, beautiful personal websites and landing pages using only R Markdown.
Other
534 stars 78 forks source link

Use URLs for postcard images (rather than local files) #20

Closed jjallaire closed 3 years ago

jjallaire commented 3 years ago

The inclusion of the postcard jpg within the template skeleton directory was causing RStudio to create a subdirectory for postcards.

I'm thinking that this isn't normally desirable: for example, if you have a GH pages repo that is just a postcard you'd typically want the postcard at the top-level rather than in a subdirectory.

This also makes the Distill case of adding a postcard to a site much more intuitive, since Distill only renders pages at the top level of the repo (so without this the user needs to create the postcard then move it to the site root).

Finally, I think that users will often link to an external image anyway (e.g from their LinkedIn or Twitter profile) so modeling this within the template seems like a good idea.

seankross commented 3 years ago

Just to make sure I understand: is it true that if there are more files in the inst/rmarkdown/templates/[name]/skeleton directory than just skeleton.Rmd then RStudio will create a subdirectory even if create_dir: false in the template.yaml?

jjallaire commented 3 years ago

Yes, that is exactly right.

One other reason I was thinking that postcards is well suited to create_dir: false: With the philosophy of creating a single standalone HTML file, it's nice that the user doesn't need to consider whether they need to deploy the profile image (which would otherwise be a bit ambiguous with it sitting alongside the .html file).

seankross commented 3 years ago

I agree with you, creating a subdirectory is not desirable. I think that a GH pages repo that is just a postcard will be a typical case, therefore I think it makes sense for a postcard to be in its own RStudio project, so I am going to make an RStudio project template for this package and link the corresponding PR here.

I am hesitant to use URLs for postcard images because putting the correct image online could be an awkward initial step for many of the beginner students that I teach. I agree that the fact that you can use a URL should be well documented though and I agree with you that many people will want to do that.

seankross commented 3 years ago

Many of these changes have now been incorporated via #25.