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

Post names cyrillic to translit #315

Closed
RomanBogachev opened this issue Apr 11, 2018 · 10 comments
Closed

Post names cyrillic to translit #315

RomanBogachev opened this issue Apr 11, 2018 · 10 comments
Labels
discussion Any questions about this theme.

Comments

@RomanBogachev
Copy link

Hi,

How I can make translate cyrillic text of my post name to translate?

e.g.

mydomain.com/%D0%9A%D0%B0%D0%BA-%D0%B8%D0%B7%D0%BC%D0%B5%D1%80%D0%B8%D1%82%D1%8C-IOPS/

to mydomain.com/kak-izmerit-IOPS/

I found converter https://github.com/greybax/cyrillic-to-translit-js

@ppoffice
Copy link
Owner

@RomanBogachev This is done inside the Hexo engine. You may want to take a look at this: https://hexo.io/docs/permalinks.html

@ppoffice ppoffice added the discussion Any questions about this theme. label Apr 12, 2018
@RomanBogachev
Copy link
Author

@ppoffice It doesnt work.

permalink: :year/:month/:day/:title/
permalink_defaults:
	lang: en
hexo new post "ТЕКСТ_НА_РУССКОМ_ЯЗЫКЕ"    <<<---- _HERE_TEXT_ON_RUSSIAN_
INFO  Created: ../public_html/source/_posts/ТЕКСТ_НА_РУССКОМ_ЯЗЫКЕ.md

Go to site and nothing happens.
https://example.com/2018/04/12/%D0%A2%D0%95%D0%9A%D0%A1%D0%A2-%D0%9D%D0%90-%D0%A0%D0%A3%D0%A1%D0%A1%D0%9A%D0%9E%D0%9C-%D0%AF%D0%97%D0%AB%D0%9A%D0%95/

Text doesn't translit from russian.

I want to see https://example.com/2018/04/12/tekst_na_russkom_yazike

It is need me for SEO.

@ppoffice
Copy link
Owner

ppoffice commented Apr 12, 2018

@RomanBogachev How about you create posts using translit? Hexo does not have the ability to translate cyrillic to translit, and it uses the filename to generate the slug.

@RomanBogachev
Copy link
Author

@ppoffice If I will create messages in translit, then the title will also be in translit. The task is to have the title in russian, but in the link to the transliteration. A long time ago this decision was implemented on the Octopress.

@RomanBogachev
Copy link
Author

RomanBogachev commented Apr 12, 2018

@ppoffice Here are related queries
hexojs/hexo#506
hexojs/hexo#1479

@ppoffice
Copy link
Owner

@RomanBogachev You can still use Russian title if you set it in the front-matter.

title: ТЕКСТ НА РУССКОМ ЯЗЫКЕ

@RomanBogachev
Copy link
Author

@ppoffice =)
The problems are not in title:

I need title: Заголовок на русском and URL: https://example.com/zagolovok-na-russkom

@ppoffice
Copy link
Owner

@RomanBogachev Try to create a file named zagolovok-na-russkom.md and put title: Заголовок на русском in it. You will see what I mean.

@RomanBogachev
Copy link
Author

@ppoffice This is a way out. But I would like to automate this process.
Thank you.

@dailyrandomphoto
Copy link

@RomanBogachev
This plugin may help you.

npm install hexo-unique-post-path

hexo new "Заголовок на русском" --type=latin
=> INFO  Created: ... /source/_posts/zagolovok-na-russkom.md

With configuration:

#_cofig.yml

+ unique_post_path:
+   type: latin
+   auto: true
hexo new "Заголовок на русском"
=> INFO  Created: ... /source/_posts/zagolovok-na-russkom.md

hexo new "ТЕКСТ_НА_РУССКОМ_ЯЗЫКЕ"
=> INFO  Created: ... /source/_posts/tekst_na_russkom_yazyke.md

More usage: dailyrandomphoto/hexo-unique-post-path#14

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

No branches or pull requests

3 participants