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

Group Pictures calculation #929

Merged
merged 1 commit into from
Jul 3, 2019

Conversation

guopengd
Copy link
Contributor

@guopengd guopengd commented Jun 25, 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 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?

picture not loading properly

Issue resolved: N/A

What is the new behavior?

picture loaded correctly

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

How to use?

In NexT _config.yml:
none

Does this PR introduce a breaking change?

  • Yes.
  • No.

@welcome
Copy link

welcome bot commented Jun 25, 2019

Thanks so much for opening your first PR here!

@CLAassistant
Copy link

CLAassistant commented Jun 25, 2019

CLA assistant check
All committers have signed the CLA.

@guopengd guopengd changed the title Fix image line number calculation error, the picture can not be fully loaded {"must_include":{"regex":"change|feat|imp|fix|doc|i18n"}}{"no_empty":{"enabled":true}}Fix image line number calculation error, the picture can not be fully loaded Jun 25, 2019
@guopengd guopengd changed the title {"must_include":{"regex":"change|feat|imp|fix|doc|i18n"}}{"no_empty":{"enabled":true}}Fix image line number calculation error, the picture can not be fully loaded Fix image line number calculation error, the picture can not be fully loaded Jun 25, 2019
@guopengd guopengd closed this Jun 25, 2019
@guopengd guopengd reopened this Jun 25, 2019
@1v9
Copy link
Member

1v9 commented Jun 25, 2019

Any demo?

@guopengd
Copy link
Contributor Author

guopengd commented Jun 25, 2019 via email

@guopengd
Copy link
Contributor Author

guopengd commented Jun 25, 2019 via email

@guopengd
Copy link
Contributor Author

This is my code.

{% gp Defaults Layout %}
![](https://images2.alphacoders.com/747/thumb-1920-747093.jpg)
![](https://images2.alphacoders.com/747/thumb-1920-747093.jpg)
![](https://images2.alphacoders.com/747/thumb-1920-747093.jpg)
![](https://images2.alphacoders.com/747/thumb-1920-747093.jpg)
![](https://images2.alphacoders.com/747/thumb-1920-747093.jpg)
![](https://images2.alphacoders.com/747/thumb-1920-747093.jpg)
![](https://images2.alphacoders.com/747/thumb-1920-747093.jpg)
![](https://images2.alphacoders.com/747/thumb-1920-747093.jpg)
![](https://images2.alphacoders.com/747/thumb-1920-747093.jpg)
![](https://images2.alphacoders.com/747/thumb-1920-747093.jpg)
![](https://images2.alphacoders.com/747/thumb-1920-747093.jpg)
![](https://images2.alphacoders.com/747/thumb-1920-747093.jpg)
![](https://images2.alphacoders.com/747/thumb-1920-747093.jpg)
![](https://images2.alphacoders.com/747/thumb-1920-747093.jpg)
![](https://images2.alphacoders.com/747/thumb-1920-747093.jpg)
{% endgp %}

@1v9
Copy link
Member

1v9 commented Jun 25, 2019

I have a question, why your GP normal...

@guopengd
Copy link
Contributor Author

guopengd commented Jun 25, 2019 via email

@1v9
Copy link
Member

1v9 commented Jun 25, 2019

@guopengd It seems that you have some personal modifications.

@guopengd
Copy link
Contributor Author

guopengd commented Jun 25, 2019 via email

@guopengd
Copy link
Contributor Author

@1v9
哦,对了,因为group-pictures.style里面我看到两行代码,他禁止了浮动,我就把它删了。fancybox插件是为了增加图片查看的效果,我英语不好,不懂你问的什么意思。如果你是问排版为什么对,那是因为我删除了两行代码。如果是为什么我能放大图片,则是因为fancybox插件。这么长,我翻译不来

.page-post-detail .post-body .group-picture-column {
  // float: nowne;
  margin-top: 10px;
  // width: auto !important;
  img { margin: 0 auto; }
}

@guopengd
Copy link
Contributor Author

guopengd commented Jun 25, 2019

@1v9

”photos“ setting:

---
layout: post
---

“group-pictures.styl' setting:

.page-post-detail .post-body .group-picture-column {
  // float: none;
  margin-top: 10px;
 // width: auto !important;
  img { margin: 0 auto; }
}

well,That can work normal.

@1v9
Copy link
Member

1v9 commented Jun 25, 2019

@guopengd 对的 我是问排版,这个之前有过讨论了,不过我们团队好像都忘了 😂

@guopengd
Copy link
Contributor Author

guopengd commented Jun 25, 2019

@1v9 哈哈,能中文交流就好,我英语太差了,四级都没过。其实就是你们在GP的css上设置了禁止float,我当时看也不知道用意在哪,就删了。然后在加载图片的时候,你们还加载了这个css,这波操作很迷

@theme-next theme-next deleted a comment from guopengd Jun 25, 2019
@guopengd
Copy link
Contributor Author

@1v9 不能发地址,我把设置的代码发一下吧

---
title: 图库
date: 2019-06-02 12:49:19
layout: post
type: photos
---
{% gp Defaults Layout %}
![](https://images2.alphacoders.com/747/thumb-1920-747093.jpg)
![](https://images2.alphacoders.com/747/thumb-1920-747093.jpg)
![](https://images2.alphacoders.com/747/thumb-1920-747093.jpg)
![](https://images2.alphacoders.com/747/thumb-1920-747093.jpg)
![](https://images2.alphacoders.com/747/thumb-1920-747093.jpg)
![](https://images2.alphacoders.com/747/thumb-1920-747093.jpg)
![](https://images2.alphacoders.com/747/thumb-1920-747093.jpg)
![](https://images2.alphacoders.com/747/thumb-1920-747093.jpg)
![](https://images2.alphacoders.com/747/thumb-1920-747093.jpg)
![](https://images2.alphacoders.com/747/thumb-1920-747093.jpg)
![](https://images2.alphacoders.com/747/thumb-1920-747093.jpg)
![](https://images2.alphacoders.com/747/thumb-1920-747093.jpg)
![](https://images2.alphacoders.com/747/thumb-1920-747093.jpg)
![](https://images2.alphacoders.com/747/thumb-1920-747093.jpg)
![](https://images2.alphacoders.com/747/thumb-1920-747093.jpg)
{% endgp %}
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=330 height=86 src="//music.163.com/outchain/player?type=2&id=1368521705&auto=1&height=66"></iframe>

然后在“source/css/_common/components/tags/group-pictures.styl”的代码改为:

.post .post-body .group-picture {
  img {
    box-sizing: border-box;
    padding: 0 3px;
    border: none;
  }
}

.post .group-picture-row {
  overflow: hidden;
  margin-top: 6px;
  &:first-child { margin-top: 0; }
}

.post .group-picture-column { float: left; }

.page-post-detail .post-body .group-picture-column {
  // float: nowne;
  margin-top: 10px;
  // width: auto !important;
  img { margin: 0 auto; }
}

.page-archive {
  .group-picture-container { overflow: hidden; }
  .group-picture-row {
    float: left;
    &:first-child { margin-top: 6px; }
  }

  .group-picture-column {
    max-width: 150px;
    max-height: 150px;
  }
}

这样设置之后,布局就能正常显示了

@1v9 1v9 mentioned this pull request Jun 25, 2019
@stevenjoezhang stevenjoezhang added this to the v7.3.0 milestone Jul 3, 2019
@stevenjoezhang stevenjoezhang merged commit 1f625a0 into theme-next:master Jul 3, 2019
@welcome
Copy link

welcome bot commented Jul 3, 2019

Congrats on merging your first pull request here! 🎉 How awesome!

@1v9 1v9 changed the title Fix image line number calculation error, the picture can not be fully loaded Group Pictures calculation Jul 4, 2019
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.

4 participants