-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Load custom files from outside the theme [solved] #31
Comments
Explain, why u need it? |
OK, for now, if you need to custom the theme, you need to make a fork, since the custom files are everywhere. When you need to update the theme from the original upstream, you need to deal with hundreds of conflicts since this theme is still maintained and under development. And while you use Rebase Merge and GPG Signing, it will be more painful to sign hundreds of git commits. But, if the theme could load custom files from given paths, it will make life easier. |
For example, which conflicts? Can u not use abstract words and say concrete, what u want or what is bad?
Here i repeat read message. When repeat and repeat reading again. And can i ask u a question: And what mean «hundreds of git commits»? U want on same theme only 10 commits, but at same time this theme must be cool, without bugs and, of course, best Hexo theme? I just trying to understand u logic and if anyone can update to the latest commit in anytime, what's the difference between hundrends and millions commits?
It already will. Make. Life easier. U know something about |
First of all, sorry for my tone above. What I really want is «the theme could load custom files from given paths». After a seriously and carefully consideration, I notice that it could be done through some scripts. Sorry for bothering you and your org again. Here is my reply to some of your words, if you are interested in it, it might explain my thought further:
The term I need to use the GPG Key to sign every commit of the incoming upstream updates to make the rebase process done. It is too painful to sign about 500 commits when I reopen my site after a long preparation of an important exam.
No, I understood that a well-maintained project comes with lots of commit and recently updates.
That's right, but the custom files isn't a part of the theme actually. Those files are specified by theme's user and as an input of the theme, they are not maintained by the developer of the theme. Therefore, it doesn't bother about the difference between commits pushed by the developer. And in my opinion, those files should be separated from the theme
Since I use CI, those files should not add to |
I no need. Use soft at least past of 3 years, any GUI, for example. If u still use console from 2000x, ok. please, sign your commits one by one. It's your problem, not problem NexT, Github and all maintainers, ok? So, notice about «Rebase Merge and GPG Signing» is not relevant, i think. BTW, i no once no do
I don't understand u, go again: u must to sign every commit, right? With console, right? With sample
Yeah, dude from another issue think the same, but problem was solved and all worked fine.
Wow! Maybe will be better to remake a wheel? No? Script? I wondering, how it may be!? Never heard about scripts. How i pull/push NexT: i not use for now any GPG sign, never use I just don't understand: guys, u liked simple take my time for nothing or what? If u suggest something, be kind, take your hands and your head and focus on this suggest to try to take a wave and explain what, how and where u want, step by step. Something like «i want what NexT will be cool and all plugins and configs will in one place and i just push 1 button and money from the sky poured out to me» — not accepted. It's at least waste of time. P.S. Please, in next time suggest your problem more accurately and, desirable, step by step for understanding what u what and mb what u doing not right in your steps. Thank's! |
OK, I will keep it in mind.
Just like this: cat custom/css/custom.styl >| themes/next-reloaded/source/css/_custom/custom.styl Therefore, the custom css could be loaded from |
U must understand what css styles is not the same as config based on javascript, it's different things. But, yes, it can be merged in one config if try to hard work. I don't see how to easy implemet it for now. But your thinking is right, it is not usable to keep configs in different files and directories across the troubles with git/deploy will be always appear.
This is semi-auto decision. But work? Work. Well, we can live with this for now, because there are many other important things wait to implement they. |
I am so appreciate that you finally understand my thoughts. I think we should document that Where are the custom CSS, layout etc. |
Styles inherited from main SCSS variables. For example, |
Em....... It might be some misinterpretation here. For now, Next has lots of custom files located in different places: For example, the custom CSS is located in What I really want and suggest is let us make that files out of theme, not to combine them into one file. Let's say, a Currently, I could use some
If it can be achieved in theme, then will come with a config: custom_file_path:
header: custom/head/custom-head.swig
head: custom/layout/header.swig
css: custom/css/custom.styl And the theme just loads that custom files from the path in above. Since the config file is already extracted from theme into |
Oh, now i see. Well, it's easy to implement. |
Added this feature. How to use see NexT config descriptions: # Redefine custom file pathes. Introduced in NexT v6.0.2.
# If commented, will be used default custom file pathes.
# For example, you want to put your custom styles file
# outside theme directory in root `source/_data`, set
# `styles: ../../../../../source/_data/styles.styl`
custom_file_path:
head: ../../../../../source/_data/head.swig
#header: ../../../../source/_data/header.swig
#sidebar: ../../../../source/_data/sidebar.swig
styles: ../../../../../source/_data/styles.styl
#mixins: ../../../../../source/_data/mixins.styl
variables: ../../../../../source/_data/variables.styl Fixed |
Emm.. What is |
It's just my directory for tests, fixed on default |
@wafer-li so, are u happy for now? 😃 |
Maybe some docs is needed about what is the And to alert them not to touch it, just append the path after it. |
Yes, that's right. |
Or, what about just use one more config custom_file_path:
_hexo_dir: ../../../../../ # DO NOT CHANGE IT
head: source/_data/head.swig
#header: source/_data/header.swig
#sidebar: source/_data/sidebar.swig
styles: source/_data/styles.styl
#mixins: source/_data/mixins.styl
variables: source/_data/variables.styl Just as the vendors:
# Internal path prefix. Please do not edit it.
_internal: lib
# Internal version: 2.1.3
jquery:
# Internal version: 2.1.5
# See: http://fancyapps.com/fancybox/
fancybox:
fancybox_css: |
I think about this, but if u see on this paths, there is diffs in count of Only if we can somehow to get main hexo dir from styles file, then it can be implemented by global hexo variable + custom user paths. But for now in styles only |
But i have another idea how to remove this dotes. I'll try it now. |
How about that? 1cb4d08 # Redefine custom file paths. Introduced in NexT v6.0.2.
# If commented, will be used default custom file paths.
# For example, you want to put your custom styles file
# outside theme directory in root `source/_data`, set
# `styles: source/_data/styles.styl`
custom_file_path:
#head: source/_data/head.swig
header: source/_data/header.swig
#sidebar: source/_data/sidebar.swig
styles: source/_data/styles.styl
#mixins: source/_data/mixins.styl
variables: source/_data/variables.styl |
Yes, that approach comes to my mind at some point, but I soon forgot about it! In this way, just need to notify the user the dir is relative to his/her hexo's root. |
Yeah, in main docs it will be. And if user is not too noob, he's will understand what it's hexo root relative pathes and comments talk about it. So, issue can be closed, i think. |
OK. |
But you seem to comment out the config: #custom_file_path:
#head: source/_data/head.swig
#header: source/_data/header.swig
#sidebar: source/_data/sidebar.swig
#styles: source/_data/styles.styl
#mixins: source/_data/mixins.styl
#variables: source/_data/variables.styl Fix it and this issue could be closed. |
So? Read comments above this option:
So, there are no breaking changes. |
@ivan-nginx Goodbye to this issue. |
I' m sorry to disturb you with this question. |
U are right, this must be documented and will be later. For now i can give short explain like this: # Redefine custom file paths. Introduced in NexT v6.0.2.
# If commented, will be used default custom file paths.
# For example, you want to put your custom styles file
# outside theme directory in root `source/_data`, set
# `styles: source/_data/styles.styl`
custom_file_path:
head: source/_data/head.swig — layout/_custom/head.swig
header: source/_data/header.swig — layout/_custom/header.swig
sidebar: source/_data/sidebar.swig — layout/_custom/sidebar.swig
styles: source/_data/styles.styl — source/css/_custom/custom.styl
mixins: source/_data/mixins.styl — source/css/_mixins/custom.styl
variables: source/_data/variables.styl — source/css/_variables/custom.styl And for your questions:
It's custom_file_path:
variables: source/any_path_you_want_vars.styl
It's custom_file_path:
styles: source/any_path_you_want_custom_styles.styl Parameter |
thanks. it's helpful. i would like to say it's amazing. |
I'm sorry to open this issue. (function () {
var all = document.getElementsByTagName("*");
for (var i = 0, len = all.length; i < len; i++) {
var element = all[i];
element['oncopy'] = function() { alert("you copy from My Blog") };
}
})(); |
@Ahaochan Use inline-script? |
@maple3142 not only
After all the scripts, make sure the All dependencies ( like jQuery ) is loaded. |
@Ahaochan it's already backloged into Roadmap as «Custom JS files.». But for now, as @maple3142 talked above, u can use custom inline script in layout files: Lines 21 to 25 in 51b6996
So, u can try to add in |
Theme inject feature added in NexT v7.3.0 |
Is there any way to move all custom files out of theme dir just like the
_config.yml
which described at iissnan/hexo-theme-next#328Currently, the custom files are all over the place, it is too painful to update the theme from the official repo.
The text was updated successfully, but these errors were encountered: