etc: Support minimal OG tag
Facebook OG tag support just minimal cases. - Project Home, Issue/Board View Page
@8082e79ae1076b7949d420c94d39918e964568ab
--- app/views/board/view.scala.html
+++ app/views/board/view.scala.html
... | ... | @@ -35,8 +35,9 @@ |
35 | 35 |
case _ => routes.BoardApp.posts(project.owner, project.name).toString |
36 | 36 |
} |
37 | 37 |
} |
38 |
+@titleForOGTag = @{post.title + " |:| " + post.body.substring(0, Math.min(post.body.length, 200))} |
|
38 | 39 |
|
39 |
-@projectLayout(post.title, project, utils.MenuType.BOARD){ |
|
40 |
+@projectLayout(titleForOGTag, project, utils.MenuType.BOARD){ |
|
40 | 41 |
@projectMenu(project, utils.MenuType.BOARD, "main-menu-only") |
41 | 42 |
<div class="page-wrap-outer"> |
42 | 43 |
<div class="project-page-wrap board-view"> |
--- app/views/issue/view.scala.html
+++ app/views/issue/view.scala.html
... | ... | @@ -62,7 +62,9 @@ |
62 | 62 |
} |
63 | 63 |
} |
64 | 64 |
|
65 |
-@projectLayout(getTitle(issue), project, utils.MenuType.ISSUE){ |
|
65 |
+@titleForOGTag = @{getTitle(issue) + " |:| " + issue.body.substring(0, Math.min(issue.body.length, 200))} |
|
66 |
+ |
|
67 |
+@projectLayout(titleForOGTag, project, utils.MenuType.ISSUE){ |
|
66 | 68 |
@projectMenu(project, utils.MenuType.ISSUE, "main-menu-only") |
67 | 69 |
<div class="page-wrap-outer"> |
68 | 70 |
<div class="project-page-wrap board-view"> |
--- app/views/layout.scala.html
+++ app/views/layout.scala.html
... | ... | @@ -1,32 +1,23 @@ |
1 | 1 |
@** |
2 |
-* Yobi, Project Hosting SW |
|
2 |
+* Yona, 21c Project Hosting SW |
|
3 | 3 |
* |
4 |
-* Copyright 2012 NAVER Corp. |
|
5 |
-* http://yobi.io |
|
6 |
-* |
|
7 |
-* @author Sangcheol Hwang |
|
8 |
-* |
|
9 |
-* Licensed under the Apache License, Version 2.0 (the "License"); |
|
10 |
-* you may not use this file except in compliance with the License. |
|
11 |
-* You may obtain a copy of the License at |
|
12 |
-* |
|
13 |
-* http://www.apache.org/licenses/LICENSE-2.0 |
|
14 |
-* |
|
15 |
-* Unless required by applicable law or agreed to in writing, software |
|
16 |
-* distributed under the License is distributed on an "AS IS" BASIS, |
|
17 |
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
18 |
-* See the License for the specific language governing permissions and |
|
19 |
-* limitations under the License. |
|
4 |
+* Copyright Yona & Yobi Authors & NAVER Corp. |
|
5 |
+* https://yona.io |
|
20 | 6 |
**@ |
21 | 7 |
@(title: String)(theme:String)(content: Html) |
8 |
+@titleArray = @{title.split(" \\|:\\| ")} |
|
22 | 9 |
<!DOCTYPE html> |
23 | 10 |
<html> |
24 | 11 |
<head> |
25 | 12 |
<meta charset="utf-8"> |
26 |
-<title>@title</title> |
|
13 |
+<title>@titleArray(0)</title> |
|
27 | 14 |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
28 | 15 |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
29 | 16 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
17 |
+<meta property="og:title" content="@titleArray(0)" /> |
|
18 |
+<meta property="og:url" content="@play.mvc.Http.Context.current().request().path()" /> |
|
19 |
+<meta property="og:type" content="website" /> |
|
20 |
+<meta property="og:description" content="@{titleArray(titleArray.length-1)}" /> |
|
30 | 21 |
<link rel="shortcut icon" type="image/png" href="@routes.Assets.at("images/favicon.ico")"> |
31 | 22 |
<link rel="stylesheet" type="text/css" media="all" href="@routes.Assets.at("bootstrap/css/bootstrap.css")"> |
32 | 23 |
<link rel="stylesheet" type="text/css" media="all" href="@routes.Assets.at("stylesheets/yobicon/style.css")"> |
--- app/views/project/home.scala.html
+++ app/views/project/home.scala.html
... | ... | @@ -32,7 +32,7 @@ |
32 | 32 |
if (tab == tabId) {"active"} |
33 | 33 |
} |
34 | 34 |
|
35 |
-@projectLayout(message, project, utils.MenuType.PROJECT_HOME) { |
|
35 |
+@projectLayout(project.name + " |:| " + project.overview, project, utils.MenuType.PROJECT_HOME) { |
|
36 | 36 |
@projectMenu(project, utils.MenuType.PROJECT_HOME, "") |
37 | 37 |
<div class="page-wrap-outer"> |
38 | 38 |
<div class="project-page-wrap"> |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?