DokuWiki

It's better when it's simple

用户工具

站点工具


zh:interwiki

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
后一修订版
前一修订版
zh:interwiki [2011-06-26 13:28] douozh:interwiki [2013-06-03 06:29] (当前版本) haobug
行 1: 行 1:
-====== 跨维基(Interwiki)链接 ======+====== 跨维基链接 ======
  
-[[http://zh.wikipedia.org/wiki/%E8%B7%A8%E7%BB%B4%E5%9F%BA|跨维基]]一开始的想法是让我们拥有一个分布在整个网络的[[wp>Wiki]],在今天,它更多的是通过一些简单的链接语法来提供一种从一个Wiki链接到另一个Wiki的方式。+[[http://zh.wikipedia.org/wiki/%E8%B7%A8Wiki%E9%93%BE%E6%8E%A5|跨Wiki链接]]一开始的想法是让我们拥有一个分布在整个网络的[[wp>Wiki]],在今天,它更多的是通过一些简单的链接语法来提供一种从一个维基链接到另一个维基的方式。
  
-在[[DokuWiki]] 我们要链接的 Wiki Shortcuts和[[pagenames|页面名称]]之间加上个 ''>'' 字符,便可实现跨维基链接。+在 [[doku>DokuWiki]] 我们链接的维基快捷方式和[[doku>pagenames|页面名称]]之间加上个 ''>'' 字符实现跨维基链接。
  
-**一些实:** +如: 
-  [[wp>Wiki]] 链接到维基百科 +| %%[[wp>InterWiki]]%%         | [[wp>InterWiki]] 链接到英文维基百科 | 
-  [[Meatball>TourBusStop]] 链接到MeatBall wiki 的 TourBusStop 页面, +| %%[[Meatball>InterWiki]]%%   [[Meatball>InterWiki]] 链接到 MeatBall 跨维基链接 | 
-  [[google>Wiki]] 链接到Google 搜索 +| %%[[google>Wiki]]%%          | [[google>Wiki]] 链接到 Google 搜索 | 
-  [[doku>interwiki]] 链接到当前页面((即http://www.dokuwiki.org/interwiki))。 +| %%[[doku>interwiki]]%%       [[doku>interwiki]] 链接到 DokuWiki 维基  | 
-   +|    |    | 
-[[wp>Wiki]] 链接到维基百科,[[Meatball>TourBusStop]] 链接到MeatBall wiki 的 TourBusStop 页[[google>Wiki]] 链接到Google 搜索,[[doku>interwiki]] 链接到当前页面((即http://www.dokuwiki.org/interwiki))+| %%[[this>feed.php]]%%        | [[this>feed.php]] | 链接到 ''<dokuwiki_data>'' (服务器上安装 DokuWiki 目录)。你可以使用这种方法来构建相对链接。 下的例子表示一个到本地[[syndication|聚合订阅]]链接[[this>feed.php]]\\ **''注意:''**  ''.htaccess'' 文件可能会让 web 服务器拒绝提供 ''<dokuwiki_data>'' 中的特定的文件或者目录。  |
  
-**''this''**是一个特殊跨维基Shortcuts, 它一直指向当前 DokuWiki 所在服务器上的安装目录。 你可以使用种方法来构建相链接。 下面的例子表示一个到本地[[syndication|聚合订阅]]的链接:[[this>feed.php]]+是一个如何通过点击图片访问 dokuwiki data/media 目录中任意文件例子,这对视频和 pdf 很有用
  
-  [[this>feed.php]]+  [[this>lib/exe/fetch.php?media=video.ogg|{{image.png?300}}]] 
 +===== 配置跨维基快捷方式 =====
  
-**了解更多** +跨维基的快捷方式定义在这两个文件: 
-  * 维基百科上的[[http://zh.wikipedia.org/wiki/%E8%B7%A8%E7%BB%B4%E5%9F%BA|跨维基]] +  *''conf/interwiki.conf'' 。\\ 这个件默认文件,它包含了所有在 [[http://usemod.com/intermap.txt]] 建议使用快捷方式。 直接更改这个文件也是可以,但不建议,因为这在 DokuWiki 更新时候你所做的修改会被覆盖。 
-  * Wikipedia 上[[wp>InterWiki]] +  * ''conf/interwiki.local.conf'',\\ 然后在里面添加你自己跨维基链接。这样你所做的修改在更新的时候不会被被覆盖。
-  * MeatBall 上[[MeatBall>InterWiki]]  +
-  * c2.com Wiki 上的[[Wiki>InterWiki]]+
  
-===== 配置跨维基 Shortcuts =====+跨维基快捷方式必须使用小写字母且遵循[[pagename|页面名称]]的规则。
  
-跨维基的 shortcuts 定义在文件 ''conf/interwiki.conf'' 。这个文件默认包含了所有在 [[http://usemod.com/intermap.txt]]建议使用的 shortcuts 。 你也可以添加自定义的跨维基链接,首先创建这个文件(没有的话)''conf/interwiki.local.conf'',然后在里面添加上你的链接(这将保护你的链接不会在更新时候被覆盖)。+跨维基链接配置文件的格式如下:
  
-直接更改 ''conf/interwiki.conf'' 文件也是可以,但不建议,因为这将导致在DokuWiki更新时候你所做的修改会被覆盖。+  <快捷方式>      <目标维基的 URL>
  
-你可以把以 shortcut 命名的图片放入''lib/images/interwiki''目录里,来让自定义图片替换掉默认的图。自定义图片大小必须是16x16 且必须是 PNG 或者 GIF 格式。在使用自定义图片代替默认图片后你应该清除下[[caching|缓存]]中的PNG、GIF图片和 CSS 文件+''快捷方式''是一个将会在链接时使用字符串,目维基 URL 部分你可以使用一些占位符来让链接更灵活。如果没有提供占位符那么页面名称会经过 [[phpfn>rawurlencodeURL 编码]] 后追加到目标维基 URL 后面。  
 +下面是有效的占位符列表:
  
-<code> +^   占位符    ^ 替换为 ^ 
-rm -rf <path-to-dokuwiki>/data/cache/*/*.gif +| {URL}       | 经URL编码后的wikiname (追加到URL后面的那一部分) | 
-rm -rf <path-to-dokuwiki>/data/cache/*/*.png +| {NAME}      | 未经过编码的wikiname | 
-rm -rf <path-to-dokuwiki>/data/cache/*/*.css +| {SCHEME}    | scheme 部分,如果页面名称是一个 URL 地址 | 
-</code>+| {HOST}      | host 部分,如果页面名称是一个 URL 地址 | 
 +| {PORT}      | port 部分,如果页面名称是一个 URL 地址 | 
 +| {PATH}      | path 部分,如果页面名称是一个 URL 地址 | 
 +| {QUERY}     | query 部分,如果页面名称是一个 URL 地址 |
  
-跨维基 shortcut 必须使用小写字母且遵循[[pagename|页面名称]]规则+最后5个参数在创建指向 cachesystems 的跨维基链接时十分有用。具体参考位于 ''interwiki.conf'' 的 ''coral'' 快捷方式 。更多使用占位符例子可以在 ''conf/interwiki.conf'' 里找到
  
-维基设置文件的格式如下+比如,[[https://wiki.ubuntu.com/|Ubuntu 维基]] 使用像"LaptopTestingTeam/ToshibaPortegeM700" 这样的命名空间和页面名称,而你没有在 interwiki.local.conf 文件中使用 {NAME} 作为点位符,你会得到 “Not Found” 错误,因为斜杠会被解释成 %2F;所以你需要在你的 interwiki.local.conf 文件中添加一行 
 +<code>ubuntu https://wiki.ubuntu.com/{NAME}</code> 
 +and now create your link to it like this: 
 +<code>[[ubuntu>LaptopTestingTeam/ToshibaPortegeM700|Ubuntu Linux on Toshiba Portege M700 Tablet]]</code>
  
-  <shortcut>      <url to wiki> 
  
-The shortcut is the one you will be able to use in the link later. In the URL you can use some placeholders to be more flexible in linking. If no placeholder is given the [[phpfn>rawurlencode|URL-encoded]] wikiname will be appended to the URL. These placeholders are available:+===== 配置跨维基快捷方式的图标 =====
  
-^ Placeholder ^ Replaced by ^ +跨维基的图标大小为 16x16,格式为 PNG 或者 GIF 格式,以快捷方式命名。
-| {URL}       | URL-encoded wikiname (the part which is appended to the URL in interwiki.local.conf) | +
-| {NAME}      | wikiname without any encoding | +
-| {SCHEME}    | scheme part if an URL was given as wikiname | +
-| {HOST}      | host part if an URL was given as wikiname | +
-| {PORT}      | port part if an URL was given as wikiname | +
-| {PATH}      | path part if an URL was given as wikiname | +
-| {QUERY}     | query part if an URL was given as wikiname |+
  
-The last 5 parameters are useful when creating interwikilinks to cachesystems. Refer to the ''coral'' shortcut in the distributed ''interwiki.conf''+  * ''<dokuwiki_root>/lib/images/interwiki''\\ 为存放快捷方式图片的目录。
-Examples of these placeholders can found in conf/interwiki.conf+
  
-For example, [[https://wiki.ubuntu.com/|Ubuntu's wiki]] uses namespaces and pagenames like this "LaptopTestingTeam/ToshibaPortegeM700" and without using {NAME} as a placeholder in your interwiki.local.conf file, you'll get a Not Found error on their wiki, because it'll interpret the forward slash as a %2F ; so what you can do is add this line to your interwiki.local.conf: +如果你得到的是默认的图片而不是你刚刚上传的,你还需要清除下[[caching|缓存]]中的 PNG 、 GIF 图片和 CSS 文件。 
-<code>ubuntu https://wiki.ubuntu.com/{NAME}</code> + 
-and now create your link to it like this: +<code> 
-<code>[[ubuntu>LaptopTestingTeam/ToshibaPortegeM700|Ubuntu Linux on Toshiba Portege M700 Tablet]]</code>+rm -rf <dokuwiki_data>/data/cache/*/*.{gif,png,css} 
 +</code> 
 + 
 +禁用链接图标,请参考[[zh:tips:disabling_link_icons|禁用链接图标]].
zh/interwiki.1309087681.txt.gz · 最后更改: 2011-06-26 13:28 由 douo

除额外注明的地方外,本维基上的内容按下列许可协议发布: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki