How to add my homepage to the blog page?

I created fastblog at “< username >.github.io/blog”. Now how to add “< username >.github.io” to the blog page? Can I change the hyperlink on the top of posts on “< username >.github.io/blog” to redirect into “< username >.github.io”?

you can edit _includes/header.html to edit your navbar/menu. I can’t remember if this file is actually there by default, if it’s not then go and copy it from https://github.com/jekyll/minima/blob/master/_includes/header.html and drop a copy into your own _includes folder.

I tried this now, but the hyperlink of other pages in header is changing but not the title’s link!

i’m not sure what you’ve done or what you’re trying to do. this is my header:

<header class="site-header" style="background-color: #92A2BA; font-weight: bold;">
  <div class="wrapper">
    {%- assign default_paths = site.pages | map: "path" -%}
    {%- assign page_paths = site.header_pages | default: default_paths -%}
    {%- assign titles_size = site.pages | map: 'title' | join: '' | size -%}

<!-- 
the next line is your 'home' link for the blog (has your name by default, i changed it to say home) 
you could put your extra link next to it like this:
-->
    <a class="site-title" rel="author" href="{{ "/" | relative_url }}">Home</a>
    <a class="site-title" href="http://yourmain.github.io">MY MAIN GITHUB.IO SITE</a>

    {%- if titles_size > 0 -%}
      <nav class="site-nav">
        <input type="checkbox" id="nav-trigger" class="nav-trigger" />
        <label for="nav-trigger">
          <span class="menu-icon">
            <svg viewBox="0 0 18 15" width="18px" height="15px">
              <path d="blah blah blah"/>
            </svg>
          </span>
        </label>

        <div class="trigger">
          {%- for path in page_paths -%}
            {%- assign my_page = site.pages | where: "path", path | first -%}
            {%- if my_page.title -%}
<!--
these are your page links on the right hand side
you could add your extra link here, either before  {%- for path in page_paths -%} 
or after the {%- endfor -%}
-->
            <a class="page-link" href="{{ my_page.url | relative_url }}">{{ my_page.title | escape }}</a>
            {%- endif -%}
          {%- endfor -%}

          <a class="page-link" href="http://yourmain.github.io">MY MAIN GITHUB.IO SITE</a>

        </div>
      </nav>
    {%- endif -%}
  </div>
</header>

does that help you?

1 Like

Yes this worked! I was changing some other link in here! Thanks :slight_smile: