Search code examples
githubjekyllgithub-pagesgithub-flavored-markdownpage-title

Remove "by [username]" in a GitHub Pages document.title


I have a GitHub Pages site, and I don't want to use the raw html to develop the site yet because non developers on the team will be pushing.

The problem is that the document.title contains "by [username]" at the end. I want to remove that and just make it be the beginning text.

I already tried title: [custom title] in Jekyll and it still has the organization name at the end.

I am using the Midnight theme.

Thanks!


Solution

  • As based in comments, you are using the jekyll-midnight-theme, copy the default layout file of the jekyll-theme-midnight repo into _layouts directory in your Jekyll website.

    1. Create the /_layouts directory
    2. Copy https://github.com/pages-themes/midnight/blob/master/_layouts/default.html into /_layouts

    Now edit /_layouts/default.html and adjust the <title> HTML tag, in this case removing the "by " part, so this:

     <title>{{ site.title | default: site.github.repository_name }} by {{ site.github.owner_name }}</title>
    

    replace it with:

      <title>{{ site.title | default: site.github.repository_name }}</title>
    

    Now your website won't include the "by [organization name]" at the end.