bmarwell commented on a change in pull request #117:
URL: https://github.com/apache/shiro-site/pull/117#discussion_r727831209
##########
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:
we can insert `property="og:author"` later. But it requires a facebook
page, so we would need a mapping (preferrably in a file `authors.yaml`) to map
from author to facebook profile, if present. And then it only works if it is
public and you can follow it.
Might be more interesting to use twitter tags here.
--
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]