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

Question! #70

Open
derykmakgill opened this issue May 3, 2020 · 2 comments
Open

Question! #70

derykmakgill opened this issue May 3, 2020 · 2 comments

Comments

@derykmakgill
Copy link

I'm 99% of the way there. I've got comments working.

I've edited my config file as follows:

staticman:
api: "https://staticman3.herokuapp.com/v3/entry/github/derykmakgill/derykmakgill.github.io/master/comments"
path: "_data/comments/:path"

But I can't figure out how to make this all work with the includes file. The hard-coding means that all comments show on all pages. How can I adapt the following code in the includes file to reference only comments on a specific page?

{% assign comments = site.data.comments.test-slug | sort %}

Also, how can I tip you to support your project?

@VincentTam
Copy link
Owner

You've got the idea in https://github.com/derykmakgill/derykmakgill.github.io/commit/c983c5316f8d349b5d310e898f3365d08651ec1b#diff-052a8f26d3152dd036184afc8d8c6581R3. In a multi-page site, the comments is an array and it's elements has to be accessed by sth page-specific, like the page slug.

Sorry that I've left this aside for months, so I'm not sure about the syntax. For a Jekyll example, you may refer to https://github.com/daattali/beautiful-jekyll/blob/54ca4023738b77d3b7c64f7aded7fc404f00fec7/_includes/staticman-comments.html#L6-L17. For a Hugo one, I invite you to the original work in https://github.com/halogenica/beautifulhugo/blob/6f54c9a15985a776f68c4662f556183b1ea7170e/layouts/partials/staticman-comments.html.

Also, how can I tip you to support your project?

I'm glad of your generosity, but I don't have any ways now. I'm just an amateur in writing codes. Actually @eduardoboucas created Staticman, and @ntsim helped me a lot during my testing of his merged PR for native GitLab support.

@derykmakgill
Copy link
Author

Thank you! Looks like I finally figured it out.

Next up nested comments!

I appreciate your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants