Export code from Codepen to Github

Export code from Codepen to Github
0.0 0

#1

Hi everyone
I want to export my code from code-pen to GitHub but the JavaScript file doesn’t work when I save it like a zip. The html and the css file work correctly only the JavaScript doesn’t work.
I can only save the code like “Save as GitHub Gist” but It’s not the way I want it.
This is some link of my code https://codepen.io/tomcolby/pen/VzzYQO
https://codepen.io/tomcolby/pen/MvLLNv
Would you help me please because I want to save all of my code on GitHub?


#2

Did you save the Javascript file as a .js file? You could use the terminal to push it to GitHub. Like this:

https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/


#3

No! I’m gonna try and I let you know. Thanks!


#4

I’ve never had a problem with this. When I go to the lower right corner and do export->export-to-zip, it always works. I get a zip file that unzips to the following structure:


├── css/
│   └── style.css
├── js/
│   └── index.js
├── index.html
├── license.txt
└── README.txt

#5

My mine appear like this.
Index.html
Css_____style
Js______index
And the others.


#6

That’s quite odd. Are you saying that style.css had no file extension? The same with index.js? If not, I would definitely add them.

If you look in the index.html, it will tell you exactly where it is expecting to find those files and what name/extension it is expecting.

The other thing I would suggest is opening your browser console. There is a good chance there is an error message in there that will tell us what is happening.


#7

Hi Kevin,

I’m currently learning how to use GitHub and in the process of preparing for applying to a coding Bootcamp so I need to transfer my code from on Codepen.io to GitHub. You instructions worked perfectly.

Astra Rai