bmarwell commented on a change in pull request #117:
URL: https://github.com/apache/shiro-site/pull/117#discussion_r727835801
##########
File path: jbake/templates/header.ftl
##########
@@ -21,28 +21,79 @@
<html lang="en">
<head>
<meta charset="utf-8"/>
- <title>
- <#if (content.title)?? && (content.title)?contains("|")>
- <#-- The page has a full custom title, render it directly: -->
- ${content.title}
- <#elseif (content.title)??>
- <#-- standard title, append the project name appended for SEO: -->
- ${content.title} | Apache Shiro
- <#else>
- <#-- No title found in the page metadata, set the default: -->
- Apache Shiro | Simple. Java. Security.
- </#if>
- </title>
+ <#if (content.title)?? && (content.title)?contains("|")>
+ <#-- The page has a full custom title, render it directly: -->
+ <#assign ftltitle="${content.title}" />
+ <#elseif (content.title)??>
+ <#-- standard title, append the project name appended for SEO: -->
+ <#assign ftltitle="${content.title} | Apache Shiro" />
+ <#else>
+ <#-- No title found in the page metadata, set the default: -->
+ <#assign ftltitle="Apache Shiro | Simple. Java. Security." />
+ </#if>
+ <title>${ftltitle}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="description" content="">
- <meta name="author" content="">
- <meta name="keywords" content="">
+ <#if (content.description)??>
+ <meta name="description" content="${content.description}">
+ <meta property="og:description" content="${content.description}">
+ <#else>
+ <meta name="description" content="Apache Shiro is a powerful and
easy-to-use Java security framework that performs authentication,
authorization, cryptography, and session management.">
+ <#-- leave out og:description, so it will fill from the body. -->
+ </#if>
+ <#if (content.type == "post") && (content.author)??>
+ <meta name="author" content="${content.author}">
+ </#if>
Review comment:
Yup, we can do this:
```
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@apacheshiro" />
<meta name="twitter:creator" content="@briandemers" />
```
We would just need to map author metadata for jbake to parse.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]