PRATAJO

com

Jekyll on Fedora - Installation and use

 

 

Jekyll is a generator of static sites, with blog recognition, for personal sites, projects or organizations, with support for GitHub.

 

  • Installing Jekyll
  • Host a website on GitHub Pages
  • Clone a GitHub Pages site locally

 

 

 

 

 

Installing Jekyll

 

[root@amd64 ~]$ dnf group install "Development Tools"

[root@amd64 ~]$ dnf install ruby ruby-devel rpm-build

 

Now run the following commands with your user

 

[pratajo@amd64 ~]$ echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc

[pratajo@amd64 ~]$ echo 'export GEM_HOME="$HOME/gems"' >> ~/.bashrc

[pratajo@amd64 ~]$ echo 'export PATH="$HOME/gems/bin:$PATH"' >> ~/.bashrc

[pratajo@amd64 ~]$ source ~/.bashrc

 

Finally install Jekyll

 

[pratajo@amd64 ~]$ gem install jekyll bundler

 

Create a folder (name as you like) with the Jekyll website, enter the folder and build the website

 

[pratajo@amd64 ~]$ jekyll new meusite

[pratajo@amd64 ~]$ cd meusite

[pratajo@amd64 meusite]$ bundle exec jekyll serve

 

Open your browser at http://localhost:4000

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

                                              The theme installed by default: minima

 

 

Host a website on GitHub Pages

 

Create an empty repository on GitHub Pages in the format xxxx.girhub.io

 

On the website, edit _config.yml and write the name of the repository "xxxx" created in Git. Start the Git repository and synchronize the website.

 

baseurl: "xxxx.github.io"

[pratajo@amd64 meusite]$ git init

[pratajo@amd64 meusite]$ git checkout -b master

[pratajo@amd64 meusite]$ git status

[pratajo@amd64 meusite]$ git add .

[pratajo@amd64 meusite]$ git config --global user.email "eu@exemplo.com"

[pratajo@amd64 meusite]$ git config --global user.name "Meu Nome"

[pratajo@amd64 meusite]$ git commit -m "Commit inicial"

[pratajo@amd64 meusite]$ git remote add origin https://github.com/yyyyy/xxxx.github.io.git

 

When uploading the site, you will be asked for your GitHub username and password.

 

[pratajo@amd64 meusite]$ git push -u origin master

 

 

Clone a GitHub Pages site locally

 

After creating the site on GitHub we can clone the site locally. To do this, go to the folder where you want to store the project and clone the new repository.

 

[pratajo@amd64 Site]$ git clone https://github.com/username/username.github.io

 

After changing a file, for example index.html, send this new version to GitHub

 

[pratajo@amd64 Site]$ cd username.github.io

[pratajo@amd64 username.github.io]$ git add index.html (se for um novo ficheiro)

[pratajo@amd64 username.github.io]$ git commit index.html -m “Initial commit”

[pratajo@amd64 username.github.io]$ git push origin master

 

And we have the website at https://username.github.io :)