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 building time #1986

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add building time #1986

wants to merge 2 commits into from

Conversation

HelloWuJiaYi
Copy link

@HelloWuJiaYi HelloWuJiaYi commented Nov 7, 2017

增加了一个小小的功能,在页面的底部显示博客站点的建立时间。
只需按格式更改主题配置文件的 Building_time 。

Add site creation time at the bottom of the page.
Modify the topic configuration file"Building_time".
Time keeps accumulating.

time

Add site creation time at the bottom of the page.
Modify the topic configuration file "Building_time".
Time keeps accumulating.
@HelloWuJiaYi
Copy link
Author

Watch the effect my blog

@ivan-nginx
Copy link
Collaborator

Need to:

  1. Add localization.
  2. Add switch condition option.
  3. Move this code from footer to separate file.

@HelloWuJiaYi
Copy link
Author

Hello, I've moved the code from the footer to a separate file, but I'm not sure what it means to add localization?

This is the first time I submitted the code, not very clear about the process. Thanks very much。

@ivan-nginx
Copy link
Collaborator

ivan-nginx commented Nov 24, 2017

@HelloWuJiaYi your code provide only Chinese and English language. NexT support multilanguage select, this mean if user chose Russian language, he will see Chinese letters with your plugin enabled. Need to add support for all languages, not only for Chinese.

In your code:

{% if config.language == "zh-Hans" %}  {{ "建立时间 : " }}
{% else %} {{ "Building Time : " }}

And if config Ru language? If De? If any other ≈10 languages? Need to add support for all languages, dynamic support. Something like:

-{% if config.language == "zh-Hans" %}  {{ "建立时间 : " }}
-{% else %} {{ "Building Time : " }}
+{{ "{{ __('post.building_time') }}" }}

And in languages/default.yml:

post:
  building_time: Building Time

And in other languages other translates.
For more information u can see layout/_macro/post.swig file for examples multilanguage support.

@HelloWuJiaYi
Copy link
Author

Well, thank you very much. I'll change the code.

@ivan-nginx
Copy link
Collaborator

This NexT version not supported anymore (at least by me). For now it rebased under theme-next organization and have this path. So, u can do pull there.

More information in #2061 issue.

@ivan-nginx ivan-nginx added the v6.x label Jan 3, 2018
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.

None yet

2 participants