statiqdev / CleanBlog

A blogging theme for Statiq Web.
MIT License
53 stars 25 forks source link

Add content footer, pluggable comment engines, and Giscus implementation #24

Closed rdeago closed 1 year ago

rdeago commented 1 year ago

This PR contains the following additions:

Content footer

Add a _content-footer.cshtml partial, that acts like _post-footer.cshtml but is not limited to posts.

The rationale for this change is that _post-footer.cshtml is a good place for e.g. an "Edit this page" link, which of course is not only useful on posts.

In posts, _content-footer.cshtml is included immediately after _post-footer.cshtml.

Pluggable comment engines

When the CommentEngine setting of a post (most probably coming from settings.yml in this case), converted to lower case, is not empty and is not "none", a div (Bootstrap row) with an id of comments-container is added after the one containing the post itself.

Inside the added row, a partial is included (and therefore must exist!) whose name is _post-comments-XXXX.cshtml, where XXXX is the lower-cased value of CommentEngine.

This mechanism allows for the addition of different comment engines (Giscus, Utterances, etc.) even without modifying the theme.

Giscus support

When the CommentEngine setting is equal to giscus, the giscus client script is automatically included and MUST be configured; more details in the README.md diff.


Of course, all changes have been documented in README.md.

rdeago commented 1 year ago

I just converted this PR to draft because I'm incorporating it, together with other improvements, in #23. I will probably close this one once the other one is ready.

rdeago commented 1 year ago

Closing this as the same changes are in #23.

atiq-cs commented 1 year ago

ditto: putting everything in a single PR i.e., PR#23 is bad idea. The harder is to review, the lower the probability of getting it merged.