- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 34 of file SocialNet.java.
◆ SocialNet()
org.turro.elephant.web.SocialNet.SocialNet |
( |
String |
url, |
|
|
String |
title, |
|
|
String |
description, |
|
|
Collection< RepositoryFile > |
files |
|
) |
| |
Definition at line 39 of file SocialNet.java.
42 this.description = escape(description);
43 Repository repository = ElContextMap.getRoot().getRepository();
44 files.addAll(repository.getRepositoryFiles(
"*_def_social.png,*_def_social.jpg"));
45 SocialImageMap.initialize(
this, files);
◆ getMetas()
List<String> org.turro.elephant.web.SocialNet.getMetas |
( |
| ) |
|
Definition at line 64 of file SocialNet.java.
65 ArrayList<String> metas =
new ArrayList<>();
69 metas.add(
"<meta name=\"twitter:card\" content=\"summary\">");
71 metas.add(
"<meta name=\"twitter:card\" content=\"summary_large_image\">");
73 metas.add(
"<meta name=\"twitter:title\" content=\"" + escape(title) +
"\"/>");
74 if(!Strings.isBlank(description)) {
75 metas.add(
"<meta name=\"twitter:description\" content=\"" + Strings.truncateAndWarn(description, 250) +
"\"/>");
78 metas.add(
"<meta name=\"twitter:image\" content=\"" + ElephantContext.getServerBase(
"http") + image.
getUrl() +
"\"/>");
82 metas.add(
"<meta property=\"og:site_name\" content=\"" + ElephantContext.getSiteName() +
"\"/>");
83 metas.add(
"<meta property=\"og:type\" content=\"website\"/>");
84 metas.add(
"<meta property=\"og:url\" content=\"" + ElephantContext.getServerBase(
"http") + url +
"\"/>");
85 metas.add(
"<meta property=\"og:title\" content=\"" + escape(title) +
"\"/>");
86 if(!Strings.isBlank(description)) {
87 metas.add(
"<meta property=\"og:description\" content=\"" + Strings.truncateAndWarn(description, 250) +
"\"/>");
90 metas.add(
"<meta property=\"og:image\" content=\"" + ElephantContext.getServerBase(
"http") + image.
getUrl() +
"\"/>");
◆ getUrl()
String org.turro.elephant.web.SocialNet.getUrl |
( |
| ) |
|
◆ hasImage()
boolean org.turro.elephant.web.SocialNet.hasImage |
( |
| ) |
|
◆ hasLarge()
boolean org.turro.elephant.web.SocialNet.hasLarge |
( |
| ) |
|
◆ setImage()
void org.turro.elephant.web.SocialNet.setImage |
( |
SocialImage |
image | ) |
|
The documentation for this class was generated from the following file: