Closed ghost closed 8 years ago
Sorry I have no time to go deeper for github but I can only sketch my suggestions that way.
@rustemgareev yeah no problem.
Lets keep the values hardcoded as they are now. It is clear that if user wants (as you are), he/she will modify as necessary.
Let the users customize as they want. Our main goal here is to bundle all the necessary plugins required before starting HTML Development.
hmm.. but currently there are no html files which are compiling in a folder. I am keeping all the compiling files as immediate children to templates-pre
folder. Even if I consider to add {% set path="../" %}
, I can't add anywhere in the current structure of boilerplate because all the indirectly compiling files present in folders (prefixed as _
) which will eventually compiled to immediate child files of site
folder.
Sorry I can't get last sentence.
By the way that's improved code for what I want get:
/* skeleton-content.html */
{% set css_path = path+css_path %}
{% set js_path = path+js_path %}
{% set img_path = path+img_path %}
<html>
...
<link href="{{ css_path }}" />
...
<img src="{{ img_path }}" />
...
<script src="{{ js_path }}" />
...
/* gulpfile.js */
...
css_path: assetsPath.css;
js_path: assetsPath.js;
img_path: assetsPath.img;
path: '';
...
/* And if we have templates-pre/inner-folder/inner-index.html */
{% set path="../" %}
What I am trying to say is there is no templates-pre/inner-folder/inner-index.html
structure in this Boilerplate currently. In inner-folders I have only components
and variables
. After compiling, the files will be compiled to site/index.html
or site/index2.html
but not site/some_folder/inner-index.html
.
But predict that user may have complex structure, and instead of opening issue and asking you how to set relative paths for assets ("../" or "../../") you will already have solution! :)
No the thing is I am unable to understand in which file exactly I should keep this variable?
Look at my previous comment starting with By the way that's improved code for what I want get: They are defined first in gulpfile.js, then in skeleton-content.html and then in every .html file in nested folders. (site/inner-folder/index.html for example)
It is better that you suggest the changes with a pull request (to "pr-branch"). Clearly, I am unable to visualize exactly of how this will be useful. Please send a PR when you have time :)
@rustemgareev Hi, I hope you are not mad at me as you stopped contributing. The changes you are suggesting will assume the complexity of the directory structure. Let's leave that to the devs who will use this Boilerplate. As per there need, they will add variables as you are suggesting. If we add from now only, it will lead to confusing, IMO. Thanks for your contributions.
Hi, I can't contribute just only because of no time, so if I only had it more, I would help. Yes, I agree that some suggestions are too complex, so if I will have ideas for simplifying, I'll try to bring them to you
Hi, I think it will be useful to add new variable "path" to existing "css_path", "js_path", "img_path". So we can easily set relativeness of our folders. Explanation: I have such project strucure:
In compiled
site/shop/shop.html
I have the same css/img/js paths as insite/index.html
becausecss_path
is unchangeable and set one time).But if I have new
path
variable I set skeleton css/js/img paths that way:And in
templates-pre/shop/shop.html
I setpath
variable to relative path:So in site/shop/shop.html I have my relative paths:
That works fine for me. Sorry I have no time to go deeper for github but I can only sketch my suggestions that way.