Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add metadata to tags page#86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
billoneil merged 1 commit intomasterfromf/tag-metadata
Sep 29, 2018
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,8 @@

import java.util.List;

import org.jooq.lambda.Seq;

import com.stubbornjava.common.undertow.Exchange;
import com.stubbornjava.webapp.PageRoutes;
import com.stubbornjava.webapp.Response;
Expand DownExpand Up@@ -36,11 +38,18 @@ public static void recentPostsWithTag(HttpServerExchange exchange) {
exchange.setStatusCode(StatusCodes.NOT_FOUND);
}

String metaDesc = "View " + posts.size() + " " + tag +
" examples and guides in Java" +
Seq.seq(posts)
.findFirst()
.map(p -> " including " + p.getTitle() + ".")
.orElse(".");
Response response = Response.fromExchange(exchange)
.with("posts", posts)
.with("type", "Tag")
.with("value", tag)
.with("noData", noData)
.with("metaDesc", metaDesc)
.withLibCounts()
.withRecentPosts();
Exchange.body().sendHtmlTemplate(exchange, "templates/src/pages/tagOrLibSearch", response);
Expand Down
2 changes: 1 addition & 1 deletionstubbornjava-webapp/ui/src/pages/tagOrLibSearch.hbs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
{{#> templates/src/common/_base-layout}}
{{#> templates/src/common/_base-layout metaDesc=metaDesc}}
{{#*inline "title"}}{{value}} Related Posts{{/inline}}
{{#*inline "content"}}
<div class="container">
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp