File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
src/main/java/com/stubbornjava/webapp/post Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 22
33import java .util .List ;
44
5+ import org .jooq .lambda .Seq ;
6+
57import com .stubbornjava .common .undertow .Exchange ;
68import com .stubbornjava .webapp .PageRoutes ;
79import com .stubbornjava .webapp .Response ;
@@ -36,11 +38,18 @@ public static void recentPostsWithTag(HttpServerExchange exchange) {
3638 exchange .setStatusCode (StatusCodes .NOT_FOUND );
3739 }
3840
41+ String metaDesc = "View " + posts .size () + " " + tag +
42+ " examples and guides in Java" +
43+ Seq .seq (posts )
44+ .findFirst ()
45+ .map (p -> " including " + p .getTitle () + "." )
46+ .orElse ("." );
3947 Response response = Response .fromExchange (exchange )
4048 .with ("posts" , posts )
4149 .with ("type" , "Tag" )
4250 .with ("value" , tag )
4351 .with ("noData" , noData )
52+ .with ("metaDesc" , metaDesc )
4453 .withLibCounts ()
4554 .withRecentPosts ();
4655 Exchange .body ().sendHtmlTemplate (exchange , "templates/src/pages/tagOrLibSearch" , response );
Original file line number Diff line number Diff line change 1- {{ #> templates/src/common/_base-layout }}
1+ {{ #> templates/src/common/_base-layout metaDesc = metaDesc }}
22 {{ #*inline " title" }}{{ value }} Related Posts{{ /inline }}
33 {{ #*inline " content" }}
44 <div class =" container" >
You can’t perform that action at this time.
0 commit comments