Search code examples
jekyllgithub-pages

Change GitHub profile link on GH Pages


I want to create an online resume with GitHub pages and Jekyll. I'm using the Minimalist theme.

It comes with a sidebar link to my GitHub account. However, because I have created an organisation for the purpose of getting a custom address (myname.github.io instead of myusername.github.io). This means that it links to that organisation, but I want it to link to my account.

How can I do this?


Solution

  • As suggested in the project with the additional step to change the link:

    1. Copy the original template from the theme's repository (Pro-tip: click "raw" to make copying easier)
    2. Create a file called /_layouts/default.html in your site
    3. Paste the default layout content copied in the first step
    4. Change the following section to reflect your needs and show the link you want:

      <a href="{{ site.github.url }}"> <h1>{{ site.title | default: site.github.repository_name }}</h1> </a>
      <p>{{ site.description | default: site.github.project_tagline }}</p>
      
      {% if site.github.is_project_page %}
        <p class="view"><a href="{{ site.github.repository_url }}">View the Project on GitHub <small>{{ github_name }}</small></a></p>
      {% endif %}
      
      {% if site.github.is_user_page %}
        <p class="view"><a href="{{ site.github.owner_url }}">View My GitHub Profile</a></p>
      {% endif %}
      
      {% if site.show_downloads %}
        <ul>
          <li><a href="{{ site.github.zip_url }}">Download <strong>ZIP File</strong></a></li>
          <li><a href="{{ site.github.tar_url }}">Download <strong>TAR Ball</strong></a></li>
          <li><a href="{{ site.github.repository_url }}">View On <strong>GitHub</strong></a></li>
        </ul>
      {% endif %}