Files
docs/versioned_docs/version-2.19/developer-guide/plugin/api-reference/server/extension-points/singlepage-content.md
Ryan Wang e431bdc99b docs: update documentation for Halo 2.18 (#407)
Signed-off-by: Ryan Wang <i@ryanc.cc>
2024-09-02 14:14:00 +08: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