0

I am trying to publish my first d3 bl.ock, using gist via the web interface (not terminal). My gist consists of 3 files: an index.html, a .js file, and a json file. I am trying to work from other gist examples which use index.html + auxiliary files. Somehow, other authors are able to add files which serve the index.html. But when I try it, here is what happens:

Step 1. Make a gist and submit the index.html file. This shows up on bl.ock.org/myname/newgistnumber. So far so good.
Step 2: Add a file (for example, the json data file) to my index.html and update the gist. Now the index.html is renamed as whatever my latest file addition was (e.g. "myjson.json"), making my bl.ock unusable. What error am I making? Thanks for your advice.

ouonomos
  • 700
  • 1
  • 9
  • 25
  • Here's an update, in case it's useful for anyone else who, like me, has minimal prior experience: the name of the gist will indeed be updated to your most recently added file. But this is normal behavior. If, like me, you can't get your gist to display, it's because of your incorrect code and not as I thought, because of this renaming. – ouonomos Nov 04 '15 at 22:43
  • Also on this topic: want to recommend trying blockbuilder as a way to get your gist up and running. I could not get my auxiliary .js file to load through it, but it was quite helpful with the rest of the upload process. – ouonomos Nov 04 '15 at 22:45

1 Answers1

2

I am not sure what you mean in Step 2 by "add a file to my index.html."

What you need to do is add a file to the Gist and link to it from your index.html file.

You should be able to add a file to your Gist without changing the Gist number or the name of your index.html file. To add a file to your Gist, click the Edit button at the top and then the Add file button at the bottom. Link to this new file from your index.html (with a <script> tag, for example).

The two requirements for a bl.ocks.org are a Gist number and an index.html file, if you have those, Step 1 should work. See also Make Gist from Github repo for display on bl.ocks.org.

Community
  • 1
  • 1
jeninco
  • 36
  • 4
  • Thanks for your response. I believe that I'm doing exactly what you describe. From my index.html file, I am clicking edit, then adding a file, which is as you say referenced within the index.html file. When I do this, the index.html file is renamed to whatever file I add. – ouonomos Nov 04 '15 at 00:57
  • Perhaps you are confusing the title of your Gist with the name of your file? In Gists, the title of the Gist is always the name of the first file sorted alphabetically. The title might change but the Gist number in the URL should remain the same and your index.html file should also remain the same. – jeninco Nov 05 '15 at 00:55
  • Yes, you're right; that's exactly what I did. When my uploads failed to display my gist, I mistakenly believed that this file naming behavior was responsible. Once I got my code working, I realized the naming behavior wasn't at fault. – ouonomos Nov 05 '15 at 01:02