diff --git a/build.gradle b/build.gradle index 9919a97..acbcd57 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ plugins { id "com.github.node-gradle.node" version "5.0.0" id "io.freefair.lombok" version "8.0.0-rc2" - id "run.halo.plugin.devtools" version "0.1.1" + id "run.halo.plugin.devtools" version "0.4.1" id 'java' } @@ -46,7 +46,7 @@ build { } halo { - version = '2.17.0' + version = '2.20' debug = true; } diff --git a/console/src/extensions/tags/index.ts b/console/src/extensions/tags/index.ts index d952189..a33fed6 100644 --- a/console/src/extensions/tags/index.ts +++ b/console/src/extensions/tags/index.ts @@ -63,7 +63,7 @@ export const TagsExtension = Mark.create({ default: null, renderHTML(attributes) { return { - href: `?tag=${encodeURI(attributes.tagText)}`, + href: `/moments?tag=${encodeURI(attributes.tagText)}`, "data-pjax": "", }; }, diff --git a/src/main/java/run/halo/moments/finders/impl/MomentFinderImpl.java b/src/main/java/run/halo/moments/finders/impl/MomentFinderImpl.java index 2c3e8de..36fc1d4 100644 --- a/src/main/java/run/halo/moments/finders/impl/MomentFinderImpl.java +++ b/src/main/java/run/halo/moments/finders/impl/MomentFinderImpl.java @@ -5,6 +5,7 @@ import static run.halo.app.extension.index.query.QueryFactory.equal; import jakarta.annotation.Nonnull; +import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Objects; import java.util.function.Predicate; @@ -12,6 +13,7 @@ import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.data.domain.Sort; +import org.springframework.web.util.UriUtils; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import run.halo.app.core.extension.Counter; @@ -109,6 +111,8 @@ public Flux listAllTags() { .map(count -> MomentTagVo.builder() .name(groupedFlux.key()) .momentCount(count.intValue()) + .permalink("/moments?tag=" + UriUtils.encode(groupedFlux.key(), + StandardCharsets.UTF_8)) .build() ) ); diff --git a/src/main/java/run/halo/moments/vo/MomentTagVo.java b/src/main/java/run/halo/moments/vo/MomentTagVo.java index 48a6d7d..8e8375b 100644 --- a/src/main/java/run/halo/moments/vo/MomentTagVo.java +++ b/src/main/java/run/halo/moments/vo/MomentTagVo.java @@ -1,7 +1,10 @@ package run.halo.moments.vo; import lombok.Builder; +import lombok.ToString; import lombok.Value; +import org.springframework.web.util.UriUtils; +import java.nio.charset.StandardCharsets; @Value @Builder @@ -9,5 +12,7 @@ public class MomentTagVo { String name; + String permalink; + Integer momentCount; }