diff --git a/discord/build.gradle b/discord/build.gradle index af22e3b..19982c8 100644 --- a/discord/build.gradle +++ b/discord/build.gradle @@ -14,7 +14,7 @@ repositories { dependencies { implementation('org.springframework.boot:spring-boot-starter-web') - implementation('org.springframework.boot:spring-boot-starter-thymeleaf') + implementation('org.springframework.boot:spring-boot-starter-freemarker') implementation('org.springframework.boot:spring-boot-starter-security') implementation('org.springframework.security:spring-security-oauth2-client') diff --git a/discord/src/main/resources/application.yml b/discord/src/main/resources/application.yml index 29b0d56..c6a403e 100644 --- a/discord/src/main/resources/application.yml +++ b/discord/src/main/resources/application.yml @@ -5,10 +5,13 @@ server: debug: false spring: + freemarker: + template-loader-path: classpath:/templates + suffix: .ftlh security: oauth2: client: registration: discord: client-id: 965013316982423632 - client-secret: yhb13RP26WxfOru9fcQ6CxPcAUWr_2q6 \ No newline at end of file + client-secret: yhb13RP26WxfOru9fcQ6CxPcAUWr_2q6 diff --git a/discord/src/main/resources/templates/includes/foother.ftlh b/discord/src/main/resources/templates/includes/foother.ftlh new file mode 100644 index 0000000..308b1d0 --- /dev/null +++ b/discord/src/main/resources/templates/includes/foother.ftlh @@ -0,0 +1,2 @@ + + diff --git a/discord/src/main/resources/templates/secret.html b/discord/src/main/resources/templates/includes/header.ftlh similarity index 75% rename from discord/src/main/resources/templates/secret.html rename to discord/src/main/resources/templates/includes/header.ftlh index 0483bc1..c1a7cee 100644 --- a/discord/src/main/resources/templates/secret.html +++ b/discord/src/main/resources/templates/includes/header.ftlh @@ -7,6 +7,3 @@

Discord OAuth2 Example


-

[TOP SECRET PAGE]

- - \ No newline at end of file diff --git a/discord/src/main/resources/templates/index.ftlh b/discord/src/main/resources/templates/index.ftlh new file mode 100644 index 0000000..a82db69 --- /dev/null +++ b/discord/src/main/resources/templates/index.ftlh @@ -0,0 +1,7 @@ +<#include "includes/header.ftlh"> +

+ Home public page
+ ---> Secret Page <---
+ [ Login Discord ] +

+<#include "includes/foother.ftlh"> diff --git a/discord/src/main/resources/templates/index.html b/discord/src/main/resources/templates/index.html deleted file mode 100644 index 5c09227..0000000 --- a/discord/src/main/resources/templates/index.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - Discord OAuth2 Example - - - -

Discord OAuth2 Example

-
-

- Home public page
- ---> Secret Page <---
- [ Login Discord ] -

- - \ No newline at end of file diff --git a/discord/src/main/resources/templates/secret.ftlh b/discord/src/main/resources/templates/secret.ftlh new file mode 100644 index 0000000..c54425a --- /dev/null +++ b/discord/src/main/resources/templates/secret.ftlh @@ -0,0 +1,3 @@ +<#include "includes/header.ftlh"> +

[TOP SECRET PAGE]

+<#include "includes/foother.ftlh"> diff --git a/github/build.gradle b/github/build.gradle index af22e3b..19982c8 100644 --- a/github/build.gradle +++ b/github/build.gradle @@ -14,7 +14,7 @@ repositories { dependencies { implementation('org.springframework.boot:spring-boot-starter-web') - implementation('org.springframework.boot:spring-boot-starter-thymeleaf') + implementation('org.springframework.boot:spring-boot-starter-freemarker') implementation('org.springframework.boot:spring-boot-starter-security') implementation('org.springframework.security:spring-security-oauth2-client') diff --git a/github/src/main/resources/application.yml b/github/src/main/resources/application.yml index eb53ee4..93299c0 100644 --- a/github/src/main/resources/application.yml +++ b/github/src/main/resources/application.yml @@ -5,6 +5,9 @@ server: debug: false spring: + freemarker: + template-loader-path: classpath:/templates + suffix: .ftlh security: oauth2: client: diff --git a/github/src/main/resources/templates/includes/foother.ftlh b/github/src/main/resources/templates/includes/foother.ftlh new file mode 100644 index 0000000..308b1d0 --- /dev/null +++ b/github/src/main/resources/templates/includes/foother.ftlh @@ -0,0 +1,2 @@ + + diff --git a/github/src/main/resources/templates/secret.html b/github/src/main/resources/templates/includes/header.ftlh similarity index 74% rename from github/src/main/resources/templates/secret.html rename to github/src/main/resources/templates/includes/header.ftlh index b5f1ba8..ec65274 100644 --- a/github/src/main/resources/templates/secret.html +++ b/github/src/main/resources/templates/includes/header.ftlh @@ -7,6 +7,3 @@

GitHub OAuth2 Example


-

[TOP SECRET PAGE]

- - diff --git a/github/src/main/resources/templates/index.ftlh b/github/src/main/resources/templates/index.ftlh new file mode 100644 index 0000000..52deeec --- /dev/null +++ b/github/src/main/resources/templates/index.ftlh @@ -0,0 +1,7 @@ +<#include "includes/header.ftlh"> +

+ Home public page
+ ---> Secret Page <---
+ [ Login GitHub ] +

+<#include "includes/foother.ftlh"> diff --git a/github/src/main/resources/templates/index.html b/github/src/main/resources/templates/index.html deleted file mode 100644 index 73f5702..0000000 --- a/github/src/main/resources/templates/index.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - GitHub OAuth2 Example - - - -

GitHub OAuth2 Example

-
-

- Home public page
- ---> Secret Page <---
- [ Login GitHub ] -

- - diff --git a/github/src/main/resources/templates/secret.ftlh b/github/src/main/resources/templates/secret.ftlh new file mode 100644 index 0000000..c54425a --- /dev/null +++ b/github/src/main/resources/templates/secret.ftlh @@ -0,0 +1,3 @@ +<#include "includes/header.ftlh"> +

[TOP SECRET PAGE]

+<#include "includes/foother.ftlh">