forked from quarkiverse/quarkus-qute-web
-
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 pull request quarkiverse#101 from quarkiverse/seo
Fix quarkiverse#80: SEO tag for Qute
- Loading branch information
Showing
17 changed files
with
131 additions
and
36 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
8 changes: 6 additions & 2 deletions
8
...atter/runtime/src/main/java/io/quarkiverse/roq/frontmatter/runtime/RoqTemplateGlobal.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 |
---|---|---|
@@ -1,10 +1,14 @@ | ||
package io.quarkiverse.roq.frontmatter.runtime; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.Locale; | ||
import java.util.Objects; | ||
|
||
import io.quarkus.qute.TemplateGlobal; | ||
|
||
@TemplateGlobal | ||
public class RoqTemplateGlobal { | ||
public static LocalDateTime now = LocalDateTime.now(); | ||
} | ||
static LocalDateTime now = LocalDateTime.now(); | ||
static String roqVersion = Objects.toString(RoqTemplateGlobal.class.getPackage().getImplementationVersion(), "???"); | ||
static String locale = Locale.getDefault().toString(); | ||
} |
12 changes: 12 additions & 0 deletions
12
roq-frontmatter/runtime/src/main/resources/templates/tags/seo.html
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,12 @@ | ||
{#seoTitle pageTitle=page.title siteTitle=site.title /} | ||
{#seoDescription pageDescription=page.description siteDescription=site.description /} | ||
{#seoAuthor pageAuthor=page.author siteAuthor=site.author /} | ||
{#seoUrl pageUrl=page.url siteUrl=site.url /} | ||
{#seoType page /} | ||
{#seoImage page site /} | ||
{#seoVerifications webmasterVerifications=site.webmasterVerifications /} | ||
{#seoPaginator paginator=page.paginator /} | ||
{#seoFacebook facebook=site.facebook /} | ||
{#seoTwitter twitter=site.twitter /} | ||
{#seoLocale pageLocale=page.lang siteLocale=site.lang defaultLocale=global:locale /} | ||
{#seoGenerator name="Quarkus Roq" version=global:roqVersion /} |
5 changes: 5 additions & 0 deletions
5
roq-frontmatter/runtime/src/main/resources/templates/tags/seoAuthor.html
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,5 @@ | ||
{#if pageAuthor || siteAuthor} | ||
<!-- SEO AUTHOR --> | ||
<meta property="article:author" content="{pageAuthor ?: siteAuthor}" /> | ||
<meta name="author" content="{pageAuthor ?: siteAuthor}" /> | ||
{/if} |
6 changes: 6 additions & 0 deletions
6
roq-frontmatter/runtime/src/main/resources/templates/tags/seoDescription.html
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,6 @@ | ||
{#if pageDescription || siteDescription} | ||
<!-- SEO DESCRIPTION --> | ||
<meta name="description" content="{pageDescription ?: siteDescription}"> | ||
<meta property="og:description" content="{pageDescription ?: siteDescription}" /> | ||
<meta name="twitter:description" content="{pageDescription ?: siteDescription}"> | ||
{/if} |
14 changes: 14 additions & 0 deletions
14
roq-frontmatter/runtime/src/main/resources/templates/tags/seoFacebook.html
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,14 @@ | ||
{#if facebook} | ||
<!-- SEO FACEBOOK --> | ||
{#if facebook.admins} | ||
<meta property="fb:admins" content="{facebook.admins}" /> | ||
{/if} | ||
|
||
{#if facebook.publisher} | ||
<meta property="article:publisher" content="{facebook.publisher}" /> | ||
{/if} | ||
|
||
{#if facebook.app_id} | ||
<meta property="fb:app_id" content="{facebook.app_id}" /> | ||
{/if} | ||
{/if} |
4 changes: 4 additions & 0 deletions
4
roq-frontmatter/runtime/src/main/resources/templates/tags/seoGenerator.html
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,4 @@ | ||
{#if name} | ||
<!-- SEO GENERATOR --> | ||
<meta name="generator" content="{name} v{version}" /> | ||
{/if} |
9 changes: 9 additions & 0 deletions
9
roq-frontmatter/runtime/src/main/resources/templates/tags/seoImage.html
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,9 @@ | ||
{#if page.img and site.rootUrl} | ||
<!-- SEO IMAGE --> | ||
<meta name="twitter:card" content="summary_large_image" /> | ||
<meta name="twitter:image:src" content="{page.img.toUrl.absoluteOrElseFrom(site.rootUrl.relative.resolve('static/images/'))}" /> | ||
<meta property="og:image" content="{page.img.toUrl.absoluteOrElseFrom(site.rootUrl.relative.resolve('static/images/'))}" /> | ||
{#else} | ||
<!-- SEO IMAGE --> | ||
<meta name="twitter:card" content="summary"> | ||
{/if} |
7 changes: 7 additions & 0 deletions
7
roq-frontmatter/runtime/src/main/resources/templates/tags/seoLocale.html
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,7 @@ | ||
{#if pageLocale || siteLocale} | ||
<!-- SEO LOCALE --> | ||
<meta property="og:locale" content="{pageLocale ?: siteLocale}" /> | ||
{#else} | ||
<!-- SEO LOCALE --> | ||
<meta property="og:locale" content="{defaultLocale}" /> | ||
{/if} |
9 changes: 9 additions & 0 deletions
9
roq-frontmatter/runtime/src/main/resources/templates/tags/seoPaginator.html
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,9 @@ | ||
{#if paginator} | ||
<!-- SEO PAGINATOR --> | ||
{#if paginator.previous} | ||
<link rel="prev" href="{paginator.previous.relative}" /> | ||
{/if} | ||
{#if paginator.next} | ||
<link rel="next" href="{paginator.next.relative}" /> | ||
{/if} | ||
{/if} |
10 changes: 10 additions & 0 deletions
10
roq-frontmatter/runtime/src/main/resources/templates/tags/seoTitle.html
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,10 @@ | ||
{#if pageTitle || siteTitle} | ||
<!-- SEO TITLE --> | ||
<title> | ||
{#if pageTitle ne siteTitle}{pageTitle} - {siteTitle}{#else}{siteTitle}{/if} | ||
</title> | ||
<meta name="twitter:title" content="{#if pageTitle ne siteTitle}{pageTitle} - {siteTitle}{#else}{siteTitle}{/if}"> | ||
{/if} | ||
{#if siteTitle} | ||
<meta property="og:site_name" content="{siteTitle}"> | ||
{/if} |
5 changes: 5 additions & 0 deletions
5
roq-frontmatter/runtime/src/main/resources/templates/tags/seoTwitter.html
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,5 @@ | ||
{#if twitter} | ||
<!-- SEO TWITTER --> | ||
<meta name="twitter:site" content="@{twitter}" /> | ||
<meta name="twitter:creator" content="@{twitter}" /> | ||
{/if} |
8 changes: 8 additions & 0 deletions
8
roq-frontmatter/runtime/src/main/resources/templates/tags/seoType.html
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 @@ | ||
{#if it.date} | ||
<!-- SEO TYPE --> | ||
<meta property="og:type" content="article" /> | ||
<meta property="article:published_time" content="{it.date}" /> | ||
{#else} | ||
<!-- SEO TYPE --> | ||
<meta property="og:type" content="website" /> | ||
{/if} |
6 changes: 6 additions & 0 deletions
6
roq-frontmatter/runtime/src/main/resources/templates/tags/seoUrl.html
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,6 @@ | ||
{#if pageUrl || siteUrl} | ||
<!-- SEO URL --> | ||
<link rel="canonical" href="{pageUrl ?: siteUrl.absolute}" /> | ||
<meta property="og:url" content="{pageUrl ?: siteUrl.absolute}" /> | ||
<meta name="twitter:url" content="{pageUrl ?: siteUrl.absolute}"> | ||
{/if} |
21 changes: 21 additions & 0 deletions
21
roq-frontmatter/runtime/src/main/resources/templates/tags/seoVerifications.html
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,21 @@ | ||
{#if webmasterVerifications} | ||
<!-- SEO VERIFICATION --> | ||
{#if webmasterVerifications.google} | ||
<meta name="google-site-verification" content="{webmasterVerifications.google}"> | ||
{/if} | ||
{#if webmasterVerifications.bing} | ||
<meta name="msvalidate.01" content="{webmasterVerifications.bing}"> | ||
{/if} | ||
{#if webmasterVerifications.alexa} | ||
<meta name="alexaVerifyID" content="{webmasterVerifications.alexa}"> | ||
{/if} | ||
{#if webmasterVerifications.yandex} | ||
<meta name="yandex-verification" content="{webmasterVerifications.yandex}"> | ||
{/if} | ||
{#if webmasterVerifications.baidu} | ||
<meta name="baidu-site-verification" content="{webmasterVerifications.baidu}"> | ||
{/if} | ||
{#if webmasterVerifications.facebook} | ||
<meta name="facebook-domain-verification" content="{webmasterVerifications.facebook}"> | ||
{/if} | ||
{/if} |