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

Fancybox for group-picture and post-gallery #667

Merged
merged 4 commits into from
Mar 9, 2019
Merged

Fancybox for group-picture and post-gallery #667

merged 4 commits into from
Mar 9, 2019

Conversation

stevenjoezhang
Copy link
Contributor

@stevenjoezhang stevenjoezhang commented Mar 9, 2019

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines.
  • Tests for the changes was maked (for bug fixes / features).
    • Muse | Mist have been tested.
    • Pisces | Gemini have been tested.
  • Docs in NexT website have been added / updated (for new features).

PR Type

What kind of change does this PR introduce?

  • Bugfix.
  • Feature.
  • Code style update (formatting, local variables).
  • Refactoring (no functional changes, no api changes).
  • Build related changes.
  • CI related changes.
  • Documentation content changes.
  • Other... Please describe:

What is the current behavior?

Issue resolved: #296
See: iissnan/hexo-theme-next@6077877

What is the new behavior?

  • Screenshots with this changes: N/A
  • Link to demo site with this changes: N/A

How to use?

In NexT _config.yml:

...

Does this PR introduce a breaking change?

  • Yes.
  • No.

@1v9
Copy link
Member

1v9 commented Mar 9, 2019

screenshot? never use this feature...😂

@stevenjoezhang
Copy link
Contributor Author

@1v9 See: #296

@1v9
Copy link
Member

1v9 commented Mar 9, 2019

@stevenjoezhang I tested group pictures, it's fancybox now, good job.

@stevenjoezhang
Copy link
Contributor Author

You can also try this:

---
title: title
date: 2019-03-09 17:52:00
photos:
  - https://marketplace-images.githubusercontent.com/2388/1c118380-1ff1-11e9-89b2-1402fd4f7f2d
  - https://marketplace-images.githubusercontent.com/2388/1c118380-1ff1-11e9-89b2-1402fd4f7f2d
  - https://marketplace-images.githubusercontent.com/2388/1c118380-1ff1-11e9-89b2-1402fd4f7f2d
  - https://marketplace-images.githubusercontent.com/2388/1c118380-1ff1-11e9-89b2-1402fd4f7f2d
  - https://marketplace-images.githubusercontent.com/2388/1c118380-1ff1-11e9-89b2-1402fd4f7f2d
---

{% gp 5-2 %}
![](https://marketplace-images.githubusercontent.com/2388/1c118380-1ff1-11e9-89b2-1402fd4f7f2d)
![](https://marketplace-images.githubusercontent.com/2388/1c118380-1ff1-11e9-89b2-1402fd4f7f2d)
![](https://marketplace-images.githubusercontent.com/2388/1c118380-1ff1-11e9-89b2-1402fd4f7f2d)
![](https://marketplace-images.githubusercontent.com/2388/1c118380-1ff1-11e9-89b2-1402fd4f7f2d)
![](https://marketplace-images.githubusercontent.com/2388/1c118380-1ff1-11e9-89b2-1402fd4f7f2d)
{% endgp %}

Copy link
Member

@ivan-nginx ivan-nginx left a comment

Choose a reason for hiding this comment

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

GJ!

@@ -271,11 +271,7 @@
{% set COLUMN_NUMBER = 3 %}
{% for photo in post.photos %}
{% if loop.index0 % COLUMN_NUMBER === 0 %}<div class="post-gallery-row">{% endif %}
<a class="post-gallery-img fancybox"
href="{{ url_for(photo) }}" rel="gallery_{{ post._id }}"
itemscope itemtype="http://schema.org/ImageObject" itemprop="url">
Copy link
Member

Choose a reason for hiding this comment

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

But why u remove http://schema.org/ImageObject here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This attribute belongs to the <a> tag which causes the bug, and that's why I removed it. I'll try to add it back, and test if fancybox still works fine.

@stevenjoezhang
Copy link
Contributor Author

I make some other big changes to fit both fancybox 2 and 3, you can check again

@theme-next theme-next deleted a comment Mar 9, 2019
@theme-next theme-next deleted a comment Mar 9, 2019
@stevenjoezhang
Copy link
Contributor Author

@maple3142 What happened?

@1v9
Copy link
Member

1v9 commented Mar 9, 2019

@stevenjoezhang answer is here 😂

@stevenjoezhang
Copy link
Contributor Author

@1v9 Is it a mistake?

@1v9
Copy link
Member

1v9 commented Mar 9, 2019

@stevenjoezhang yeah i think so. merge upstream -> push to NexT?

@stevenjoezhang
Copy link
Contributor Author

Done

@maple3142
Copy link
Contributor

Sorry, I clone NexT theme from this repo to my site.
And I accidentally pushed it(theme-next/hexo-theme-next) instead of main repo(Blog) after I update it from upstream.

@stevenjoezhang stevenjoezhang added this to the v7.1.0 milestone Mar 9, 2019
@stevenjoezhang stevenjoezhang merged commit 48b1b60 into theme-next:master Mar 9, 2019
@stevenjoezhang stevenjoezhang deleted the fancybox branch March 9, 2019 16:12
@stevenjoezhang stevenjoezhang mentioned this pull request Mar 9, 2019
11 tasks
@1v9
Copy link
Member

1v9 commented Mar 9, 2019

@stevenjoezhang 👍
@maple3142 so dangerous😂

Copy link
Member

@ivan-nginx ivan-nginx left a comment

Choose a reason for hiding this comment

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

Check images on https://validator.w3.org ?

itemscope itemtype="http://schema.org/ImageObject" itemprop="url">
<img src="{{ url_for(photo) }}" itemprop="contentUrl"/>
</a>
<img src="{{ url_for(photo) }}" itemprop="contentUrl"/>
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we must add itemscope itemtype="http://schema.org/ImageObject" here, before itemprop="contentUrl"? It's for schema.

$imageWrapLink.addClass('fancybox fancybox.image');
$imageWrapLink.attr('rel', 'group');
var imageLink = $image.attr('data-original') || $image.attr('src');
$imageWrapLink = $image.wrap('<a class="fancybox fancybox.image" href="' + imageLink + '" itemscope itemtype="http://schema.org/ImageObject" itemprop="url"></a>').parent('a');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ivan-nginx Maybe the answer is no? See here.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, ok ok. So long line there...

tongluyang pushed a commit to tongluyang/hexo-theme-next that referenced this pull request Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem with fancybox
4 participants