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

Author object tags showing at top of page #289

Closed
padraic7a opened this issue Apr 27, 2016 · 23 comments
Closed

Author object tags showing at top of page #289

padraic7a opened this issue Apr 27, 2016 · 23 comments

Comments

@padraic7a
Copy link

I know this must mean I've done something silly but I can't see what it is.

When I build the site it displays as follows:
selection_004

Any hints as to what I've done?

@mmistakes
Copy link
Owner

Not exactly sure but all those variables are author ones in _config.yml. Maybe you have some improperly formatted YAML there.

@padraic7a
Copy link
Author

That must be it. Thanks for your time and the theme.

@padraic7a padraic7a reopened this Apr 27, 2016
@mmistakes
Copy link
Owner

mmistakes commented Apr 27, 2016

I think you found a bug.
In _config.yml. Quick fix is to add a Twitter account under author

author:
  twitter: "padraicst"

There's a conditional in the <head> that I need to improve. It's getting confused by the fact that you set site twitter.username but not author.twitter as well.

@mmistakes mmistakes added this to the 3.1.3 milestone Apr 27, 2016
@mmistakes mmistakes self-assigned this Apr 27, 2016
@mmistakes
Copy link
Owner

Bug fix, change *_includes/seo.html line 28

{% assign seo_author = page.author | default: page.author[0] | default: site.author[0] %}

@padraic7a
Copy link
Author

Ah, I was just drafting a response saying that it only triggers with a twitter username. I thought it might be because I put some extra gems in the gemfile.

Thanks again for your help!

mmistakes added a commit that referenced this issue Apr 27, 2016
- If `twitter.username` is set and `author.twitter` is nil bad things happen.
- Close #289
sobkowiak pushed a commit to sobkowiak/sobkowiak.github.io-new that referenced this issue Apr 29, 2016
- If `twitter.username` is set and `author.twitter` is nil bad things happen.
- Close mmistakes#289
sobkowiak pushed a commit to sobkowiak/sobkowiak.github.io-new that referenced this issue Apr 29, 2016
- If `twitter.username` is set and `author.twitter` is nil bad things happen.
- Close mmistakes#289
sobkowiak pushed a commit to sobkowiak/sobkowiak.github.io-new that referenced this issue Apr 29, 2016
- If `twitter.username` is set and `author.twitter` is nil bad things happen.
- Close mmistakes#289
cjmadsen pushed a commit to cjmadsen/cjmadsen.github.io that referenced this issue Dec 7, 2016
jluccisano added a commit to jluccisano/jluccisano.github.io that referenced this issue May 6, 2017
- If `twitter.username` is set and `author.twitter` is nil bad things happen.
- Close mmistakes#289
@viktorsmari
Copy link

viktorsmari commented Jan 8, 2018

I have a related bug. I was using the Jekyll Wordpress importer tool and it creates the front matter yaml:

author:
  display_name: Someone
  login: someone
  email: someone@gmail.com
  url: ''

As a result I get this:

a

I traced the error to this line:
https://github.com/mmistakes/minimal-mistakes/blob/master/_includes/seo.html#L42

Any ideas?

I am using this theme as a remote_theme in the _config.yml

@mmistakes
Copy link
Owner

@viktorsmari The theme expects author to be a string not an array, that's why it's outputted that garbage at the top of your posts.

This is the way the theme expects post author's to be specified.

@viktorsmari
Copy link

Thank you.

Because I was migrating a Wordpress site with hundreds of posts with the same front matter format, where the author is an array. Do I need to change each post or is there a simpler way?
I am trying not to mess with the theme defaults.

@mmistakes
Copy link
Owner

@viktorsmari I don't think there is an easy way forward. I'll take a look at the templates and see if there is something I can adjust. jekyll/feed and jekyll/jekyll-seo-tag both use author in a similar way as this theme. I'll take a look and see what their solution is to accept author as a string or object.

@mmistakes mmistakes reopened this Jan 8, 2018
@mmistakes mmistakes changed the title Meta tags showing at top of page Author object tags showing at top of page Jan 8, 2018
mmistakes added a commit that referenced this issue Jan 8, 2018
@mmistakes
Copy link
Owner

mmistakes commented Jan 8, 2018

@viktorsmari I pushed some updates. Try changing remote_theme to the fix branch and see if that takes care of the issue.

remote_theme: "mmistakes/minimal-mistakes@seo-fixes"

@viktorsmari
Copy link

viktorsmari commented Jan 8, 2018

Hmm does not seem to work, if you want to try it yourself it is an open source project:

https://github.com/piratar/piratar-jekyll

Remember to remove the _includes/seo.html, or uncomment line ~42.

I start the project with the ./server.sh

@mmistakes
Copy link
Owner

mmistakes commented Jan 8, 2018

@viktorsmari Quick look you didn't update remote_theme in your _config.yml. You need to use the line above so it pulls from the git branch with the fix. Otherwise it'll continue to use the current version on master.

remote_theme: "mmistakes/minimal-mistakes@seo-fixes"

@viktorsmari
Copy link

I tried that locally, which did not work. I just did not push this change to Github.

@mmistakes
Copy link
Owner

mmistakes commented Jan 8, 2018

@viktorsmari Hmmm. Define not working. I'm not seeing the author object array text on any of your pages like before.

image

@viktorsmari
Copy link

If you scroll at the bottom of the frontpage, there are many pages you can try.

Like the last one "Styrkja Pirata", does that one work?

Did you also undo/uncomment the SEO I wrote above?

@mmistakes
Copy link
Owner

@viktorsmari Yup. I removed your local version of _includes/seo.html so it doesn't override the fixed one in the theme.

All the pages, including that last one work as expected. No erroneous text printing on the pages from author.

image

@viktorsmari
Copy link

Weird, this is my setup:
2018-01-08_441x93
2018-01-08_677x98

@mmistakes
Copy link
Owner

@padraic7a And you deleted your copy of _includes/seo.html?

@viktorsmari
Copy link

Haha, that was it!

Thank you for your patience!

@mmistakes
Copy link
Owner

@viktorsmari OK good.

FYI - When I merge in this change you'll want to remove @seo-fixes from the remote theme line. It can pull from master at that point since that SEO branch will eventually be deleted.

@padraic7a
Copy link
Author

Hi @mmistakes , I haven't updated or even looked at the site since April 2016. I'll check this thread out when I get to update again.

Do you need me to close this issue?

@mmistakes
Copy link
Owner

Nah don't worry about it @padraic7a, I reopened it today to deal with a sort of related issue.

It'll close automatically when I merge in the fix 176261c

A lot has changed with the theme since then, if/when you get around to updating give the docs a look. It's much easier to install/upgrade the theme once you migrate.

@padraic7a
Copy link
Author

padraic7a commented Jan 8, 2018 via email

kkunapuli pushed a commit to kkunapuli/kkunapuli.github.io that referenced this issue May 30, 2019
* Fix canonical URL
* Fix next/previous page paths
* Group meta types together
* Fix twitter:creator conditional
* Allow `author` to accept an object or string
* Reduce white-space
* Add "website" as default `og:type`
* Add `article:modified_time`
* Show `article:modified_time` on `article` only

Fixes mmistakes#289
sumeetmondal pushed a commit to sumeetmondal/sumeetmondal.github.io that referenced this issue Sep 10, 2019
* Fix canonical URL
* Fix next/previous page paths
* Group meta types together
* Fix twitter:creator conditional
* Allow `author` to accept an object or string
* Reduce white-space
* Add "website" as default `og:type`
* Add `article:modified_time`
* Show `article:modified_time` on `article` only

Fixes mmistakes#289
makaroniame added a commit to makaroniame/makaroniame-old.github.io that referenced this issue May 18, 2022
- If `twitter.username` is set and `author.twitter` is nil bad things happen.
- Close mmistakes#289
jchwenger pushed a commit to jchwenger/jchwenger.github.io that referenced this issue May 5, 2023
* Fix canonical URL
* Fix next/previous page paths
* Group meta types together
* Fix twitter:creator conditional
* Allow `author` to accept an object or string
* Reduce white-space
* Add "website" as default `og:type`
* Add `article:modified_time`
* Show `article:modified_time` on `article` only

Fixes mmistakes#289
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