Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New comment in running_staticman_on_static_hugo_blog_with_nested_comments #214

Merged
merged 1 commit into from
Sep 16, 2019
Merged
Changes from all 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
_id: 8a8f4650-c9e5-11e9-8238-9540886bfca2
_parent: >-
http://yasoob.me/posts/running_staticman_on_static_hugo_blog_with_nested_comments/
name: Vin100 Tam
email: 4980f828b9588a712cc2013ac10fd13a
reply_to: ''
comment: "Your article deserves a static comment. However, as the author of the last article in the **Sources**, I've found some rooms of improvements for your guide.\r\n\r\n1. Staticman's v3 URL scheme has been available since eduardoboucas/staticman#219. Your guide is still using the v2 URL scheme `/v2/entry/...`. You might want to update your guide to that, so as to cover GitLab Pages as well.\r\n2. When I wrote my self-hosting guide (another related article to the one that you linked) last year, I've put `\"port\": 8080`. In fact, that's unless since Heroku designates dynamically the port number. I've just edited my article to remove that API parameter.\r\n3. The creation of `.gitkeep` can be avoided if you use `.Site.Data.comments` instead of `readDir \"data/comments\"`. Related discussion in above linked Staticman PR: https://github.com/eduardoboucas/staticman/pull/219#issuecomment-419757921.\r\n4. You're mixing JS code with HTML in your Go-HTML template code for the reply button. This doesn't comply with the pratice of [separation of concerns](https://google.github.io/styleguide/htmlcssguide.html#Separation_of_Concerns).\r\n\r\n ```html\r\n <button id=\"{{ ._id }}\" class=\"btn-info\" href=\"#comment-form\" onclick=\"changeValue('fields[reply_to]', '{{ $.parentId }}')\">Reply to thread</button>\r\n ```\r\n\r\n For a pure JS + Go-HTML (without jQuery) template of nested comment reply, you may take a look at [Hugo Swift Theme](https://github.com/onweru/hugo-swift-theme)'s `assets/js/*.js` and `layouts/partials/comments*.html`.\r\n\r\nP.S. I'm a collaborator of the aforementioned Hugo theme."
date: '2019-08-28T22:45:32.225Z'