title: $:/plugins/Gk0Wk/CPL-Repo/templates/cpl/home-tab
code-body: yes
created: 20231007150846632
modified: 20231009075737169
tags: 
type: text/vnd.tiddlywiki

\import $:/plugins/Gk0Wk/CPL-Repo/templates/cpl/plugin-gallery-item
\import $:/plugins/Gk0Wk/notionpage-covericon/body

<$list filter="[<currentTab>match[Home]]">
<!-- 搜索 -->
<center>
<$edit-text tiddler="$:/temp/searchplugin/input" default="" placeholder={{{ [[$:/language]get[text]removeprefix[$:/languages/]else[en-GB]search[zh]then[搜索插件]else[Search for plugin]] }}} focus="true" tag=input class="tc-titlebar tc-edit-texteditor cpl-website-mainpage-search-bar"/>
</center>
<!-- 呈现：仅在有搜索词时展示结果 -->
<$set value={{$:/temp/searchplugin/input!!text}} name="search">
<$list filter="[<search>trim[]length[]compare:integer:gt[0]]" variable="go">
<div style="margin-top: 10px;display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); grid-auto-rows: 1fr; gap: 16px;">
<$list filter="[all[tiddlers]tag[$:/tags/PluginWiki]!is[draft]search:cpl.title,cpl.name,cpl.author<search>sortbycount[]]" variable="plugin">
<$macrocall $name="plugin-item" title=<<plugin>> />
</$list>
</div>
</$list>
</$set>
</$list>
<$list filter="[<currentTab>!match[Home]]">
<div style="margin-top: 10px;display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); grid-auto-rows: 1fr; gap: 16px;">
<$list filter="[<currentTab>match[Language]]">
<$list filter="[all[tiddlers]tag[$:/tags/PluginWiki]field:cpl.category<currentTab>] [all[tiddlers]tag[$:/tags/PluginWiki]field:cpl.plugin-type[language]] +[unique[]]" variable="plugin">
<$macrocall $name="plugin-item" title=<<plugin>> />
</$list>
</$list>
<$list filter="[<currentTab>!match[Language]]">
<$list filter="[all[tiddlers]tag[$:/tags/PluginWiki]field:cpl.category<currentTab>]" variable="plugin">
<$macrocall $name="plugin-item" title=<<plugin>> />
</$list>
</$list>
</div>
</$list>