Skip to content

Commit 46a16fd

Browse files
committed
Add meta title
1 parent 03792c8 commit 46a16fd

13 files changed

Lines changed: 25 additions & 23 deletions

File tree

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

docker/run.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/main/java/com/raysmond/blog/support/web/ViewHelper.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@
44
import org.springframework.stereotype.Service;
55
import org.springframework.beans.factory.annotation.Autowired;
66

7+
import java.text.SimpleDateFormat;
8+
import java.util.Date;
9+
710
/**
811
* Created by Raysmond on 9/26/15.
912
*/
1013
@Service
1114
public class ViewHelper {
1215

16+
private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("MMMM dd, yyyy");
17+
1318
private long startTime;
1419

1520
public long getResponseTime(){
@@ -24,4 +29,8 @@ public void setStartTime(long startTime) {
2429
this.startTime = startTime;
2530
}
2631

32+
public String getFormattedDate(Date date){
33+
return date == null ? "" : DATE_FORMAT.format(date);
34+
}
35+
2736
}

src/main/webapp/views/home/about.jade

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ block page_title
44
h1 Raysmond
55
p Something about me.
66

7+
block title
8+
|About Raysmond
9+
710
block content
811
.post
912
.content

src/main/webapp/views/home/index.jade

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ block page_title
44
h1 Raysmond
55
p TO be or not to be.
66

7+
block title
8+
|Raysmond
9+
710
block content
811
include ../posts/index
912

src/main/webapp/views/layout/head.jade

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ meta(name="viewport", content="width=device-width, initial-scale=1")
44

55
meta(name="description", content="A simple blog demo with Spring MVC.")
66
meta(name="author", content="Raysmond")
7-
title SringBlog
7+
8+
title
9+
block title
10+
|SringBlog
811

912
link(rel='stylesheet', type='text/css', href='#{basePath}/webjars/bootstrap/3.3.5/css/bootstrap.min.css')
1013
link(rel='stylesheet', type='text/css', href='#{basePath}/webjars/font-awesome/4.3.0-3/css/font-awesome.min.css')

0 commit comments

Comments
 (0)