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

hi, im using your theme now but, i have some questions #9

Open
Christianpark opened this issue Jan 15, 2019 · 9 comments
Open

hi, im using your theme now but, i have some questions #9

Christianpark opened this issue Jan 15, 2019 · 9 comments

Comments

@Christianpark
Copy link

Hello, I'm newbie to use to this.
im happy to use your theme because, this theme is so nice!! :xD .

So... i ask to you for advice.

  1. how to activate Searching plugin?
    i already install generator-search and added search options in _config.ym _
    but, it still does not work yet.
$ cd root folder
$ npm install generator-search --save
search:
  path: search.xml
  field: post
  content: true
  1. how to change allinone.min.css?
    i want to add some font-family(and value) so, i changed highlight.css , markdown.css, style.css.
    but, when i generate, allinone.min.css was not mixed with all the css properties.
    that's why i found property in allinone.min.css by my self and i added value by my hands on.

please, give me some ways.

@Christianpark Christianpark changed the title hi, im using your theme now but, i have some question hi, im using your theme now but, i have some questions Jan 15, 2019
@xzhih
Copy link
Owner

xzhih commented Jan 15, 2019

  1. No need to install the search plugin again, you better uninstall it.
    You can find local_search in themes/hexo-casper/_config.yml, make it true, and hexo clean, you will see the change.

  2. You can change style.css, then use cleancss mix all css file, like this
    cleancss -O2 -o ./allinone.min.css ./screen.css ./style.css ./markdown.css ./highlight.css

@Christianpark
Copy link
Author

Christianpark commented Jan 16, 2019

I'm so sorry but can you explain more detail?

  1. i changed local_search :true in hexo-casper theme/config.yml, and i also tried hexo clean but still nothing find at searching window.

  2. cleancss is npm? if it npm, please teach me how to do this... or give me url.

@xzhih
Copy link
Owner

xzhih commented Jan 16, 2019

I tested it many times and there was no problem.
You need to edit layout/_partials
where
{{ js('js/mix/home-lazy-local.min') }}
to

{{ js('js/lazyload.js') }}
{{ js('js/local-search.js') }}

and debug it.

cleancss:
https://www.npmjs.com/package/clean-css-cli

@Christianpark
Copy link
Author

hi, it's me again.
i mixed all css thanks to you.
i added {{ js('js/lazyload.js') }} and {{ js('js/local-search.js') }} for your advice like this
but, i still can not use search application.......
here is my search logic in layout/_partials/javascript.swig...

{# 非文章页懒加载  local_searching js #}
{% if !is_post() %}
{% if theme.local_search %}
{#
{{ js('js/mix/home-lazy-local.min') }} 
#}
{{ js('js/lazyload.js') }}       {# ADDED BY ADVICE#}
{{ js('js/local-search.js') }}   {# ADDED BY ADVICE#}
{% else %}
{{ js('js/lazyload') }}
{% endif %}
<script>;(function() {var bLazy = new Blazy()})();</script>
{% endif %}

{# 文章页面 #}
{% if is_post() %}
{% include "public/fload-header.swig" %}

{# 如果开启文章页懒加载 #}
{% if theme.lazyload %}
{# 如果开启搜索,则引入 post 页面、懒加载、搜索合并文件 #}
{% if theme.local_search %}
{{ js('js/mix/post-lazy-local.min') }}
{% else %}
{# 未开启搜索只引入 post 页面、懒加载合并文件 #}
{{ js('js/mix/post-lazy.min') }}
{% endif %}
<script>;(function() {var bLazy = new Blazy()})();</script>
{% else %}
{# 如果未开启文章页懒加载 #}
{% if theme.local_search %}
{# 如果开启搜索,则引入 post 页面、搜索合并文件 #}
{{ js('js/mix/post-local.min') }}
{% else %}
{# 如果未开启懒加载,未开启搜索,则只引入 post 文件 #}
{{ js('js/post.min') }}
{% endif %}
{% endif %}

HELP ME !!! :<

@xzhih
Copy link
Owner

xzhih commented Jan 17, 2019

  1. delete
{#
{{ js('js/mix/home-lazy-local.min') }} 
#}
  1. then hexo server --debug
  2. use the chrome console to check out home page

@Christianpark
Copy link
Author

i got Error when i keydown... T.T

Uncaugth TypeError: Cannot read property 'trim' of undefined
at local-search.js:84
at Array.forEach (<anonymous>)
at printRs (local-search.js:77)
at HTMLInputElement.<anonymous> (local-search.js:47)

i don't know why...... i just fllowed you.

@xzhih
Copy link
Owner

xzhih commented Jan 18, 2019

It seems that I can't get search data from Local Storage.
Have you used other scripts? This may lead to blocking.

@Christianpark
Copy link
Author

Hmm...i added google analytics,fontsawesome scripts only.

@yusabudun17
Copy link

Hi, how to upload Post cover img ? please help me...

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

No branches or pull requests

3 participants