mirror of
https://github.com/201206030/novel.git
synced 2025-04-27 07:30:50 +00:00
修复网页标题错误
This commit is contained in:
parent
2819a3034e
commit
37bef6e1ce
@ -220,9 +220,9 @@ public class BookController {
|
|||||||
}
|
}
|
||||||
SeoConfig seoConfig = (SeoConfig) req.getServletContext().getAttribute(Constants.SEO_CONFIG_KEY);
|
SeoConfig seoConfig = (SeoConfig) req.getServletContext().getAttribute(Constants.SEO_CONFIG_KEY);
|
||||||
Map<String,String> page = seoConfig.getPage();
|
Map<String,String> page = seoConfig.getPage();
|
||||||
page.put("detail.title",page.get("detail.title").replaceAll("<bookName>",book.getBookName()));
|
modelMap.put("title",page.get("detail.title").replaceAll("<bookName>",book.getBookName()));
|
||||||
page.put("detail.keyword",page.get("detail.keyword").replaceAll("<bookName>",book.getBookName()));
|
modelMap.put("keyword",page.get("detail.keyword").replaceAll("<bookName>",book.getBookName()));
|
||||||
page.put("detail.description",page.get("detail.description").replaceAll("<bookName>",book.getBookName()));
|
modelMap.put("description",page.get("detail.description").replaceAll("<bookName>",book.getBookName()));
|
||||||
|
|
||||||
return "books/book_detail";
|
return "books/book_detail";
|
||||||
}
|
}
|
||||||
@ -239,9 +239,9 @@ public class BookController {
|
|||||||
modelMap.put("bookId", bookId);
|
modelMap.put("bookId", bookId);
|
||||||
SeoConfig seoConfig = (SeoConfig) req.getServletContext().getAttribute(Constants.SEO_CONFIG_KEY);
|
SeoConfig seoConfig = (SeoConfig) req.getServletContext().getAttribute(Constants.SEO_CONFIG_KEY);
|
||||||
Map<String,String> page = seoConfig.getPage();
|
Map<String,String> page = seoConfig.getPage();
|
||||||
page.put("catalog.title",page.get("catalog.title").replaceAll("<bookName>",bookName));
|
modelMap.put("title",page.get("catalog.title").replaceAll("<bookName>",bookName));
|
||||||
page.put("catalog.keyword",page.get("catalog.keyword").replaceAll("<bookName>",bookName));
|
modelMap.put("keyword",page.get("catalog.keyword").replaceAll("<bookName>",bookName));
|
||||||
page.put("catalog.description",page.get("catalog.description").replaceAll("<bookName>",bookName));
|
modelMap.put("description",page.get("catalog.description").replaceAll("<bookName>",bookName));
|
||||||
return "books/book_index";
|
return "books/book_index";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -279,9 +279,9 @@ public class BookController {
|
|||||||
modelMap.put("catId", catId);
|
modelMap.put("catId", catId);
|
||||||
SeoConfig seoConfig = (SeoConfig) req.getServletContext().getAttribute(Constants.SEO_CONFIG_KEY);
|
SeoConfig seoConfig = (SeoConfig) req.getServletContext().getAttribute(Constants.SEO_CONFIG_KEY);
|
||||||
Map<String,String> page = seoConfig.getPage();
|
Map<String,String> page = seoConfig.getPage();
|
||||||
page.put("content.title",page.get("content.title").replaceAll("<bookName>",bookName).replaceAll("<indexName>",indexName));
|
modelMap.put("title",page.get("content.title").replaceAll("<bookName>",bookName).replaceAll("<indexName>",indexName));
|
||||||
page.put("content.keyword",page.get("content.keyword").replaceAll("<bookName>",bookName).replaceAll("<indexName>",indexName));
|
modelMap.put("keyword",page.get("content.keyword").replaceAll("<bookName>",bookName).replaceAll("<indexName>",indexName));
|
||||||
page.put("content.description",page.get("content.description").replaceAll("<bookName>",bookName).replaceAll("<indexName>",indexName));
|
modelMap.put("description",page.get("content.description").replaceAll("<bookName>",bookName).replaceAll("<indexName>",indexName));
|
||||||
return "books/book_content";
|
return "books/book_content";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,16 +4,16 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta th:if="${catId == 9}" name="viewport" content="width=device-width, initial-scale=0.5, maximum-scale=1">
|
<meta th:if="${catId == 9}" name="viewport" content="width=device-width, initial-scale=0.5, maximum-scale=1">
|
||||||
<meta th:if="${catId != 9}" name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
<meta th:if="${catId != 9}" name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||||
<title th:text="${application.seoConfig.page['content.title']}"></title>
|
<title th:text="${title}"></title>
|
||||||
|
|
||||||
<meta name="keywords" th:content="${application.seoConfig.page['content.keyword']}">
|
<meta name="keywords" th:content="${keyword}">
|
||||||
|
|
||||||
<meta name="description"
|
<meta name="description"
|
||||||
th:content="${application.seoConfig.page['content.description']}">
|
th:content="${description}">
|
||||||
|
|
||||||
<meta property="og:type" content="novel_content"/>
|
<meta property="og:type" content="novel_content"/>
|
||||||
<meta property="og:title" th:attr="content=${application.seoConfig.page['content.title']}"/>
|
<meta property="og:title" th:attr="content=${title}"/>
|
||||||
<meta property="og:description" th:attr="content=${application.seoConfig.page['content.description']}"/>
|
<meta property="og:description" th:attr="content=${description}"/>
|
||||||
|
|
||||||
|
|
||||||
<div th:include="common/css :: css"></div>
|
<div th:include="common/css :: css"></div>
|
||||||
|
@ -3,15 +3,15 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||||
<title th:text="${application.seoConfig.page['detail.title']}"></title>
|
<title th:text="${title}"></title>
|
||||||
|
|
||||||
<meta name="keywords" th:content="${application.seoConfig.page['detail.keyword']}">
|
<meta name="keywords" th:content="${keyword}">
|
||||||
|
|
||||||
<meta name="description"
|
<meta name="description"
|
||||||
th:content="${application.seoConfig.page['detail.description']}">
|
th:content="${description}">
|
||||||
|
|
||||||
<meta property="og:type" content="novel"/>
|
<meta property="og:type" content="novel"/>
|
||||||
<meta property="og:title" th:attr="content=${application.seoConfig.page['detail.title']}"/>
|
<meta property="og:title" th:attr="content=${title}"/>
|
||||||
<meta property="og:description" th:attr="content=${book.bookDesc}"/>
|
<meta property="og:description" th:attr="content=${book.bookDesc}"/>
|
||||||
<meta property="og:image" th:attr="content=${application.webSiteDomain}+${book.picUrl}"/>
|
<meta property="og:image" th:attr="content=${application.webSiteDomain}+${book.picUrl}"/>
|
||||||
<meta property="og:novel:category" th:attr="content=${book.cateName}"/>
|
<meta property="og:novel:category" th:attr="content=${book.cateName}"/>
|
||||||
|
@ -5,16 +5,16 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||||
<title th:text="${application.seoConfig.page['catalog.title']}"></title>
|
<title th:text="${title}"></title>
|
||||||
|
|
||||||
<meta name="keywords" th:content="${application.seoConfig.page['catalog.keyword']}">
|
<meta name="keywords" th:content="${keyword}">
|
||||||
|
|
||||||
<meta name="description"
|
<meta name="description"
|
||||||
th:content="${application.seoConfig.page['catalog.description']}">
|
th:content="${description}">
|
||||||
|
|
||||||
<meta property="og:type" content="novel_chapter"/>
|
<meta property="og:type" content="novel_chapter"/>
|
||||||
<meta property="og:title" th:attr="content=${application.seoConfig.page['catalog.title']}"/>
|
<meta property="og:title" th:attr="content=${title}"/>
|
||||||
<meta property="og:description" th:attr="content=${application.seoConfig.page['catalog.description']}"/>
|
<meta property="og:description" th:attr="content=${description}"/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user