跳到正文
编写
登录

模板:页面导航条:修订间差异

更多
Musicraft​(留言 | 贡献)
无编辑摘要
迷雾样式迁移​(留言 | 贡献)
统一编年史字体、正文组件与编辑模板;保留原始内容和历史
第1行: 第1行:
<div style="flex:1 1 {{{width|calc(50% - 10px)}}};min-width:{{{minwidth|200px}}};box-sizing:border-box;padding:{{{padding|10px 14px}}};background:{{{bgcolor|#161b22}}};border-radius:{{{radius|8px}}};border-left:3px solid {{{color|#58a6ff}}};">{{{icon|}}}&#32;{{#if:{{{href|}}}|[{{{href|}}} {{{text|Link}}}]|{{#if:{{{page|}}}|[[{{{page|}}}|{{{text|{{{page|}}}}}}]]}}}}{{#if:{{{desc|}}}|&#32;<span style="color:#8b949e;">— {{{desc|}}}</span>}}</div><noinclude>
<includeonly>{{卡片|标题={{{text|导航}}}|图标={{{icon|}}}|内容={{{desc|}}}|链接={{{href|}}}|内链={{{page|}}}|链接文字={{{text|查看}}}}}</includeonly><noinclude>
== 模板简介 ==
[[编写模板|← 编辑组件手册]]
'''页面导航条''' 是 [[模板:页面导航头]] 网格容器内的单张卡片。每次调用渲染一张卡片,可无限重复调用以增删内容。


=== 参数说明 ===
编年史统一编辑组件。用法和示例见 [[编写模板]]。
{| class="wikitable" style="width:100%;"
! 参数 !! 默认值 !! 说明
|-
| <code>icon</code> || (空) || 卡片前缀图标,推荐使用 Emoji(📝 📄 📚 🧩 🔧 🏠 等)
|-
| <code>page</code> || — || 站内页面名称,生成内链(与<code>href</code> 二选一)
|-
| <code>href</code> || — || 外部链接 URL,优先级高于 <code>page</code>
|-
| <code>text</code> ||页面名 / Link || 链接显示文字;内链不填时自动显示页面名
|-
| <code>desc</code> || (空) || 链接后的描述文字,不填则不显示「— 描述」部分
|-
| <code>color</code> || <code>#58a6ff</code> ||卡片左侧强调色条颜色
|-
| <code>bgcolor</code> || <code>#161b22</code> || 卡片背景色
|-
| <code>radius</code> || <code>8px</code> || 卡片圆角大小
|-
| <code>padding</code> || <code>10px 14px</code> || 卡片内边距
|-
| <code>width</code> || <code>calc(50% - 10px)</code> || 卡片弹性基准宽度,控制列数(见下方说明)
|-
| <code>minwidth</code> || <code>200px</code> || 卡片最小宽度,防止在窄屏下过度压缩
|}
 
=== 列数控制(width参数)===
{| class="wikitable"
! 布局 !! width 值
|-
| 2 列(默认) || <code>calc(50% - 10px)</code>
|-
| 3 列 || <code>calc(33% - 10px)</code>
|-
| 单列(全宽) || <code>100%</code>
|}
 
===颜色预设 ===
{| class="wikitable"
! 颜色 !! 色值 !! 建议用途
|-
| 蓝色 || <code>#58a6ff</code> || Wiki编辑、教程类
|-
| 紫色 || <code>#d2a8ff</code> || 档案、归档类
|-
| 绿色 || <code>#56d364</code> || 工具、首页类
|-
| 橙色 || <code>#f0883e</code> || 特别推荐、警示类
|}
<templatedata>
<templatedata>
{
{
"params": {
  "description": "编年史统一编辑组件。用法和示例见 [[编写模板]]。",
"width": {
  "format": "block",
"label": "卡片列数",
  "params": {
"description": "只支持2,3列,不填为2列",
    "text": {
"example": "2,3",
      "label": "text",
"type": "number",
      "type": "content"
"suggestedvalues": [
    },
"3"
    "icon": {
]
      "label": "icon",
},
      "type": "content"
"minwidth": {},
    },
"padding": {},
    "desc": {
"bgcolor": {},
      "label": "desc",
"radius": {},
      "type": "content"
"color": {
    },
"label": "颜色",
    "href": {
"description": "卡片左侧强调色条颜色",
      "label": "href",
"suggestedvalues": [
      "type": "content"
"#58a6ff",
    },
"#d2a8ff",
    "page": {
"#56d364",
      "label": "page",
"#f0883e"
      "type": "content"
]
    }
},
  }
"icon": {
"label": "前缀图标",
"description": "推荐使用 Emoji(📝 📄 📚 🧩 🔧 🏠 等)"
},
"href": {
"label": "外部链接",
"description": "URL,优先级高于站内名称,二选一"
},
"text": {
"label": "页面名 / Link",
"description": "链接显示文字;内链不填时自动显示页面名"
},
"page": {
"label": "站内页面名称",
"description": "生成内链(与外部链接二选一)"
},
"desc": {
"label": "描述",
"description": "链接后的描述文字,不填则不显示「— 描述」部分"
}
},
"paramOrder": [
"icon",
"page",
"href",
"text",
"desc",
"color",
"width",
"minwidth",
"padding",
"bgcolor",
"radius"
]
}
}
</templatedata></noinclude>
</templatedata>
</noinclude>

2026年10月13日 (二) 13:33的版本

← 编辑组件手册

编年史统一编辑组件。用法和示例见 编写模板。

编年史统一编辑组件。用法和示例见 [[编写模板]]。

模板参数[编辑模板数据]

此模板首选参数换行的代码块格式。

参数描述类型状态
texttext

无描述

内容可选
iconicon

无描述

内容可选
descdesc

无描述

内容可选
hrefhref

无描述

内容可选
pagepage

无描述

内容可选
迷雾 Wiki
搜索迷雾 Wiki
阅读设置