Files
docs/versioned_docs/version-2.17/developer-guide/plugin/api-reference/server/extension-points/singlepage-content.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

1.3 KiB

title, description
title description
主题端自定义页面内容处理 提供扩展主题端自定义页面内容处理的方法,干预自定义页面内容的渲染。

主题端自定义页面内容处理扩展点,作用同 主题端文章内容处理 扩展点,只是作用于自定义页面。

public interface ReactiveSinglePageContentHandler extends ExtensionPoint {
   
    Mono<SinglePageContentContext> handle(@NonNull SinglePageContentContext singlePageContent);

    @Data
    @Builder
    class SinglePageContentContext {
        private SinglePage singlePage;
        private String content;
        private String raw;
        private String rawType;
    }
}

ReactiveSinglePageContentHandler 对应的 ExtensionPointDefinition 如下:

apiVersion: plugin.halo.run/v1alpha1
kind: ExtensionPointDefinition
metadata:
  name: reactive-singlepage-content-handler
spec:
  className: run.halo.app.theme.ReactiveSinglePageContentHandler
  displayName: ReactiveSinglePageContentHandler
  type: MULTI_INSTANCE
  description: "Provides a way to extend the single page content to be displayed on the theme-side."

即声明 ExtensionDefinition 自定义模型对象时对应的 extensionPointNamereactive-singlepage-content-handler