this.config = config;
}
- public static void appendHTMLHead(StringBuffer sb, Configuration config)
+ public static void appendHTMLHead(StringBuffer sb, String title, Configuration config)
throws IOException {
File f;
sb.append("<head>\n");
sb.append(new String(Files.readAllBytes(f.toPath()),
StandardCharsets.UTF_8));
+ sb.append("<title>");
+ sb.append(title);
+ sb.append("</title>");
sb.append("</head>\n");
}
- private void appendHTMLHead(StringBuffer sb) throws IOException {
- appendHTMLHead(sb, config);
+ private void appendHTMLHead(StringBuffer sb, String title) throws IOException {
+ appendHTMLHead(sb, title, config);
}
public static void appendHTMLContentHeader(StringBuffer sb, String title) {
buf = new StringBuffer();
- appendHTMLHead(buf);
+ appendHTMLHead(buf, entry.getTitle());
buf.append("<body>\n");
buf = new StringBuffer();
- appendHTMLHead(buf);
+ appendHTMLHead(buf, config.getFeedTitle());
buf.append("<body>\n");
buf.append("<div id='content'>\n");
cmp = new Comparator<SyndEntry>() {
-
@Override
public int compare(SyndEntry o1, SyndEntry o2) {
return o2.getPublishedDate().compareTo(o1.getPublishedDate());
- }
-
+ }
};
sortedEntries = new ArrayList<SyndEntry>(entries);
for(SyndEntry e: sortedEntries) {
buf.append("\n<div>");
buf.append("<h2>");
+ buf.append("<a href='" + e.getUri() + "'>");
buf.append(e.getTitle());
- buf.append("</h2>");
+ buf.append("</a></h2>");
if (e.getPublishedDate() != null) {
buf.append("<div class='date'>");
buf.append(DATE_FORMATTER.format(e.getPublishedDate()));