Giter Site home page Giter Site logo

Comments (8)

ppoffice avatar ppoffice commented on May 20, 2024

@wanzixin You can try to copy your article to the target language directory. For instance, just copy everything from source/_posts/*.md to source/_posts/zh-CN/.

from hexo-theme-minos.

wanzixin avatar wanzixin commented on May 20, 2024

@ppoffice I did what you said, but I didn't succeed. What else should I pay attention to? This picture is my directory structure.

image

from hexo-theme-minos.

ppoffice avatar ppoffice commented on May 20, 2024

Create a test.md under both _posts and _posts/zh-CN and see if it works for that post. @wanzixin

from hexo-theme-minos.

wanzixin avatar wanzixin commented on May 20, 2024

@ppoffice I create a test.md in _post, then copy it to _posts/zh-cn. When I switch to simplified Chinese, the browser displays Cannot GET /zh-cn/Diary/test/. But I do have a test.md in _post/zh-cn.

from hexo-theme-minos.

ppoffice avatar ppoffice commented on May 20, 2024

@wanzixin Try to change your permalink to :slug/:

https://github.com/ppoffice/hexo-theme-minos/blob/site/_config.yml#L19

from hexo-theme-minos.

wanzixin avatar wanzixin commented on May 20, 2024

@ppoffice I change it as you said, but still get a mistake. After using the commands hexo c, hexo g and hexo s, I opened localhost:4000 and switched to simplified Chinese and got the following prompt on the console.

INFO  Start processing
INFO  Hexo is running at http://localhost:4000 . Press Ctrl+C to stop.
Unhandled rejection Error: /Users/wanzixin/study/MyBlog/themes/minos/layout/post.ejs:3
    1| <section class="section">
    2|     <div class="container">
 >> 3|     <%- partial('common/article', { post: page, index: false }) %>
    4|     </div>
    5| </section>

/Users/wanzixin/study/MyBlog/themes/minos/layout/common/article.ejs:11
    9|     <div class="article-meta columns is-variable is-1 is-multiline is-mobile is-size-7-mobile">
    10|         <span class="column is-narrow">
 >> 11|             <% if (has_config('article.date_format') && get_config('article.date_format') === 'relative' ) { %>
    12|                 <time datetime="<%= date_xml(post.date) %>" itemprop="datePublished"><%= format_date_full(post.date) %></time>
    13|             <% } else if (has_config('article.date_format') && get_config('article.date_format') === 'full' ) { %>
    14|                 <span><%= format_date_full(post.date) %></span>

Function yaml.safeLoad is removed in js-yaml 4. Use yaml.load instead, which is now safe by default.
    at Object.safeLoad (/Users/wanzixin/study/MyBlog/node_modules/js-yaml/index.js:10:11)
    at getThemeConfig (/Users/wanzixin/study/MyBlog/themes/minos/scripts/99_config.js:33:37)
    at Object.<anonymous> (/Users/wanzixin/study/MyBlog/themes/minos/scripts/99_config.js:49:9)
    at eval (/Users/wanzixin/study/MyBlog/themes/minos/layout/common/article.ejs:29:12)
    at article (/Users/wanzixin/study/MyBlog/node_modules/ejs/lib/ejs.js:682:17)
    at _View._compiledSync (/Users/wanzixin/study/MyBlog/node_modules/hexo/lib/theme/view.js:132:24)
    at _View.renderSync (/Users/wanzixin/study/MyBlog/node_modules/hexo/lib/theme/view.js:59:25)
    at Object.partial (/Users/wanzixin/study/MyBlog/node_modules/hexo/lib/plugins/helper/partial.js:34:15)
    at eval (/Users/wanzixin/study/MyBlog/themes/minos/layout/post.ejs:12:17)
    at post (/Users/wanzixin/study/MyBlog/node_modules/ejs/lib/ejs.js:682:17)
    at _View._compiled (/Users/wanzixin/study/MyBlog/node_modules/hexo/lib/theme/view.js:136:50)
    at _View.render (/Users/wanzixin/study/MyBlog/node_modules/hexo/lib/theme/view.js:39:17)
    at /Users/wanzixin/study/MyBlog/node_modules/hexo/lib/hexo/index.js:64:21
    at tryCatcher (/Users/wanzixin/study/MyBlog/node_modules/bluebird/js/release/util.js:16:23)
    at /Users/wanzixin/study/MyBlog/node_modules/bluebird/js/release/method.js:15:34
    at RouteStream._read (/Users/wanzixin/study/MyBlog/node_modules/hexo/lib/hexo/router.js:47:5)
    at RouteStream.Readable.read (internal/streams/readable.js:481:10)
    at resume_ (internal/streams/readable.js:977:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)

In addition, when I use hexo g, I get such a error, and there are many such errors like this:

ERROR Error: /Users/wanzixin/study/MyBlog/themes/minos/layout/layout.ejs:4
    2| <html class="has-navbar-fixed-top">
    3| <head>
 >> 4|     <%- partial('common/head') %>
    5| </head>
    6| <body>
    7|     <%- partial('common/navbar', { page }) %>

/Users/wanzixin/study/MyBlog/themes/minos/layout/common/head.ejs:2
    1| <meta charset="utf-8">
 >> 2| <title><%= page_title() %></title>
    3| <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    4| 
    5| <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/outdated-browser/1.1.5/outdatedbrowser.min.css">

Function yaml.safeLoad is removed in js-yaml 4. Use yaml.load instead, which is now safe by default.
    at Object.safeLoad (/Users/wanzixin/study/MyBlog/node_modules/js-yaml/index.js:10:11)
    at getThemeConfig (/Users/wanzixin/study/MyBlog/themes/minos/scripts/99_config.js:33:37)
    at Object.<anonymous> (/Users/wanzixin/study/MyBlog/themes/minos/scripts/99_config.js:56:9)
    at Object.<anonymous> (/Users/wanzixin/study/MyBlog/themes/minos/scripts/99_content.js:78:20)
    at eval (/Users/wanzixin/study/MyBlog/themes/minos/layout/common/head.ejs:12:26)
    at head (/Users/wanzixin/study/MyBlog/node_modules/ejs/lib/ejs.js:682:17)
    at _View._compiledSync (/Users/wanzixin/study/MyBlog/node_modules/hexo/lib/theme/view.js:132:24)
    at _View.renderSync (/Users/wanzixin/study/MyBlog/node_modules/hexo/lib/theme/view.js:59:25)
    at Object.partial (/Users/wanzixin/study/MyBlog/node_modules/hexo/lib/plugins/helper/partial.js:34:15)
    at eval (/Users/wanzixin/study/MyBlog/themes/minos/layout/layout.ejs:12:17)
    at layout (/Users/wanzixin/study/MyBlog/node_modules/ejs/lib/ejs.js:682:17)
    at _View._compiled (/Users/wanzixin/study/MyBlog/node_modules/hexo/lib/theme/view.js:136:50)
    at _View.render (/Users/wanzixin/study/MyBlog/node_modules/hexo/lib/theme/view.js:39:17)
    at /Users/wanzixin/study/MyBlog/node_modules/hexo/lib/theme/view.js:51:25
    at tryCatcher (/Users/wanzixin/study/MyBlog/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/wanzixin/study/MyBlog/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/Users/wanzixin/study/MyBlog/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/Users/wanzixin/study/MyBlog/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/Users/wanzixin/study/MyBlog/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (/Users/wanzixin/study/MyBlog/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/Users/wanzixin/study/MyBlog/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/Users/wanzixin/study/MyBlog/node_modules/bluebird/js/release/async.js:102:5) {
  path: '/Users/wanzixin/study/MyBlog/themes/minos/layout/layout.ejs'
}

I think there must be something wrong that led to such a mistake, but I can't seem to find it.

from hexo-theme-minos.

wanzixin avatar wanzixin commented on May 20, 2024

@ppoffice I moved .config.zh-cn.yml file from the theme folder to the top folder. Now I can see some effects, but the menu bar still won't change the language. Is there any wrong with my settings?

image

/myblog/themes/minos/.config.yml
menu:
  Archives: /archives
  Categories: /categories
  Diary: /categories/Diary
  Gallery: /categories/Gallery
  Study: /categories/Study
  Item: /categories/Item
  About: /about

/myblog/.config.zh-cn.yml
menu:
  归档: /archives
  分类: /categories
  日记: /categories/Diary
  画廊: /categories/Gallery
  学习: /categories/Study
  项目: /categories/Item
  关于: /about

from hexo-theme-minos.

ppoffice avatar ppoffice commented on May 20, 2024

It's _config.yml and _config.zh-CN.yml.

from hexo-theme-minos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.