.getProperty(JCR_LAST_MODIFIED).getDate() : null;
String url = CmsUtils.getCanonicalUrl(node, request);
String imgUrl = null;
- for (NodeIterator it = node.getNodes(); it.hasNext();) {
+ loop: for (NodeIterator it = node.getNodes(); it.hasNext();) {
+ // Takes the first found cms:image
Node child = it.nextNode();
- if (child.isNodeType(CMS_IMAGE))
+ if (child.isNodeType(CMS_IMAGE)){
imgUrl = CmsUtils.getDataUrl(child, request);
+ break loop;
+ }
}
StringBuilder buf = new StringBuilder();
buf.append("<html>");
buf.append("<head>");
writeMeta(buf, "og:title", title);
writeMeta(buf, "og:type", "website");
+ buf.append("<meta name='twitter:card' content='summary' />");
+ buf.append("<meta name='twitter:site' content='@argeo_org' />");
writeMeta(buf, "og:url", url);
if (desc != null)
writeMeta(buf, "og:description", desc);