Skip to main content

[Web] Building up Github pages

Before we started...

This content was posted originally in my old GitHub pages blog site, but I've abandoned that site, so I post here again in English.

I have to say, this post has saved me once when I tried to made another GitHub pages site for my friend, so I hope you find it useful too.

Who's this article for?

  • who...wants to have a blog in GitHub 
  • who is not familiar with command line, neither wants to use it
  • Windows users
  • who's never heard of Jekyll、Bash、gem

What happened to me?

I got a laptop and a PC, both are Windows. After I saw some posts about building website with GitHub, I was so excited about it and tried to do it on my own.

First on the GitHub Pages tutorial, they suggested using Jekyll; so without a doubt, I went to Jekyll to see what's on there. But with more tutorial steps, there showed up more stuff I'm not familiar with like Ruby or Ubuntu; and with some tools I tried to install, I encountered a few compatibility problems.

Isn't this supposed to be simple and quick? How does this become so complicated and difficult? And I tried to understand what these posts for and why they suggested installing all those tools. Turns out, it's all but for one purpose only:
  • Preview the site on locals
For me, the time and patience I have invested in were way pass what it can bring to me, so I gave up researching and trying.

So if you're just like me, who wants a simple site and cares not about "previewing" it on your local computer, you're in the right place. We can have a simple but still awesome site without diving too deeply!

How to have GitHub Pages

Steps:

  1. Register on GitHub
  2. Choose template from Jekyll(without installing anything)
  3. Do some trivial settings
That's it!
I will assume that you already have an account on GitHub, so let's start from step 2!

Choose a template

Go to Jekyll template sites, and choose a one you like, then "fork" it to your GitHub.
If it's a zip file, just unzip it and upload it to your branch.

If you're not sure how to do it, see as following:
  • Choose a template, then go to its GitHub page( click on Homepage)
  • Click "Fork" to have a branch in your own GitHub
  • You will see a newly-built project( or we call it repository on GitHub). As mine here is named Alomahuang/hanuman, the name before slash is your GitHub name, and the name after it is the name of the repo of template you just forked.

Basically it's done already!

If you're downloading the zip. Just create a new repository, and I highly suggest you name it like Blog or BlogSite, it's related to your blog url.

Settings

Here we will change settings in your repo, and adjust the config file of your repo too.

Setting changing

The name you choose will affect what your url looks like, so be aware.

  • Click on setting in the repo you just created.
  • Change the name to what you want( originally mine was named Type-on-Strap, and I changed it to Blog)

Change default branch

Usually there are two mainly-used branches: master and gh-pages. Since we( or I) decide not to preview anything on our(or my) local computer, it doesn't really matter which branch you choose as default branch. But I still make gh-pages as my default.

Two places needed to be done:

  • One is Settings->Branches
  • The other is Settings->Options(scroll to the bottom)

Adjust config

The final and the most step of all is to adjust your config.yml file. Don't mess with it!
  • Under the right branch of your repo(the branch you choose to be default), click _config_yml file.
  • Click on "edit" (top right)

Content needs to be changed:
  • replace the content of baseurl to your repo's name. In my case it's Blog, and remember you might need to put slash before.
baseurl: "/Blog"
  • replace the content of url to your GitHub(usually it's https://your_account.github.io)
url: "https://alomahuang.github.io"
These two are the most important, others just for some cutomazation.
  • Don't forget to commit!

Voila!
Remember go to Settings->Options to check your full url!


Comments

Popular posts from this blog

[Book] 叫我自己親愛的

短評 瑞蒙‧卡佛不是我最愛的作家,但卻是令我印象最深刻的一位,他的個人風格很強烈,主題都關於日常生活。這本書雖然副標題是「瑞蒙‧卡佛談寫作」,但其實並不只如此,或者說他確實在談寫作,但其實多是評論某些作品,然後加入自己對於寫作的想法。 另外我十分喜歡瑞蒙‧卡佛對於自己生命經驗的分享,對於自己父親以及家庭的想法,另外也有篇章寫道他對於幾位朋友的感受,那些都真切而不過份,這些是我喜歡的部分。

[Book] 與切格瓦拉的短暫相遇

這本書包含了八篇班˙方登的短篇小說,因為這本書,讓我下定決心今年要看50本真正優質的小說(世界經典小說或當代文學小說),不包含我平常閱讀的雜書(瑜珈、宗教、科普、社普等)。 本書的第一篇<中央山脈的瀕臨絕種鳥>,展示了作者驚人的想像力與幽默感。一個鳥類學者(資本主義國家來的人)被挾持的過程中,遇見了共產主義的歹徒,最後卻又遇到同鄉,但卻發現不管誰,其實都是為了自己的利益,簡直諷刺到了極點。 <海地之夢>最後結局的無奈,人事已非的處境,更讓人感到好笑(一種深沉的幽默)與痛心。 <好的都被選走了>、<亞洲老虎>、<布基與古柯鹼>、<獅子之口>等,每一篇的主題都不盡相同,卻一再觸碰我靈魂(如果我有的話)深處那一個熱愛文學的心,我無意於此寫上每一篇的心得,因為那將會占用我寶貴的時間。而我,因為背傷,雖然多出了許多時間,但我寧願用來發呆,也不願評論他人的作品。不過,容我向班致敬,這個作品真的是傑出。

[Book] 革命前夕的摩托車之旅

切,在某種層面上,應該是全球年輕人的偶像,至少在我成長的過程中,閱讀到他的故事,他就活在我的心中,一個令人景仰的熱血英雄(反叛份子)。 而這本書,是他的日記,當然是他在這一切冒險後,花時間再做整理的書,充滿了許多年輕人的冒昧與愚蠢,卻也反映他不造作而坦然的生活態度。 切與他的朋友(阿爾貝托·格拉納多,在這趟旅行他不比切不重要,讓我們也記得他)這一路的冒險,仍然是傳奇的一個原因,在於當代的人,不論年輕的還是年老的,都無法做到。即便現在多少人出過國,他們的目的仍然是追求享樂,甚至虛榮,多少人說熱愛旅遊,其實只是多麼熱愛吃,這根本不是旅遊的意義。我是徹底討厭旅行的,厭惡舟車勞頓,也厭惡例行的日子改變,而若要增廣見聞,書本不就是最好的工具,當然,如果你是有勇氣跟切與阿爾貝托一樣的旅行,那我絕對支持,旅行對你的人生將會有重大的啟發與改變。 但切與我,肯定不會成為朋友的,一方面是他的個性太過瘋狂與偏執,另一方面,我不完全認同他對於階級的看法,所以很有可能,我們還會是敵人,不過即使是敵人,那些充滿信念的,仍然值得尊敬,而即便是朋友,那些沒有信念的,也難得到我的關注。而就像那些歌頌打破常規的人,那些歌頌雲遊四海的人,在他們的旅途中接收了多少「定下來的人」的幫助,若這些人都去旅遊,又有誰來幫助人呢?我願成為那些定下來的人,也願伸出友誼之手,但也別告訴我這是一個錯誤的選擇,只因我們選擇往不同的方向前進。 共產的浪漫是美好的,但人性卻不然,美好的人性需要教育,所以跟切的共通點,大概就是這個,希望所有的人都能有教育的機會,至少不該被剝奪最初受教的權力。