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

Add postCopyright into the default injects point #979

Closed
wants to merge 5 commits into from
Closed

Add postCopyright into the default injects point #979

wants to merge 5 commits into from

Conversation

bytemain
Copy link

@bytemain bytemain commented Jul 17, 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?

The default copyright style.

Issue resolved: N/A

What is the new behavior?

you can create the copyright you like.

How to use?

In NexT _config.yml:

#postCopyright: source/_data/post-copyright.swig

uncomment the line, and insert your own file.

Does this PR introduce a breaking change?

  • Yes.
  • No.

@auto-assign auto-assign bot requested a review from ivan-nginx July 17, 2019 08:02
@welcome
Copy link

welcome bot commented Jul 17, 2019

Thanks so much for opening your first PR here!

@CLAassistant
Copy link

CLAassistant commented Jul 17, 2019

CLA assistant check
All committers have signed the CLA.

@1v9
Copy link
Member

1v9 commented Jul 17, 2019

Cool, could you share your custom swig? We can add it to Awesome-NexT.

layout/_macro/post.swig Outdated Show resolved Hide resolved
@jiangtj
Copy link
Member

jiangtj commented Jul 17, 2019

image
What is the difference between pointBodyEnd and postCopyright?
Maybe you can try adding postCopyright to pointBodyEnd.

@bytemain
Copy link
Author

image
What is the difference between pointBodyEnd and postCopyright?
Maybe you can try adding postCopyright to pointBodyEnd.

their position are different, so I think it's better to add a new config.

@bytemain
Copy link
Author

image
What is the difference between pointBodyEnd and postCopyright?
Maybe you can try adding postCopyright to pointBodyEnd.

and I think BodyEnd custom file is different from postCopyright custom file.
the BodyEnd behavior:
image

@jiangtj
Copy link
Member

jiangtj commented Jul 17, 2019

their position are different, so I think it's better to add a new config.

If the wechat_subscriber and the reward are added through postBodyEnd, the two injection points overlap, so modify the implementation of the wechat_subscriber and the reward can be better, do you think?

@bytemain
Copy link
Author

Cool, could you share your custom swig? We can add it to Awesome-NexT.

I will share it later. Thanks for you appreciation! 😆

@bytemain
Copy link
Author

their position are different, so I think it's better to add a new config.

If the wechat_subscriber and the reward are added through postBodyEnd, the two injection points overlap, so modify the implementation of the wechat_subscriber and the reward can be better, don't you think?

in my mind, I'd like to divide it into two files, because I have used postBodyEnd file to implement another func.
我觉得分成两个比较舒服... 因为我拿 postBodyEnd 当成了正文结束的提示。
如果不分我也是可以接受的,毕竟确实离得近了,调整下顺序的问题。

@jiangtj
Copy link
Member

jiangtj commented Jul 17, 2019

in my mind, I'd like to divide it into two files, because I have used postBodyEnd file to implement another func.

image
你可以试试通过优先级确认前后位置。
You can try to confirm the position before and after by priority. default is 10.

@jiangtj
Copy link
Member

jiangtj commented Jul 17, 2019

And the same injection point supports injecting multiple layouts, not just one. Just make sure the name of the injection is different.

@1v9 1v9 added this to the v7.3.0 milestone Jul 17, 2019
@bytemain
Copy link
Author

bytemain commented Jul 17, 2019

我原来是直接改 copyright 来实现的,今天发现了可以自定义注入,于是加了这一块。
主要是因为我是用 CI 来生成博客的,所以更新 next 得我手动同步合并最新的 next 主题代码然后推到我自己的仓库, CI 从我的仓库拉取 Next 主题的代码。。。

现在这么改确实有点不太 elegant,不太 next....

@stevenjoezhang
Copy link
Contributor

@bytemain
Copy link
Author

bytemain commented Jul 17, 2019

iissnan/hexo-theme-next#1667

我是从这hexo-theme-yelee 抄来的~

作者demo: http://moxfive.xyz/2016/06/14/duoshuo-disqus-comment-count/#footer

@bytemain
Copy link
Author

bytemain commented Jul 17, 2019

Cool, could you share your custom swig? We can add it to Awesome-NexT.

https://gist.github.com/lengthmin/e5250848c6b2437a392d9d1411a0fbd6

Gist
post-copyright. GitHub Gist: instantly share code, notes, and snippets.

@jiangtj
Copy link
Member

jiangtj commented Jul 17, 2019

Anyway, thanks for your time. And pointBodyEnd and postCopyright are similar, I refactor in #980. (本来想过段时间再弄得QwQ,I thought about it for a while QwQ.)

@jiangtj jiangtj closed this Jul 17, 2019
@bytemain
Copy link
Author

Thanks to @jiangtj , This PR isn't elegant,
see #980 (comment)

@jiangtj
Copy link
Member

jiangtj commented Jul 17, 2019

Looking forward to your PR In Awesome NexT,for better post-copyright next plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants