Add pangu.js instead of auto_spacing in hexo#51
Add pangu.js instead of auto_spacing in hexo#51sli1989 wants to merge 2 commits intotheme-next:masterfrom sli1989:pitch
Conversation
wafer-li
left a comment
There was a problem hiding this comment.
I think it will be better to combine those two lines into a new swig file and include it in _layout.swig
|
however, I am a little white. |
|
…… You could take my #32 PR as a reference, and please provide a config for it. Besides, |
|
😂 haha... |
|
If you don't have time for it. I could just implement it, but I need tests for Muse | Mist scheme since I don't use those schemes. |
|
it would be good. |
|
And what mean |
|
Working on it, I am now writing a test page.
Just add spaces between Chinese and English word make it more beautiful, like this: |
|
So, this is for Chines only? I think need to create separated repo with lib for this. With src included. |
OK, I am just going to discuss this with you. For now I am just finishing porting from this PR. When I finish, I will try to implement the separated lib way. |
|
maybe mixed language situation... |
|
As i right understand, in Chinese language there are no spaces to use? Letters write together always? |
|
@ivan-nginx We use the knowledge of the language and our experiences to determine what is so-called "word" in the English world which separated by space. |
|
Alright, then need to created separated lib for that. This pull resumed in #56. |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
To use auto spacing in hexo, you need to
$ npm install hexo-filter-auto-spacing --saveandauto_spacing: ture. but there are many issues usinghexo-filter-auto-spacingin some special circumstance like chinese and english headlines.Issue Number(s): #4, #5, #1608, #27
What is the new behavior?
I recommend to use the pangu.js to realize the auto spacing.
$ npm install pangu --saveseems to be not working. I need to add the js in\themes\next\layout\_layout.swignpm uninstall hexo-filter-auto-spacingfirstly.auto_spacing: falsein your root_config.yml, or just comment it.Files modified:
\themes\next\layout\_layout.swig<script src="https://cdnjs.cloudflare.com/ajax/libs/pangu/3.3.0/pangu.min.js"></script>in<head><script>pangu.spacingPage();</script>in<body>How it looks?