git &网页设计:处理多个自定义模板
我正在开发一个 CMS(使用 Django,但这并不重要)并选择了 GIT。
安装将在以下方面有所不同:
- 配置
- 数据库内容
- 媒体
- 模板
前 3 个对于 git 来说不是问题:我们根本不需要这些:)
在开发时,我有 1 个带有相关媒体的默认模板。 之后,每个客户都会收到基于默认模板的自己的设计(一些轻微的定制)。
当我引入新功能时,我不会支持每个自定义模板。模块化对此有所帮助,但并不是 100% 的解决方案。
您有什么经验可以分享吗?
示例:目前,v0.1 非常出色:它有 1 个“默认”模板和 10 个自定义模板:每个客户一个。
现在,CMS v0.2 中出现了一些新功能:例如登录框。我在“默认”模板上测试了它,它工作得很好并且非常好。我为此感到自豪:) 现在,所有 10 位客户都希望拥有这个出色的创新登录框。我真的需要手动更新所有这 10 个自定义模板吗?
I'm developing a CMS (with Django, but that doesn't matter) and have chosen GIT.
Installations will vary in:
- Configs
- Database contents
- Media
- Templates
First 3 are not a problem with git: we simply don't need these :)
While developing, I have 1 default template with related media.
Later, each customer will receive his own design based on default templates (some slight customization).
I'm not going to support each of the custom templates as I introduce new features. Modularity helps with this but is not a 100% solution.
Do you have any experience to share?
Example: Currently, v0.1 rocks: it has one 'default' template and 10 customized: one per customer.
Now, in CMS v0.2 some new features has appeared: e.g. a login box. I tested it on the 'default' template, it works great & I'm proud of it :) Now, all 10 customers want to have that great innovative login-box. Do I really have to update all that 10 customized templates manually?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在我看来,您基本上有两个选择:
现在,至于选择哪个,您需要考虑多个方面:
如果任何一个问题的答案是肯定的,请使用第一个选项。您可能不希望客户看到/有权访问其他客户的模板。
如果答案是否定的,那么请检查您自己的工作流程并使用您认为最容易维护的工作流程。我可能选择第二个选项,因为您在更新应用程序时只需担心一个代码库,以及对模板进行版本控制的额外好处。
The way I see it, you essentially have two options:
git clone
the repository for each new customer, and then create the individual templates for each of them. The CMS reads in the one set of templates and renders the page.Now, as for which to choose, there are multiple aspects of this that you need to consider:
If the answer is yes to any of the questions, use the first option. You probably don't want customers to see/have access to your other customers' templates.
If the answer is no to all of then, then examine your own workflow and use whichever you think is going to be easiest to maintain. I'd probably pick the second option, as you'd only have to worry about one codebase when updating your app, as well as the added benefit of having version control on the templates.