Skip to content

Commit

Permalink
Merge pull request #10 from HeskeyBaozi/feature/comments-system
Browse files Browse the repository at this point in the history
Feature/comments system
  • Loading branch information
HeskeyBaozi authored Dec 18, 2017
2 parents d00fdbc + db35711 commit e9ecf55
Show file tree
Hide file tree
Showing 23 changed files with 29 additions and 16 deletions.
2 changes: 1 addition & 1 deletion layout/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang=en><head><meta charset=UTF-8><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1"><meta http-equiv=X-UA-Compatible content="ie=edge"><title>Hexo Loading...</title><link href=/static/css/app.4c89f359b7b6846f7870cbe7154f0929.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.54c7610a313165ba246e.js></script><script type=text/javascript src=/static/js/vendor.2df5b9938da73af6279b.js></script><script type=text/javascript src=/static/js/app.cf32999819ff5a4b775c.js></script></body></html>
<!doctype html><html lang=en><head><meta charset=UTF-8><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1"><meta http-equiv=X-UA-Compatible content="ie=edge"><title>Hexo Loading...</title><link href=/static/css/app.4c89f359b7b6846f7870cbe7154f0929.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.a73019bf2614e9d8f4ce.js></script><script type=text/javascript src=/static/js/vendor.2df5b9938da73af6279b.js></script><script type=text/javascript src=/static/js/app.0ada4a90073757b7c4f5.js></script></body></html>
2 changes: 2 additions & 0 deletions source/static/js/1.1116ce6832ae657291ab.js

Large diffs are not rendered by default.

Binary file added source/static/js/1.1116ce6832ae657291ab.js.gz
Binary file not shown.
1 change: 1 addition & 0 deletions source/static/js/1.1116ce6832ae657291ab.js.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions source/static/js/1.d365f195291d92ebdf09.js

This file was deleted.

Binary file removed source/static/js/1.d365f195291d92ebdf09.js.gz
Binary file not shown.
1 change: 0 additions & 1 deletion source/static/js/1.d365f195291d92ebdf09.js.map

This file was deleted.

2 changes: 2 additions & 0 deletions source/static/js/2.d3df9d748e4d63c9bdff.js

Large diffs are not rendered by default.

Binary file added source/static/js/2.d3df9d748e4d63c9bdff.js.gz
Binary file not shown.
1 change: 1 addition & 0 deletions source/static/js/2.d3df9d748e4d63c9bdff.js.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions source/static/js/2.f7fdf29c3ea9564a1e20.js

This file was deleted.

Binary file removed source/static/js/2.f7fdf29c3ea9564a1e20.js.gz
Binary file not shown.
1 change: 0 additions & 1 deletion source/static/js/2.f7fdf29c3ea9564a1e20.js.map

This file was deleted.

2 changes: 2 additions & 0 deletions source/static/js/app.0ada4a90073757b7c4f5.js

Large diffs are not rendered by default.

Binary file added source/static/js/app.0ada4a90073757b7c4f5.js.gz
Binary file not shown.

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions source/static/js/app.cf32999819ff5a4b775c.js

This file was deleted.

Binary file removed source/static/js/app.cf32999819ff5a4b775c.js.gz
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Vue.use(Router);


export const router = new Router({
mode: 'history',
mode: 'hash',
routes: [
{
path: '/',
Expand Down
2 changes: 1 addition & 1 deletion src/views/components/detailable-page/DetailablePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<!--comment-->
<div class="comments" v-if="target.comments">
<div class="gitment">
<gitment-comment></gitment-comment>
<gitment-comment :isImplicit="isImplicit" :slugOrSource="isImplicit ? $route.path : `posts/${target.slug}`"></gitment-comment>
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,21 @@ import { mapState } from "vuex";
import { RootState } from "@/store";
import Gitment from 'gitment';

declare const location: Location;


export default Vue.extend({
name: 'gitment-comment',
props: {
isImplicit: {
required: true,
type: Boolean
},
slugOrSource: {
required: true,
type: String
}
},
computed: {
...mapState({
gitmentOptions: (state: RootState) => state.meta.hexoConfig.theme.gitment
Expand All @@ -18,13 +30,14 @@ export default Vue.extend({

// https://github.com/imsun/gitment#3-render-gitment
const gitment = new Gitment({
id: this.$route.path,
id: this.slugOrSource,
owner: this.gitmentOptions.github_id,
repo: this.gitmentOptions.repository_name,
oauth: {
client_id: this.gitmentOptions.client_id,
client_secret: this.gitmentOptions.client_secret,
},
title: this.$route.path,
perPage: this.gitmentOptions.per_page,
maxCommentHeight: this.gitmentOptions.max_comment_height
});
Expand Down

0 comments on commit e9ecf55

Please sign in to comment.