-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[软技能] 第79天 一个项目写很多的纯静态页面,有公共的部分(例如头和尾)你是怎么提取公用的? #571
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
Labels
软技能
软技能
Comments
所有公用部分模块化,模板化 |
组件化,模块化,我是按 vue 那样的 |
1.将公用部分处理为js文件 |
组件式开发 |
可以改为模板语言比如php、ejs这种,公共部分直接include插入就行。 |
如果不用第三方工具的话,将公共头尾放在一个文件内,然后使用iframe引入主体内容是一个不错的选择; |
这个问题其实看看各种静态网站生成的lib就好办了, 就行hexo, hugo, 里面的处理都很棒。只要想到的地方都可以模块化 |
1.写成js,插入 |
啊这个我还真干过,
|
不依赖其他的话,感觉使用iframe最好了 |
|
shadowdom |
nginx的ssi可以直接用,爽歪歪 |
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
第79天 一个项目写很多的纯静态页面,有公共的部分(例如头和尾)你是怎么提取公用的?
例如:我现在有20个纯静态的html文件,它们都有公用的头和尾,在写静态页面时,如果头部或者尾部有修改,我们要修改20个文件(当然可以做替换),有没有办法把公共的提取出来,只修改一处即可。
The text was updated successfully, but these errors were encountered: