Post working p5.js sketches to blogger?

edited July 2017 in p5.js

Hi all,

Complete newbie here! I started learning p5.js at the beginning of this year and would like to blog my progress.

Is it possible to make the sketches work in my blogger posts? And what if have extra multiple .js files or media files within your folder? It would be great if they could work right there instead of a link to my github.

Thanks!

Tagged:

Answers

  • Most minimum "index.html" to run a p5.js sketch called "sketch.js" is:

    <script async src=https://CDN.JSDelivr.net/p5.js/latest/mainfile></script>
    <script defer src=sketch.js></script>
    

    And if you already got "p5.min.js" in the same folder as your "sketch.js" & "index.html":

    <script async src=p5.min.js></script>
    <script defer src=sketch.js></script>
    

    And if your program needs UTF-8 characters, place this on the very top of your "index.html":

    <meta charset=UTF-8>
    
  • Hi,

    I don't really understand what you mean :(

    At the moment I just use blogger's templates and write using their text editor/html editor window. Was wondering if there was any code I could put in there to add my javascript work.

    Alternatively if there is way of embedding from github pages that could work too.

  • Answer ✓

    Just for reference I've found that openprocessing.org has a great sharing feature allowing you to embed into html. Hope this helps other if they want to blog with a working sketch in their post!

Sign In or Register to comment.