diff --git a/novel-front/src/main/java/xyz/zinglizingli/books/web/BookController.java b/novel-front/src/main/java/xyz/zinglizingli/books/web/BookController.java index bd88d61..7c0af91 100644 --- a/novel-front/src/main/java/xyz/zinglizingli/books/web/BookController.java +++ b/novel-front/src/main/java/xyz/zinglizingli/books/web/BookController.java @@ -220,9 +220,9 @@ public class BookController { } SeoConfig seoConfig = (SeoConfig) req.getServletContext().getAttribute(Constants.SEO_CONFIG_KEY); Map page = seoConfig.getPage(); - page.put("detail.title",page.get("detail.title").replaceAll("",book.getBookName())); - page.put("detail.keyword",page.get("detail.keyword").replaceAll("",book.getBookName())); - page.put("detail.description",page.get("detail.description").replaceAll("",book.getBookName())); + modelMap.put("title",page.get("detail.title").replaceAll("",book.getBookName())); + modelMap.put("keyword",page.get("detail.keyword").replaceAll("",book.getBookName())); + modelMap.put("description",page.get("detail.description").replaceAll("",book.getBookName())); return "books/book_detail"; } @@ -239,9 +239,9 @@ public class BookController { modelMap.put("bookId", bookId); SeoConfig seoConfig = (SeoConfig) req.getServletContext().getAttribute(Constants.SEO_CONFIG_KEY); Map page = seoConfig.getPage(); - page.put("catalog.title",page.get("catalog.title").replaceAll("",bookName)); - page.put("catalog.keyword",page.get("catalog.keyword").replaceAll("",bookName)); - page.put("catalog.description",page.get("catalog.description").replaceAll("",bookName)); + modelMap.put("title",page.get("catalog.title").replaceAll("",bookName)); + modelMap.put("keyword",page.get("catalog.keyword").replaceAll("",bookName)); + modelMap.put("description",page.get("catalog.description").replaceAll("",bookName)); return "books/book_index"; } @@ -279,9 +279,9 @@ public class BookController { modelMap.put("catId", catId); SeoConfig seoConfig = (SeoConfig) req.getServletContext().getAttribute(Constants.SEO_CONFIG_KEY); Map page = seoConfig.getPage(); - page.put("content.title",page.get("content.title").replaceAll("",bookName).replaceAll("",indexName)); - page.put("content.keyword",page.get("content.keyword").replaceAll("",bookName).replaceAll("",indexName)); - page.put("content.description",page.get("content.description").replaceAll("",bookName).replaceAll("",indexName)); + modelMap.put("title",page.get("content.title").replaceAll("",bookName).replaceAll("",indexName)); + modelMap.put("keyword",page.get("content.keyword").replaceAll("",bookName).replaceAll("",indexName)); + modelMap.put("description",page.get("content.description").replaceAll("",bookName).replaceAll("",indexName)); return "books/book_content"; } diff --git a/novel-front/src/main/resources/templates/books/book_content.html b/novel-front/src/main/resources/templates/books/book_content.html index cdad521..3640696 100644 --- a/novel-front/src/main/resources/templates/books/book_content.html +++ b/novel-front/src/main/resources/templates/books/book_content.html @@ -4,16 +4,16 @@ - + - + + th:content="${description}"> - - + +
diff --git a/novel-front/src/main/resources/templates/books/book_detail.html b/novel-front/src/main/resources/templates/books/book_detail.html index 5235db3..ec57347 100644 --- a/novel-front/src/main/resources/templates/books/book_detail.html +++ b/novel-front/src/main/resources/templates/books/book_detail.html @@ -3,15 +3,15 @@ - + - + + th:content="${description}"> - + diff --git a/novel-front/src/main/resources/templates/books/book_index.html b/novel-front/src/main/resources/templates/books/book_index.html index 5f9f48e..d260e50 100644 --- a/novel-front/src/main/resources/templates/books/book_index.html +++ b/novel-front/src/main/resources/templates/books/book_index.html @@ -5,16 +5,16 @@ - + - + + th:content="${description}"> - - + +