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

feat: add comments partial #44

Merged
merged 1 commit into from
May 10, 2023
Merged

feat: add comments partial #44

merged 1 commit into from
May 10, 2023

Conversation

rickvanprim
Copy link
Contributor

What problem does this PR solve?

Lack of support for a comments section at the bottom of posts.

Is this PR adding a new feature?

Introduces a comments.html partial that is included at the bottom of single.html and defaults to using the builtin Disqus template if .Site.DisqusShortname is set.

Is this PR related to any issue or discussion?

Closes #32

PR Checklist

  • I have verified that the code works as described/as intended.
  • This change adds a social icon which has a permissive license to use it.
  • This change does not include any external library/resources.
  • This change does not include any unrelated scripts (e.g. bash and python scripts).
  • I have enabled maintainer edits for this PR.

@netlify
Copy link

netlify bot commented May 9, 2023

Deploy Preview for hugo-blog-awesome ready!

Name Link
🔨 Latest commit 12cda7f
🔍 Latest deploy log https://app.netlify.com/sites/hugo-blog-awesome/deploys/645b1542fff2d800081981ec
😎 Deploy Preview https://deploy-preview-44--hugo-blog-awesome.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions github-actions bot added the size/s label May 9, 2023
@hugo-sid
Copy link
Owner

hugo-sid commented May 9, 2023

Thanks for the PR, @rickvanprim.

Your contribution is greatly appreciated.

Can you post some screenshots of the blog pages, after successful Discuss integration?

@rickvanprim
Copy link
Contributor Author

Enabled:
image

Disabled (builtin Disqus template disables when address is localhost/127.0.0.1):
image

@hugo-sid
Copy link
Owner

hugo-sid commented May 9, 2023

Thanks for the screenshots. The feature looks great.

It's time to add some documentation for this feature.
Could you please add some sample configuration in config.toml file? Also request you to include a small comment about the feature.

For example you can add something like this to config.toml:

#DisqusShortname = ABCDXYZ # provide discuss shortname & uncomment this line to enable discuss on blog post pages

@hugo-sid
Copy link
Owner

hugo-sid commented May 9, 2023

How come the Discuss background matches the theme background color? Did you configure it somewhere?

@rickvanprim
Copy link
Contributor Author

Added some documentation as requested.

Regarding the theming, I haven't done anything. It seems to be largely automatic, except that it breaks when you toggle light/dark until the page refreshes.

After toggling to light:
image
After refreshing:
image

Thoughts?

@hugo-sid
Copy link
Owner

hugo-sid commented May 10, 2023

Hi James,

Added some documentation as requested.

Thanks. Can you push the change/commit? As of now, I only see the commit that you created 8 hours ago 44c0436 .

Regarding the theming, I haven't done anything. It seems to be largely automatic, except that it breaks when you toggle light/dark until the page refreshes.
Thoughts?

Thanks for the details. I have to find out how to fix this. We can address it later (not in this PR). Let's consider this an an enhancement.
Your PR does a great job of adding support for comments.

@github-actions github-actions bot added the conflicts This PR has conflicts which must be resolved before it can be reviewed. label May 10, 2023
@github-actions
Copy link

This pull request has conflicts with the base branch, please resolve those so that we can review the pull request.

@github-actions github-actions bot added size/m and removed size/s conflicts This PR has conflicts which must be resolved before it can be reviewed. labels May 10, 2023
@github-actions
Copy link

Conflicts have been resolved! 🎉 A maintainer will soon review the pull request.

Copy link
Owner

@hugo-sid hugo-sid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi James. I have requested a change regarding CHANGELOG.md. Please see the comments below.

I will merge this PR shortly after this is resolved.

Comment on lines +200 to +205
### Comments

To enable Disqus comments, set `disqusShortname` in your site's `config.toml`.

To use another comments system, provide your own `comments.html` partial in `layouts\partials\comments.html`.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Thanks for adding documentation in README.md file.

@@ -10,13 +10,16 @@ theme = "hugo-blog-awesome"
defaultContentLanguage = "en-gb"

# To enable Google Analytics 4 (gtag.js) provide G-MEASUREMENT_ID below.
# To disable Google Analytics, simply leave the field empty or remove the next line
# To disable Google Analytics, simply leave the field empty or remove the next line
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You really have an 'eye for details' 😃.
Thanks for the fix.

Comment on lines +19 to +22
# To enable Disqus comments, provide Disqus Shortname below.
# To disable Disqus comments, simply leave the field empty or remove the next line
disqusShortname = ''

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the simple, no-brainer comments/docs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just copy-pasted your Google Analytics one 😉

CHANGELOG.md Outdated
Copy link
Owner

@hugo-sid hugo-sid May 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changelong is auto generated. I have setup a GitHub action workflow which:

  • analyses the commits (from last release)
  • determines the version to bump (it's doable since this project uses conventional commit specification)
  • updates the changelog
  • creates a git tag corresponding to the version

Finally it creates a PR with the above changes. So, there is no manual editing required.

Can you please leave this file unchanged, so that we leave it to the CI to manage it?

This is not at all your mistake. I know that you did it with an intention to help me/the project 🙂.
I think I made a mistake in not mentioning it anywhere. Probably, I should have mentioned it in CONTRIBUTING.md.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good. I wasn't sure how you were getting stable commit hashes in there, so I assumed it was post-PR 🙂

Copy link
Owner

@hugo-sid hugo-sid May 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure how you were getting stable commit hashes in there, so I assumed it was post-PR

I see.

I have updated CONTRIBUTING.md.

Don't forget to star the repo, if you liked this theme.

Thanks.

@sonarcloud
Copy link

sonarcloud bot commented May 10, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Owner

@hugo-sid hugo-sid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rickvanprim, for adding Discuss comments feature to this theme.

I appreciate your contribution.

Have a good day. Happy blogging :)

@hugo-sid hugo-sid merged commit 685ebf6 into hugo-sid:main May 10, 2023
8 checks passed
@rickvanprim rickvanprim deleted the comments branch May 10, 2023 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

2 participants