Open gedw99 opened 1 year ago
Agreed.
but I would not create sub folder but instead use file name prefixes. It’s a sneaky form of tagging . You can do it for css too as you mentioned.
why though ?
because file hierarchies make templates more complex with subtle bugs. It can get nasty pretty fast .
I feel it’s yagni!
For example , the pkg folder is nicely one folder per service and it’s why it’s so easy to grok the system.
Maybe I am wrong because I am not close enough t the code base but it’s just my hunch from over the years.
We could do it in 2 phases.
I agree with @gedw99 , in case we have to create folder, we should think of it as a module wise, for eg: keeping all html and templates of let's say developer module in a folder of its own.
As v1, we should at-least attach prefix to all templates html.
I'm working on this.
There were only three template files and they were all suffixed with -template. So perhaps I thought there was some sort of "indicator" already as to whether it was full page or reused template.
I also thought "tpl-" might be more consistent with the file naming convention in the static/views folder (instead of tpl_).
But I went ahead with the changes as discussed. Awaiting feedback ...
we already have -template suffix, if we have to do any change at all to the templating structure it will be subfolders, otherwise there is no point in investing time on this
Yeah I agree. So do we decline the PR? Since its redundant?
In https://github.com/golang-cafe/job-board/tree/master/static/views it’s hard to see what’s a reused template and what’s a complete html page.
Can we just rename all template ones to start with a prefix if “tpl_” ?
the refactor is a simple find and replace from what I can see .
This will make it alot easier to work on and extend and is not disruptive to the rest of the architecture