Coder Social home page Coder Social logo

Comments (28)

tsanie avatar tsanie commented on May 23, 2024 2

Sorry, I cannot quite understand what's your meaning. Could you give some detail examples?

from hexo-theme-next.

ivan-nginx avatar ivan-nginx commented on May 23, 2024

Don't underatand u: how to disable sidebar from data?

from hexo-theme-next.

xu-song avatar xu-song commented on May 23, 2024

@ivan-nginx Disable sidebar for a single folder or page, such as source/data/, source/games/.

In this case http://blog.eson.org/games/2048/ . I want to disable sidebar for all pages under source/games/.

from hexo-theme-next.

sli1989 avatar sli1989 commented on May 23, 2024

how about hexo clean before hexo d.
or use comments: false in your added menu page?
i have no bug in my added menu page.

from hexo-theme-next.

xu-song avatar xu-song commented on May 23, 2024

@sli1989 comments: false only disable the comments, not the sidebar

from hexo-theme-next.

sli1989 avatar sli1989 commented on May 23, 2024

@xu-song sorry for the misleading. you can see the above PR.
not suggest to use heading in your custom page for now.
after the PR, you can update the latest theme and add sidebar: false in front matter of your post and cumtom page.

from hexo-theme-next.

xu-song avatar xu-song commented on May 23, 2024

sorry, what PR stands for? @sli1989

The following is my heading config in source\games\2048\index.html. But it doesn't work. The rendered page is http://blog.eson.org/games/2048/

---
sidebar: false
---

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>2048</title>

@sli1989 My Hexo and NexT are Latest Master branch.

from hexo-theme-next.

sli1989 avatar sli1989 commented on May 23, 2024

Pull Request, you can try to know it using google search.
such as http://www.ruanyifeng.com/blog/2017/07/pull_request.html

from hexo-theme-next.

tsanie avatar tsanie commented on May 23, 2024

@xu-song It has not been merged into the latest branch yet, please take a wait.

from hexo-theme-next.

tsanie avatar tsanie commented on May 23, 2024

Add a feature in PR #93 , please have a try. @xu-song

from hexo-theme-next.

xu-song avatar xu-song commented on May 23, 2024

@tsanie Thanks for your prompt reply. Your commit truly works for markdown file. But it does not work for html. Can u take another commit if possible.

source/games/2048/index.html

---
sidebar: false
---

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>2048</title>

from hexo-theme-next.

tsanie avatar tsanie commented on May 23, 2024

Wait, which html, do you mean that you've written the html file in the hexo/source folder? It is not the right way to build a page, and that would lead the hexo to generate a strange html page.

Please use the .md files, and of course you can insert some html tags into the .md file, then you can generate the whatever page you want.


And you can surround the html tags by using {% raw %}...{% endraw %}, if you worried about some words maybe processed by the markdown render.

from hexo-theme-next.

xu-song avatar xu-song commented on May 23, 2024

Is there a special render for html? Or .html and .md share the same render engine?

It works now. Just the same config as .md. Thanks for your help.
title date sidebar comments all work for html as heading config.

from hexo-theme-next.

tsanie avatar tsanie commented on May 23, 2024

If there is no more problem, please close this issue.

from hexo-theme-next.

xu-song avatar xu-song commented on May 23, 2024

Is there a god way to customize subfolder configuration? like .gitignore does, Can we set multiple .yml in different (sub)directories? @ivan-nginx @tsanie

----update
for example. can we define multiple theme_config like the following schema?

blog/─┬─_config.yml    # hexo config
      ├─theme───next
      │          ├──_config.yml   # theme config  -- main
      │ 
      ├─source/
          ├── _post/ 
          ├── folderA
          │     ├── _config.yml    # theme config  -- overwrite main_config
          │     ├── a.md
          │     ├── folderB
          │           └── b.md
          │       
          ├── folderB
          │     ├── _config.yml    # theme config  -- overwrite main_config

We can put the following config in source/folderA/_config.yml , which works for all the subdirectory.

sidebar: false
comments: false

Maybe it is a bit complicated.
Or it should be a feature of Hexo instead of Theme? Maybe not. I don't know

from hexo-theme-next.

tsanie avatar tsanie commented on May 23, 2024

@xu-song Yeah, it is a bit complicated, and it should be a feature of Hexo. Maybe you can ask Hexo for the question.

from hexo-theme-next.

ivan-nginx avatar ivan-nginx commented on May 23, 2024

@xu-song can u explain why u need this? In short words.

For example: i want this feature because i need to...

from hexo-theme-next.

xu-song avatar xu-song commented on May 23, 2024

customization @ivan-nginx

from hexo-theme-next.

ivan-nginx avatar ivan-nginx commented on May 23, 2024

Customize what?

from hexo-theme-next.

xu-song avatar xu-song commented on May 23, 2024

just like you cusomize a single file with heading config. This feature can cusomize a batch of files by less config.

If you ask me why need customization. I don't know how to reply. Theme is born for customization. @ivan-nginx And this feature is doable in Theme level. Not belong to Hexo.

The above schema is just one choice of batch_configuration, surely not the best. But batch_config is better than config one by one.

from hexo-theme-next.

ivan-nginx avatar ivan-nginx commented on May 23, 2024

I asking u because i think there are all already can be customized. I just don't understand what exactly u need to customize.

For example, i want 2 different sites with 2 different Hexo & NexT configs to work under 1 Hexo node_modules, i create:

  1. In main Hexo dir file called site1.yml and add here all configs from Hexo & NexT in accoriance with Hexo data files guide.
  2. I do the same, but only difference in config filename, called now site2.yml — this will absolute another site with another source and public directories.
  3. I use hexo clean --config site1.yml && hexo g --config site1.yml — to generate site 1.
  4. I use hexo clean --config site2.yml && hexo g --config site2.yml — to generate site 2.

from hexo-theme-next.

xu-song avatar xu-song commented on May 23, 2024

I think I have express my need clearly. If not , you can read again. And I don't like your style @ivan-nginx
We never talk about two sites.

If user's desired pattern conflicts with your roadmap, u can argue.
If you have another way to make user get what he expected, the lost user will be appreciated if u can help him.
Reply with a single word "why" or "what" makes me confusing about your point.

from hexo-theme-next.

ivan-nginx avatar ivan-nginx commented on May 23, 2024

We can put the following config in source/folderA/_config.yml, which works for all the subdirectory.

sidebar: false
comments: false

No, we not put the following into theme config because it must be write in post's front-matter which must generate Hexo.

Maybe it is a bit complicated.

Maybe. Or maybe not.
Let's suppose we have ~500 posts. And u want to create ~100 configs in many subdirectories for that? Really? This is big waste of resources i think.
It's can be maked if strongly needed, but for now i don't see in what cases it can be implemented. If u want to customize each post — front-matter for this already exists.

U firstly ask for hide sidebar feature (and i still in shocked why it can be need) and this feature was added.
For now u want feature what will bring bigger problem for maintenance and less for useful. This is a little bit boldly.
If u lazy for add vars in front-matter and want to use some automatization with batch files, u can add same strings in front-matter also (at least -1 addition created _config.yml will be).


Issue will be closed due already implemented feature in the head.

from hexo-theme-next.

xu-song avatar xu-song commented on May 23, 2024

You prefer 500 posts with 500 heading. Okay

comments: false

or

sidebar: false

or

category:
- web

....

from hexo-theme-next.

ivan-nginx avatar ivan-nginx commented on May 23, 2024

And u prefer 500 posts with 500 configs?)

from hexo-theme-next.

xu-song avatar xu-song commented on May 23, 2024

In many cases, 1-5 batch_configuration works.
Batch is better than one by one, Undoubtedly.

from hexo-theme-next.

ivan-nginx avatar ivan-nginx commented on May 23, 2024

In most case, we 1-5 batch_configuration works.

Wow! I see now. Let explain situation:

  1. U want to set in main NexT config sidebar: false, for example.
  2. Not to put in each front-matter post this var, but
  3. Want to use something like template by inherit to set sidebar: true again?

I don't see any logic. Go as another corner:

U want to see sidebar or not want? U need sidebar? If u need, turn it on and all be done.
If no need, turn it off.

And u just now talking something about: i want sidebar, but don't need it on 25% in my site pages, right? So, u can disable sidebar for pages and use pages as this 25% of your posts. And else exists some plugins to customize (add) other types insted of post and page, if u did't know about that.


I think I have express my need clearly. If not , you can read again. And I don't like your style @ivan-nginx
We never talk about two sites.

Yeah, i write this comment while u just added your 1 explain, something like «Is there a god way to customize subfolder configuration?». You know, God customization can do only by God, because he's God, i think. We are not Gods here and can't to do special for u all of u need and wish, for free.


Again: this feature in this key hard to implement right now. But i see what u mean and in generally this good (not god) idea and will be backloged in our simple peoples heads. 😄

from hexo-theme-next.

xu-song avatar xu-song commented on May 23, 2024

thanks

from hexo-theme-next.

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.