Template:URL/doc

出自维基百科,自由个百科全书


迭個模板好用來創建格式化嗰外部連結。

Note - this template is for formatting the appearance of displayed URLs, while making them machine-readable as part of emitted microformat meta-data.

如果儂想用文字,而非URL(像用了[]嗰「BBC website」),請不要用迭個模板。建議勒正文裡向用[]來嵌URL。

For web-based references, please see Wikipedia:Citation templates

使用方法[编辑]

  • {{URL|1=url 連結|2=需要顯示嗰文字}}
    • 寫進完整嗰URL,第一個參數就會得畀分析。如果沒用「http://」、「https://」、「ftp://」開頭,就會得自動加上「http://」開頭。
    • 第二個參數不再建議使用

敬告:第一個參數當中嗰「1」一定要寫上,如果URL當中有「=」。

例子[编辑]

Code 顯示效果 備註
{{ URL }} {{URL|example.com|选填个显示文本}}
{{ URL | }} {{URL|example.com|选填个显示文本}}
{{ URL | EXAMPLE.com }} example.com 大寫嗰字母會自動轉寫成小寫
{{ URL | example.com }} example.com
{{ URL | www.example.com }} www.example.com
{{ URL | http://www.example.com }} www.example.com
{{ URL | https://www.example.com }} www.example.com
{{ URL | ftp://www.example.com }} www.example.com
{{ URL | ftp://ftp.example.com }} ftp.example.com
{{ URL | http://www.example.com/ }} www.example.com
{{ URL | http://www.example.com/path }} www.example.com/path
{{ URL | irc://irc.example.com/channel }} irc.example.com/channel
{{ URL | www.example.com/foo }} www.example.com/foo
{{ URL | http://www.example.com/path/ }} www.example.com/path/
{{ URL | www.example.com/foo/ }} www.example.com/foo/
{{ URL | 1=http://www.example.com/path?section=17 }} www.example.com/path?section=17 連結當中有「=」
{{ URL | 1=www.example.com/foo?page=42 }} www.example.com/foo?page=42 連結當中有「=」
{{ URL | http://www.example.com/foo | link }} link (已廢棄)
{{ URL | www.example.com/foo | link }} link (已廢棄)
{{ URL | http://www.example.com/foo/ | link }} link (已廢棄)
{{ URL | www.example.com/foo/ | link }} link (已廢棄)