#coding cabin
a book page with multiple sections
features:
- banner with a title and space for multiple chapters
- sections for: links, summary, gallery, characters, details, triggers, faq
- you can safely remove any section you don’t want
- responsive design
note: the dropdowns in the faq section might not work on the preview page but they’ll work on the actual blog
a timeline events page with combined filters for anon <3
features:
- combined filters
- responsive design
- events with sections for: image, title, about, links, calendar with day, month and year, space for an event type/person
credits:
- normalize css by https://github.com/necolas
- fonts by google
- slide in menu https://stackoverflow.com/a/62432099
- isotope filters https://isotope.metafizzy.co/
- icon font by https://fontawesome.com/
Hosting files externally is a common practice among the coding community, be it for programming or designing.
Many coders count on websites such as Dropbox for this, however, these might be unreliable in the long run. More often than not, these websites have bandwidth limits that will break links once they’re reached. This means that any code on those links (or rather, the files they link to), will be broken.
Fortunately, GitHub offers all the good stuff without most of these issues. The question is, how do you host your files on GitHub and make them work? It’s not as hard as it might seem!
- First steps
- Setting up repositories for external hosting
- Creating folders
- Inserting the external file in your project
First steps
First things first. You need an account.
Head to GitHub and create your account. It’s completely free!
Verify your account when you’re done and let’s get started.
Setting up your repository
External hosting isn’t as straightforward as it could be, but it’s surely for the best. While there are a few steps to take to make it work, you’ll be doing it seamlessly once you get familiar with it.
- Create your repository. Click on the plus symbol on the top-right corner of the page and select New Repository. Add a name and make sure that it’s Public. (Images 1 and 2)
- Create an index.html file. Your repository needs this file to be seen as a website. You don’t need to type anything on it. It just has to be there. Click on Creating a New File after creating the repository. (Image 3) Type index.html in the name field (Image 4), scroll down and click on Commit New File.
- Setup the proper settings. This is an important step, as your external files won’t work without it. In the repository, click on Settings (Image 5). On the Options tab on the left (selected by default), scroll down until you reach GitHub Pages - second box from the bottom. Under source, select master and Save. (Image 6)
Creating files and folders
On GitHub, you can either create files by typing in the code directly on you repository, or upload them if you have those files saved.
There isn’t much of a difference between these two options. The biggest difference I’ve noticed is that you need to create a file in order to create new folders, whereas if you’re uploading a file, you need to have the folders already created if you want to upload files to them.
- Create a file. To create/upload files, click on Add File and pick whichever option you want. (Image 7) I’ll be creating a new file in this case, also to show you how to create a new folder.
- Name your file. Type in the name of your file and make sure to add the file extension as well. There isn’t a dropdown menu that allows you to pick which coding language you’re using - you need to type it to the file’s name. (Image 8)
- Type your code and commit. Once you’re done adding code, scroll down and click on Commit New File. This will change to Commit Changes when you edit already-existing files. To edit files, just open the file and click on the pencil symbol on the top-right corner of the code editor field.
- Creating folders. To create new folders on your repository, all you need to do is type the folder’s name on the file’s name field and add a forward dash (/). You can create folders within folders, just follow this concept until you’re happy. At the end, type the file’s name and commit. (Image 9)
Inserting external files in your project
Grabbing the URL for externally-hosted files on GitHub isn’t very straightforward either, since there isn’t a button you can click to generate said link.
Here’s the format for files:
//your-username.github.io/file-name.file-extension
Example: //myusername.github.io/myfile.css
And here’s the format for files inside folders:
//your-username.github.io/folder-name/file-name.file-extension
Example: //myusername.github.io/myfolder/myfile.css
If you’re inserting a file which is within more than one level of folders, just add all the folders that you need: //myusername.github.io/myfolder/mysubfolder/mysubsubfolder/myfile.css
Images directory
Image 1 and Image 2
Image 3
Image 4
Image 5
Image 6
Image 7
Image 8
Image 9