让GoogleCode的SVN下的HTML文件在FireFox下正常显示.

 更新时间:2009年05月25日 02:58:10   作者:  
GoogleCode可以作为免费的稳定的静态资源空间来使用,比如JQuery的文档就在上面
今天试了下发现GoogleCode提供的SVN中的HTML在Firefox中显示为HTML源文件
Google了一下,找到了答案:
如果正常显示需要在SVN提交文件时设置svn:mime-type 为 text/html.(http://blog.pluskid.org/?p=70)
SVN客户端都支持自动配置具体配置方法如下(http://www.worldhello.net/wiki/SVN)
--------------------------------------
6.2 新增文件的属性设置?
Whodo SVN 的 Hooks 脚本会检查新增文件的属性,没有设置 svn:mime-type 和/或 svn:eol-style 属性,禁止提交。
但是每次添加文件后,还要执行类似“svn ps svn:eol-style ...”的命令,实在太繁琐了!不过幸好,SVN 客户端(命令行或者 TortoiseSVN),支持自动属性的功能。即会为新增文件自动添加属性。

6.2.1 config 配置文件
启用和设置自动属性,是在 config 配置文件中完成的。 config 配置文件的位置:
Unix 平台
全局的配置文件位置为:/etc/subversion/config; 每个用户主目录还有配置文件覆盖全局配置文件的设置:~/.subversion/config;
Windows 平台
注册表中可能包含相应的设置:HKLM\Software\Tigris.org\Subversion\Config,以及 HKCU\Software\Tigris.org\Subversion\Config。 不过文件的优先级更高。全局配置文件:%ALLUSERSPROFILE%\Application Data\Subversion\config,用户个人配置文件:%APPDATA%\Subversion\config
6.2.2 启用 auto-props
修改 config 配置,启用 auto-props:
[miscellany]global-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store .cvsignore Thumbs.db CVSuse-commit-times = yesenable-auto-props = yes
6.2.3 基于文件名的 auto-props 设置
自动属性的设置,是根据文件名来匹配的。修改 config 文件,增添新的配置,如下:
### Section for configuring automatic properties.[auto-props]### The format of the entries is:### file-name-pattern = propname[=value][;propname[=value]...]### The file-name-pattern can contain wildcards (such as '*' and### '?'). All entries which match will be applied to the file.### Note that auto-props functionality must be enabled, which### is typically done by setting the 'enable-auto-props' option.##################################################### Binary files##################################################*.bmp    = svn:mime-type=image/bmp*.gif    = svn:mime-type=image/gif*.gz    = svn:mime-type=application/x-gzip*.ico    = svn:mime-type=image/x-icon*.jar    = svn:mime-type=application/zip*.jpg    = svn:mime-type=image/jpeg*.pdf    = svn:mime-type=application/pdf*.png    = svn:mime-type=image/png*.ps    = svn:mime-type=application/postscript*.tif    = svn:mime-type=image/tiff*.vsd    = svn:mime-type=application/octet-stream*.zip    = svn:mime-type=application/zip##################################################### Text files, OS dependent eol-style##################################################*.dsp    = svn:eol-style=CRLF*.dsw    = svn:eol-style=CRLF*.mm    = svn:eol-style=LF;svn:mime-type=text/xml*.sh    = svn:eol-style=LF;svn:executableMakefile    = svn:eol-style=LF##################################################### Text files, eol-style is native##################################################*.c        = svn:eol-style=native;svn:mime-type=text/plain*.cpp    = svn:eol-style=native;svn:mime-type=text/plain*.css    = svn:eol-style=native;svn:mime-type=text/css*.diff    = svn:eol-style=native;svn:mime-type=text/plain*.dsl    = svn:eol-style=native;svn:mime-type=text/sgml*.dtd    = svn:eol-style=native;svn:mime-type=text/plain*.ent    = svn:eol-style=native;svn:mime-type=text/plain*.gml    = svn:eol-style=native;svn:mime-type=text/sgml*.h        = svn:eol-style=native;svn:mime-type=text/plain*.htm    = svn:eol-style=native;svn:mime-type=text/html*.html    = svn:eol-style=native;svn:mime-type=text/html*.java    = svn:eol-style=native;svn:mime-type=text/plain*.js    = svn:eol-style=native;svn:mime-type=text/plain*.mod    = svn:eol-style=native;svn:mime-type=text/plain*.patch    = svn:eol-style=native;svn:mime-type=text/plain*.php    = svn:eol-style=native*.pl    = svn:eol-style=native*.py    = svn:eol-style=native*.sgm    = svn:eol-style=native;svn:mime-type=text/sgml*.sgml    = svn:eol-style=native;svn:mime-type=text/sgml*.svg    = svn:eol-style=native;svn:mime-type=text/xml*.txt    = svn:mime-type=text/plain*.xml    = svn:eol-style=native;svn:mime-type=text/xml*.xsl    = svn:eol-style=native;svn:mime-type=text/xml*.xslt    = svn:eol-style=native;svn:mime-type=text/xmlREADME    = svn:eol-style=native文件添加后,在提交之前,可以通过如下命令查看新增文件的属性:
$ svn proplist -v *

相关文章

  • JavaScript时间与时间戳的转换操作实例分析

    JavaScript时间与时间戳的转换操作实例分析

    这篇文章主要介绍了JavaScript时间与时间戳的转换操作,结合实例形式分析了javascript日期与时间戳转换相关函数与操作技巧,需要的朋友可以参考下
    2018-12-12
  • JS实现玩转风车

    JS实现玩转风车

    这篇文章主要为大家详细介绍了JS实现玩转风车,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2022-02-02
  • javascript 缓冲效果实现代码 推荐

    javascript 缓冲效果实现代码 推荐

    缓冲效果就是实现一个页面的由慢到快或由快到慢的过程。
    2009-09-09
  • JS获取鼠标相对位置的方法

    JS获取鼠标相对位置的方法

    这篇文章主要介绍了JS获取鼠标相对位置的方法,涉及javascript事件响应及针对页面元素属性的动态操作技巧,需要的朋友可以参考下
    2016-09-09
  • A标签中通过href和onclick传递的this对象实现思路

    A标签中通过href和onclick传递的this对象实现思路

    想传递当前对象给一个函数,于是就将这个URL写成"Javascript:shoControlSidebar(this)",可是结果发现这并不可行,接下来为大家详细介绍下解决方法
    2013-04-04
  • 屏蔽Flash右键信息的js代码

    屏蔽Flash右键信息的js代码

    网上好多屏蔽flash右键的方法,可多数是过期的或不合适的,现记录下用JS方法屏蔽flash右键相关版权信息。
    2010-01-01
  • js实现base64、url和blob之间相互转换的三种方式

    js实现base64、url和blob之间相互转换的三种方式

    Blob对象表示一个不可变、原始数据的类文件对象,Blob表示的不一定是JavaScript原生格式的数据,下面这篇文章主要给大家介绍了关于js实现base64、url和blob之间相互转换的三种方式,需要的朋友可以参考下
    2023-04-04
  • Javascript中typeof 用法小结

    Javascript中typeof 用法小结

    JavaScript中的typeof其实非常复杂,他有六种返回的数据类型,它可以用来做很多事情,但同时也有很多怪异的表现.本文列举出了它的多个用法,有需要的小伙伴可以参考下。
    2015-05-05
  • JavaScript 监控微信浏览器且自带返回按钮时间

    JavaScript 监控微信浏览器且自带返回按钮时间

    这篇文章主要介绍了JavaScript 监控微信浏览器且自带返回按钮时间的相关资料,非常不错,具有参考借鉴价值,需要的朋友可以参考下
    2016-11-11
  • 原生Javascript插件开发实践

    原生Javascript插件开发实践

    本文主要介绍了原生Javascript插件开发的思路分析以及使用示例。具有一定的参考价值,下面跟着小编一起来看下吧
    2017-01-01

最新评论