Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove deprecated plugin wrapper #6

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

import java.util.Properties;
import lombok.RequiredArgsConstructor;
import org.pf4j.PluginWrapper;
import org.springframework.stereotype.Component;
import org.springframework.util.PropertyPlaceholderHelper;
import org.thymeleaf.context.ITemplateContext;
import org.thymeleaf.model.IModel;
import org.thymeleaf.model.IModelFactory;
import org.thymeleaf.processor.element.IElementModelStructureHandler;
import reactor.core.publisher.Mono;
import run.halo.app.plugin.PluginContext;
import run.halo.app.theme.dialect.TemplateHeadProcessor;

@Component
Expand All @@ -19,7 +19,7 @@ public class HyperLinkHeadProcessor implements TemplateHeadProcessor {
static final PropertyPlaceholderHelper PROPERTY_PLACEHOLDER_HELPER =
new PropertyPlaceholderHelper("${", "}");

private final PluginWrapper pluginWrapper;
private final PluginContext pluginContext;

@Override
public Mono<Void> process(ITemplateContext context, IModel model,
Expand All @@ -32,7 +32,7 @@ public Mono<Void> process(ITemplateContext context, IModel model,
private String hyperlinkCardComponentScript() {

final Properties properties = new Properties();
properties.setProperty("version", pluginWrapper.getDescriptor().getVersion());
properties.setProperty("version", pluginContext.getVersion());

return PROPERTY_PLACEHOLDER_HELPER.replacePlaceholders("""
<!-- plugin-editor-hyperlink-card start -->
Expand Down