Files
docs/versioned_docs/version-2.17/developer-guide/theme/finder-apis/plugin.md
Ryan Wang 9d868fa50e docs: update documentation for Halo 2.17 (#378)
为 [Halo 2.17](https://github.com/halo-dev/halo/releases/tag/v2.17.0) 更新文档。

/kind documentation

```release-note
None
```
2024-07-02 02:41:22 +00:00

575 B

title, description
title description
插件 插件 - PluginFinder

available(pluginName)

pluginFinder.available(pluginName)

描述

判断一个插件是否可用,会同时判断插件是否安装和启用。

参数

  1. pluginName:string - 插件的唯一标识 metadata.name

返回值

boolean - 插件是否可用

示例

<!-- https://github.com/halo-sigs/plugin-search-widget -->
<li th:if="${pluginFinder.available('PluginSearchWidget')}">
  <a href="javascript:SearchWidget.open()" title="搜索">
    搜索
  </a>
</li>