Tuesday, May 31, 2022
HomeData ScienceOrganising a web site and separate weblog repository hosted on GitHub

Organising a web site and separate weblog repository hosted on GitHub


Because the title of the weblog suggests, I want to use this area to put in writing about something “information”-related that piques my curiosity. Possible, it will consist of private and tutorial initiatives.

Because the title of this publish suggests, I want to clarify how I created this weblog and my web site.

Throughout my 5 years at Columbia, I’ve sporadically messed round with coding html and css in an try and make a private web site. Numerous iterations have been hosted on the physics division servers, however, within the curiosity of long-term internet hosting, I made a decision emigrate all the things to GitHub. This was largely impressed by these weblog posts from Joshua Lande and Burton DeWilde although carried out a bit otherwise.

GitHub Pages

GitHub has a function known as GitHub Pages that gives one free web site per account. Organising your free web site is sort of straightforward (and detailed higher on the above hyperlink):

  • Create a brand new repository titled username.github.io
  • Clone the repository to your laptop
  • “Initialize” the repo by creating an index.html file

Your new GitHub web site is username.github.io. Now you can construct your web site within the repo you created, and GitHub takes care of the remainder.

All I needed to do was copy all the information from the physics server into my new repo, and my web site was constructed at ethanrosenthal.github.io (as a result of “ethanrosenthal” is my GitHub username).

Including a customized area

I wished to make use of a customized area as an alternative of ethanrosenthal.github.io, so I purchased ethanrosenthal.com via namecheap.com for ~$10/12 months. So as setup the customized area on namecheap, go to “Your Domains/Merchandise,” click on the bought customized area, after which click on “All Host Data.” It is best to now fill within the prime three rows as follows:

Host Title IP ADDRESS/URL RECORD TYPE TTL
@ 192.30.252.153 A (Tackle) 1800
@ 192.30.252.154 A (Tackle) 1800
www username.github.io CNAME (Alias) 1800

Under is a screenshot of my stuffed in namecheap dashboard:

Along with the above modifications that it’s important to make, it’s worthwhile to embrace a file in your username.github.io repo titled “CNAME” which accommodates your customized area identify in it. For instance, mine merely says “ethanrosenthal.com”. It could take a while for these modifications to totally propagate, however, ultimately, your customized area ought to efficiently redirect to the GitHub Pages repo (although nonetheless show the customized area within the url bar).

Along with one free private web site, GitHub Pages permits for limitless “Undertaking” Pages. You’ll be able to create a Undertaking Web page for any repository in your GitHub account. The Undertaking Web page is actually a web site related together with your repo. That is how I selected to setup the weblog. I created a brand new repo known as “weblog” and stuffed it with all the information for a full-fledged weblog.

Jekyll and Poole

Contemplating it took me a few years to create my web site, I opted to make use of a weblog template reasonably than begin from scratch. GitHub Pages are powered by Jekyll, a static website generator. Running a blog is sort of easy – you may write your weblog posts in Markdown, and Jekyll just about takes care of the rest that you don’t really feel like customizing. This even consists of the format of all the things in the event you select to obtain Poole. Merely go to the Poole GitHub, clone the repo, after which sort

in your terminal. Jekyll will now construct a static web site, as specified and laid out by Poole, within the folder _site/. The important thing distinction between your free GitHub web site and GitHub Undertaking Pages is that it’s worthwhile to push your web site to a separate “gh-pages” department to be able to construct the Undertaking Pages web site related together with your repository. So, after constructing your static web site in your native machine, you will need to change to the gh-pages department, add/commit your information, after which push to GitHub. The Jekyll-built repo web site will now be positioned at username.github.io/repo

Customized Undertaking Pages domains

I bumped into some points with my weblog Undertaking Web page not formatting accurately due to my customized area. I’m nonetheless not precisely positive why this was taking place, however making a customized area for the weblog solved the issue. To do that, I added the next underneath SUB-DOMAIN SETTINGS on the namecheap dashboard

Host Title IP ADDRESS/URL RECORD TYPE TTL
weblog ethanrosenthal.github.io. CNAME (Alias) 1800

I additionally added a CNAME file to the weblog repo containing the road “weblog.ethanrosenthal.com”. Now, the weblog is positioned at weblog.ethanrosenthal.com, and all the things redirects and codecs tremendous.

Lastly

There are a pair different issues that I’ve performed, like including an Archive part and Google Analytics monitoring, however these duties have been documented within the weblog posts that I linked to on the prime. Hopefully, I’ll have some extra attention-grabbing initiatives to publish quickly.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments