forked from halo-dev/halo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'halo-dev:main' into main
- Loading branch information
Showing
501 changed files
with
23,125 additions
and
1,510 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# This configuration file was automatically generated by Gitpod. | ||
# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml) | ||
# and commit this file to your remote git repository to share the goodness with others. | ||
|
||
# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart | ||
|
||
tasks: | ||
- init: ./gradlew clean build -x check && sdk install java 17.0.3-ms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
FROM eclipse-temurin:17-jre as builder | ||
|
||
WORKDIR application | ||
ARG JAR_FILE=application/build/libs/*.jar | ||
COPY ${JAR_FILE} application.jar | ||
RUN java -Djarmode=layertools -jar application.jar extract | ||
|
||
################################ | ||
|
||
FROM eclipse-temurin:17-jre | ||
FROM ibm-semeru-runtimes:open-17-jre | ||
MAINTAINER johnniang <[email protected]> | ||
WORKDIR application | ||
COPY --from=builder application/dependencies/ ./ | ||
|
@@ -22,4 +23,4 @@ ENV JVM_OPTS="-Xmx256m -Xms256m" \ | |
RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime \ | ||
&& echo $TZ > /etc/timezone | ||
|
||
ENTRYPOINT ["sh", "-c", "java ${JVM_OPTS} org.springframework.boot.loader.JarLauncher ${0} ${@}"] | ||
ENTRYPOINT ["sh", "-c", "java ${JVM_OPTS} org.springframework.boot.loader.launch.JarLauncher ${0} ${@}"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
api/src/main/java/run/halo/app/theme/TemplateNameResolver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package run.halo.app.theme; | ||
|
||
import org.springframework.web.server.ServerWebExchange; | ||
import reactor.core.publisher.Mono; | ||
|
||
/** | ||
* <p>The {@link TemplateNameResolver} is used to resolve template name.</p> | ||
* <code>Halo</code> has a theme mechanism, template files are provided by different themes, so | ||
* we need a method to determine whether the template file exists in the activated theme and if | ||
* it does not exist, provide a default template name. | ||
* | ||
* @author guqing | ||
* @since 2.11.0 | ||
*/ | ||
public interface TemplateNameResolver { | ||
|
||
/** | ||
* Resolve template name if exists or default template name in classpath. | ||
* | ||
* @param exchange exchange to resolve theme to use | ||
* @param name template | ||
* @return template name if exists or default template name in classpath | ||
*/ | ||
Mono<String> resolveTemplateNameOrDefault(ServerWebExchange exchange, String name); | ||
|
||
/** | ||
* Resolve template name if exists or default template given. | ||
* | ||
* @param exchange exchange to resolve theme to use | ||
* @param name template name | ||
* @param defaultName default template name to use if given template name not exists | ||
* @return template name if exists or default template name given | ||
*/ | ||
Mono<String> resolveTemplateNameOrDefault(ServerWebExchange exchange, String name, | ||
String defaultName); | ||
|
||
/** | ||
* Determine whether the template file exists in the current theme. | ||
* | ||
* @param exchange exchange to resolve theme to use | ||
* @param name template name | ||
* @return <code>true</code> if the template file exists in the current theme, false otherwise | ||
*/ | ||
Mono<Boolean> isTemplateAvailableInTheme(ServerWebExchange exchange, String name); | ||
} |
Oops, something went wrong.