ppoffice / hexo-theme-minos

A simple and retro styled Hexo theme, concentrated more on your ideas.
http://ppoffice.github.io/hexo-theme-minos
MIT License
765 stars 202 forks source link

Having issue implementing the i18n with Minos #63

Closed hachi1030-Allen closed 6 years ago

hachi1030-Allen commented 6 years ago

Hi there, I actually followed some of the article online.

What I have done is basically created 3 yml files under the theme folder, which are: _config.yml, _config.en.yml, _config.zh-cn.yml.

Below is the config for the _config.yml under the theme folder:

# Website's icon url.
favicon: /favicon.png

# Open Graph metadata (https://hexo.io/docs/helpers.html#open-graph)
open_graph:
  twitter_id:
  twitter_site:
  google_plus:
  fb_admins:
  fb_app_id:

# Website's logo shown on the left of the navigation bar.
# It can either be an url to an image or a string if the following option is set.
# logo:
#   text: <logo string>
logo:

article:
  # Show word count and estimated reading time.
  readtime: true
  # Code highlight theme, please see https://highlightjs.org/static/demo/
  highlight: atom-one-light

# Navigation bar menu links.
menu:
  Archives: /archives
  Categories: /categories
  Tags: /tags
  # Lifestyle: /categories/LifeStyle
  # Music: /categories/Music
  # Technology: /categories/Technology
  About: /about

# Search plugin settings.
search:
  type: insight

# Share plugin settings.
share:
  type: sharethis
  install_url:

# Comment plugin settings.
comment:
  type: disqus
  shortname: liudeyun-net

# Other plugins and their settings.
plugins:
  mathjax: true
  gallery: true
  google-analytics:
    tracking_id:

# Additional navigation bar links on the right.
# Links can either be text or icon. The following link is set to be an icon link whose icon
# is set to the class name of a FontAwesome 5 icon. The `footer_links` below also gives an
# example of setting plain text links.
navbar_links:
  GitHub:
    icon: fab fa-github
    url: https://github.com/

# Links at the bottom of the page.
footer_links:
  GitHub: https://github.com/

I did not write anything in the _config.en.yml because en should be my default page and inherit from the _config.yml file under the theme.

Below is the _config.zh-cn.yml file which for Chinese usage:

# Site
title: 艾伦的博客

# Menu

menu:
  归档: /zh-cn/archives
  分类: /zh-cn/categories
  标签: /zh-cn/tags
  关于: /zh-cn/about

Basically I only changed the menu and title setting.

Below are some brief settings in my _config.yml under the root folder:

# Site
title: Allen's blog
subtitle:
description:
keywords:
author: Allen Liu
language:
  - en
  - zh-cn
timezone:

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: http://yoursite.com
root: /
permalink: :title/
permalink_defaults:

# Directory
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: :lang
skip_render:

# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
titlecase: false # Transform title into titlecase
external_link: true # Open external links in new tab
filename_case: 0
render_drafts: false
post_asset_folder: true
relative_link: false

And then I put the posts under such structure:

_post/
  hello-world.md
  zh-cn/
    hello_world.md
about/
  index.md
zh-cn/
  about/
    index.md

Please notice that I have multiple md files this is just a sample.

One thing to mention here is that I did not create different folders for archives, categories, tags in different language folder because the author of the article did not mention that.

Please let me know where I could be wrong because currently my main page is only showing the English articles when I switch to Chinese version of the Website. And so is Categories link.

However, Tags and About page are working fine.

Please do help me on this issue. And feel free to contact me via Email. I'd love to add someone's chat account to have a live chat, GitHub is not a very good place for troubleshooting.

Please do contact, it's urgent for me.

Thanks,

Allen

hachi1030-Allen commented 6 years ago

BTW, I am from China, so I am able to speak and talk in Chinese if you want.

Thanks.

ppoffice commented 6 years ago

@hachi1030-Allen Could you please show me your blog's source code or at least give me the address to your blog for troubleshooting? Thanks.

hachi1030-Allen commented 6 years ago

@ppoffice

Of course, liudeyun.net is my blog. Shall we contact in personal so that I can share with u the source code?

GitHub is too public.

Thanks!

hachi1030-Allen commented 6 years ago

@ppoffice

I will wait online today. Please feel free to contact me if you are available or free. This issue is really bothering me.

Thanks again.

Allen

hachi1030-Allen commented 6 years ago

@ppoffice

Any update?

I am still waiting.

Thanks,

Allen

ppoffice commented 6 years ago

@hachi1030-Allen I'm seeing that when I switch to the Chinese language, the home page shows Chinese articles only. This is the expected behavior. The tags page also looks fine. However, the categories page shows English articles only. I will look into this.

hachi1030-Allen commented 6 years ago

@ppoffice

Yes, today I added the categories page and tags page, which makes the main page working normally now.

Shall we have a live chat so that it will be faster for us to troubleshoot on this issue?

Which way do you prefer? It's kind of critical for me.

Thanks,

Allen

ppoffice commented 6 years ago

@hachi1030-Allen I'm occupied between 11:00 PM EST to 1:00 PM EST. So I can chat with you outside of that time frame. Please email me your live chat contact information. You can find my email address in the commit history by the git log command.

hachi1030-Allen commented 6 years ago

@ppoffice

I sent you a mail already.

Please check whether you received or not.

Thanks,

Allen

ppoffice commented 6 years ago

for everyone's reference: please remove hexo-generator-i18n plugin as Minos theme have built-in localization processing functions.