Comments (8)
@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.
@ppoffice I did what you said, but I didn't succeed. What else should I pay attention to? This picture is my directory structure.
from hexo-theme-minos.
Create a test.md under both _posts and _posts/zh-CN and see if it works for that post. @wanzixin
from hexo-theme-minos.
@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.
@wanzixin Try to change your permalink
to :slug/
:
https://github.com/ppoffice/hexo-theme-minos/blob/site/_config.yml#L19
from hexo-theme-minos.
@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.
@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?
/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.
It's _config.yml
and _config.zh-CN.yml
.
from hexo-theme-minos.
Related Issues (20)
- Change the font? HOT 2
- '<' and '>' in code blocks will occur an error
- Using Netlify to deploy, Insight Search Chinese garbled. HOT 3
- How to change default renderer HOT 2
- 设置toc为true后,文章导航栏中文显示乱码 HOT 8
- a problem with the table presentation in markdown document HOT 2
- I Can't use Tag Plugin HOT 5
- show info. on every page with google-analytics data HOT 8
- [Feature Request] Make a table sortable HOT 1
- 本地启动后样式失效了 HOT 5
- Comment GitTalk Support
- gallery relate HOT 1
- Error when generating static files with Hexo 5.4.0 HOT 4
- [Feature Request] Add visit number
- render errors HOT 1
- [feature request] dark mode
- 搜索按钮出现在导航栏,但搜索页面出现在底部 HOT 10
- Is there full source code regarding to the theme example? 有没有主题文档那个例子的源码? HOT 4
- gallery插件问题 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hexo-theme-minos.