Skip to content
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

无法更换自己的模板 #2

Open
balthild opened this issue Sep 16, 2014 · 11 comments
Open

无法更换自己的模板 #2

balthild opened this issue Sep 16, 2014 · 11 comments

Comments

@balthild
Copy link

index.html中themePath、css路径定义到了相对路径,CSS里面的更改可以应用,但是对模板文件的更改没法应用,看了一下是程序默认只载入themePath/chill的模板。是想要更改模板必须得直接替换chill里面的文件?还是需要在别的地方设置?

@guo-yu
Copy link
Member

guo-yu commented Sep 16, 2014

如果需要自定义主题,可以在相应的目录拷贝 Chill 的项目文件,然后将配置项的 airpubConfigs.themePath 修改成这个路径,Airpub 就会从这个路径去加载指定的 html 文件。

@guo-yu
Copy link
Member

guo-yu commented Sep 16, 2014

@s-kias 具体可以参考 Airpub.io 的源码 view-source:http://airpub.io/

@balthild
Copy link
Author

@turingou 呃,刚刚看过完整的源码才发现。我一开始是直接用那个40行代码搭建的,应该是要自己加airpubConfigs.theme来设置。然后发现一个新的问题,用40行的代码搭建了程序后,airpubConfigs.themePath设置到本地(假设是./themes),这样可以更改主题模板,但是会使文章编辑器无法使用等,我看过完整源码后发现是airpubConfigs.themePath下除了有主题还有很多的依赖,而这样造成的结果就是40行代码的版本想要使用第三方主题,就必须另外下载所有的依赖,这样反而比直接用完整的程序更麻烦了,所以我建议把主题和其他依赖分开两个地方放

@guo-yu
Copy link
Member

guo-yu commented Sep 16, 2014

@s-kias 这是因为默认主题有后台程序和逻辑。编辑器实际上是后台程序,所以建议使用第三方主题或者需要修改主题的时候,必须要从 Chill 这个默认主题来进行拓展,并且不要删除 admin.html 这个后台 html。

@balthild
Copy link
Author

@turingou 我是直接用 Chill 来修改的,而且即使我不作任何修改(直接从这个项目clone下载放进主题文件夹),只要airpubConfigs.themePath改到本地就会出现这个问题……

@guo-yu
Copy link
Member

guo-yu commented Sep 16, 2014

@s-kias 你使用的 Airpub 版本是?我猜可能是 ninja editor 拆分后依赖 fontawesome 的相对资源索引问题

@balthild
Copy link
Author

更新了一下Airpub,现在是0.3.2,chill版本是0.3.0,现在的情况就是有编辑框了,但是编辑器工具栏图标不显示,整个编辑器的边框也没有了,而且输入标题的地方输东西进去也不显示
qq20141012143109
我的博客在 http://github.com/s-kias/rubik ,是 http://github.com/airpub/index.html 直接Fork过去,把主题目录改到了本地,然后把 http://github.com/airpub/chill 放在 theme 目录下,是不是我搭建的过程中漏掉了什么造成这个问题的?

@guo-yu
Copy link
Member

guo-yu commented Oct 12, 2014

@s-kias 这个问题也是我比较头疼的一个问题,就是编辑器有一个外链的字体资源,而且这个地址是打包在我们最后生成的样式表上的,等下我找时间详细解释一下这个问题

@balthild
Copy link
Author

这个字体,是你上面说的font-awesome?我尝试把bower_components/font-awesome复制到了theme下,然后编辑器工具栏的图标有了,但是别的地方问题照旧。我还试了下 Fork 了 https://github.com/airpub/airpub.io ,只更改了多说short_name然后看了看后台也是这样的问题

@guo-yu
Copy link
Member

guo-yu commented Oct 12, 2014

@s-kias 字体资源应该是获取到了,不过「别的问题照旧」指的是 「输入标题的地方输东西进去也不显示」吗?你使用的浏览器是?

@balthild
Copy link
Author

是的,整个编辑器原本的边框也没有。我用的浏览器是IE 11,感觉应该不是浏览器的原因,因为主题目录改到默认的地方 http://static.duoshuo.com/airpub/themes 就没有这样的问题了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants