Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page title leaking to home index.html #2379

Closed
improvethings opened this issue Jan 21, 2020 · 12 comments
Closed

Page title leaking to home index.html #2379

improvethings opened this issue Jan 21, 2020 · 12 comments

Comments

@improvethings
Copy link

Environment

  • Minimal Mistakes version: Using minimal-mistakes-jekyll 4.17.2
  • Ruby gem or remote theme version: 2.7.6.2
  • Jekyll version: 4.0.0
  • Git repository URL:
  • GitHub Pages hosted (if yes provide URL to site):
  • Operating system: Linux 4.19.0-6-amd64 x86_64

Expected behavior

I expect the main website title to be that in title: in _config.yml.

Instead I'm getting "The three values of entrepreneurship -" in front of the that title: in the <title> html.

Steps to reproduce the behavior

I'm not sure, but in _pages I have a bunch of html files, one of them called first.html with this front matter:


layout: single
title: The three values of entrepreneurship
permalink: "three-values-of-entrepreneurship"

and the issue is "The three values of entrepreneurship" is the prefix HTML <title> on the front page of this website now. That first.html is not referenced anywhere else, it was just a draft page.

copied a pile of *.html draft files into _pages, but they are not referenced in navigation.yml or elsewhere

Other

@mmistakes
Copy link
Owner

Need to see your config and content to troubleshoot. I’m guessing one of your HTML files is the culprit.

Please share a link to a public repo.

@improvethings
Copy link
Author

I don't have it as a public repo, but you should be able to replicate. Create a first.html file in _pages (it doesn't start with the traditional date string like most page files, it was taken from a Wordpress export of draft pages):

It has this frontmatter:

layout: single
title: The three values of entrepreneurship
permalink: "three-values-of-entrepreneurship"

When I deleted the first.html in question, it's now using the <title>: from the third last page by date which is 2020-01-18-tags.md

which has a front matter of

title: "Posts by Tag"
layout: tags
permalink: /tags/
author_profile: true

It's unusual to me it appears to be using a prefix from a _pages/* file on the main index.html which is a list of _posts.

As an aside, thanks for this amazing theme! I was just about to add a search feature manually, and then realized I could just uncomment it in _config.yml -- magical.

@mmistakes
Copy link
Owner

Sorry can’t reproduce it. Any file you have in a _pages folder isn’t a post so it won’t show up any of the post related archive pages e.g. tags, categories, posts by year, etc.

Sounds to me like one of your posts has some goofy YAML or maybe even you have some with the same permalink. Without seeing your actual files I can’t say.

I’ve definitely see weird stuff in content that does stuff like this. And it can be hard to catch if you don’t know what your looking for.

@improvethings
Copy link
Author

I've given you access to the private repository if you'll find it useful to debug for other users. It's not a big issue as it's just the HTML title tag, so this is a low priority bug and more of an FYI.

@mmistakes
Copy link
Owner

There's something screwy for sure. If you delete the _posts and _pages folders and files and build, your homepage still has the "The three values of..." <title> which is absolutely not correct.

Trying to figure out where it's getting that from...

@mmistakes
Copy link
Owner

I can't locate the bad file, but you have one somewhere buried.
To start you can remove a bunch of stuff since you're using the theme gem

  1. Remove the folders and files in _layouts, _includes, _sass
  2. Then remove everything in assets except your images
  3. Move your _posts and _pages folders out of the repo temporarily.
  4. Build. You should see a title of Kris Constable's digital log on the home page

Once that is working start moving your _posts and _pages gradually back until you determine what file is causing the issue. I'm not entirely sure it is even in one of those folders. As I originally removed all your content and it still had the leaky title on the homepage.

Which leads me to believe there's a file with YAML front matter in it, that's buried in another Jekyll folder that get's processed and messes something up on the homepage.

@iBug
Copy link
Collaborator

iBug commented Jan 24, 2020

Hi, I think I may take a look at this. Would you mind sharing necessary information so I can reproduce it?

@mmistakes
Copy link
Owner

Further testing, doesn't appear to be your content, configuration, or the theme.

I'm not sure what plugin is the culprit but it appears to be one of the Jekyll ones. I tried disabling all plugins, but because the theme gem has a few marked as dependencies they get installed anyways.

Now, if I removed the theme gem from Gemfile installed it as a remote theme, the site builds as it should without the leaky <title>. Some plugin is grabbing hold of whatever the most recent post/page is and then jams that into the site title on index.html. This doesn't happen when using the remote theme as you're able to turn off all the plugins.

Now to find out what plugin is the problem.

@mmistakes
Copy link
Owner

Looks like it's a Jekyll 4.0 issue... or a 4.0 issue combined with one the Jekyll plugins like include-cache.
If you downgrade to 3.8.6 the site builds as it should.

Seeing how most users of this theme host on GitHub Pages and that's locked at 3.8 that would explain why the issue has gone unnoticed.

Change your Gemfile to:

source "https://rubygems.org"

gem "jekyll", "~> 3.8.6"
gem "minimal-mistakes-jekyll"
gem "jekyll-redirect-from"

Run bundle update

And you should have no problems building your site.

@mmistakes
Copy link
Owner

Seems related to this issue jekyll/jekyll#7811

@mmistakes mmistakes changed the title inheriting title from random page Page title leaking to home index.html Jan 25, 2020
@mmistakes mmistakes pinned this issue Jan 25, 2020
@improvethings
Copy link
Author

This resolved the issue, thanks for taking the time!

@iBug
Copy link
Collaborator

iBug commented May 12, 2020

@mmistakes Maybe it's time to unpin this issue. Jekyll 4.0.1 is out and the specific cause has been fixed (as you linked, jekyll/jekyll#7811).

@mmistakes mmistakes unpinned this issue May 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants