Skip to content
New issue

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

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

Already on GitHub? # to your account

Allow author data as an object #26

Merged
merged 1 commit into from
Jan 20, 2016
Merged

Allow author data as an object #26

merged 1 commit into from
Jan 20, 2016

Conversation

pathawks
Copy link
Member

Try to mirror behavior of jekyll-feed
#18 #23

{% if page.author.twitter %}
{% assign seo_author_twitter = page.author.twitter | replace:"@","" | prepend:"@" %}
{% else %}
{% assign seo_author_twitter = page.author | replace:"@","" | prepend:"@" %}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. It looks like you're adding the @? I believe the Twitter spec says it shouldn't have an @, but I haven't looked at it in a while.
  2. We can DRY things up a bit by moving the normalization down to the one place it's used.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you're adding the @?

It was there before.

The example at the bottom of this page includes the @

@pathawks
Copy link
Member Author

We can DRY things up a bit by moving the normalization down to the one place it's used.

All of our other variables are normalized before they are used, and I wanted to keep with that convention.

I could do something like this:

{% if page.author.twitter %}
  {% assign seo_author_twitter %}
{% else %}
  {% assign seo_author_twitter %}
{% endif %}
{% if seo_author_twitter %}
  {% assign seo_author_twitter = page.author.twitter | replace:"@","" | prepend:"@" %}
{% endif %}

@benbalter
Copy link
Collaborator

Nice. Sorry for the delay. Also opened #31 to piggy back on this, so that author's metadata can be centralized, rather than in each post.

benbalter added a commit that referenced this pull request Jan 20, 2016
Allow author data as an object
@benbalter benbalter merged commit 9f0b656 into master Jan 20, 2016
@benbalter benbalter deleted the author branch January 20, 2016 00:23
@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants