- posts sorted by last mod time
+ posts sorted by create time
- mod time: {{ $post.Timestamp }}
+ create time: {{ $post.Timestamp }}
diff --git a/mvc/models/models_pages/posts.go b/mvc/models/models_pages/posts.go index 16416f3..4c93d7c 100644 --- a/mvc/models/models_pages/posts.go +++ b/mvc/models/models_pages/posts.go @@ -57,8 +57,7 @@ func LoadPosts(dir string) (PostsMap, error) { // Ошибка парсинга timestamp log.Fatal(`post name parse error`) } - - link := fmt.Sprintf("/%s", name[lowLineIndex+1:]) + link := fmt.Sprintf("/%s", strings.TrimSuffix(name[lowLineIndex+1:], ".md")) posts[PostLink(link)] = createPost(link, html, timestamp) } return nil diff --git a/mvc/views/pages/post.gohtml b/mvc/views/pages/post.gohtml index 7ebc337..961266e 100644 --- a/mvc/views/pages/post.gohtml +++ b/mvc/views/pages/post.gohtml @@ -7,7 +7,7 @@
- mod time: {{ .modTimestamp }}
+ create time: {{ .modTimestamp }}
- posts sorted by last mod time
+ posts sorted by create time
- mod time: {{ $post.Timestamp }}
+ create time: {{ $post.Timestamp }}