F
F
FlexibleCurd2015-12-03 02:58:47
css
FlexibleCurd, 2015-12-03 02:58:47

How to properly organize the files and folders of the site?

Hello!
I decided to optimize the site layout process (actually, I have little experience with grunt. I haven’t taken on gulp yet). Connected grant tasks for minification and concoction, connected image optimization. less.
Everything seems to be normal, but I wanted more, like: including html files, copying, preparing .html for the server.
But then I looked around and realized that I have 200 lines of code in the grant and this is just the middle of what I wanted.
In general, I quickly became confused about all this (what to connect to, etc. The fact is that when I wanted to add another page of the site (which is similar to others, but has a difference in the main block (since it looks like other pages, I I spend 5-10 minutes through include html, etc.)) I figured out for 5-10 minutes what to add to grant tasks, what structure, etc. And the question arose whether all this was worth the time that I spent on setting up the grant?
Maybe it’s just that I don’t have much experience, I’ll get used to it in time or am I doing something wrong?
The thought arose: “I’ll take the most necessary things from the grant, and I’ll do the rest with my hands”
But still, if, for example, the header changes, I will need to use his hands change things on 10 pages (its html code), etc.
P/S.
Maybe there are some good articles on this topic?.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
O
OnYourLips, 2015-12-03
@OnYourLips

The fact is that when I wanted to add another page of the site (which is similar to others, but has a difference in the main block (since it is similar to other pages, I do all this through html inclusion, etc.))

You are doing extra work that has already been done.
You should not create pages without interacting with the software product. This part will be taken over by the backend template engine.
And what you describe has already been implemented in them for a long time.
If, nevertheless, you should have a certain number of html pages at the output, then just take any template engine and router and write a microsite of 10 lines on them. It will be less than yours.

M
Maksim Zverev, 2015-12-03
@m1skam

What you want is static site generators. Their wagon and another cart on the side.
Here are a few:
For ruby: Middleman , jekyll , octopress
For node.js: DocPad , codex , harpjs etc etc.

A
Artem Malko, 2015-12-03
@artemmalko

I recommend that you study how this is implemented in TARS, just your task is being solved.
You can learn about how it all works from the report ( https://vimeo.com/123924728 20 minutes) or from the docks to TARS. Everything is described in great detail there + articles on Habré .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question