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

Ko-fi macro for social links #69

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ google_scholar = "<googlescholar_userid>"
orcid = "<orcid_userid>"
mastodon_username = "<mastadon_username>"
mastodon_server = "<mastodon_server>" (if not set, defaults to mastodon.social)

kofi = "<kofi_username>"

# To add google analytics
[extra.analytics]
Expand Down
1 change: 1 addition & 0 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ soundcloud = "RatanShreshtha"
googleplay = "RatanShreshtha"
orcid = "RatanShreshtha"
google_scholar = "RatanShreshtha"
kofi = ""

[extra.analytics]
google = "UA-176984489-2"
Expand Down
3 changes: 2 additions & 1 deletion content/docs/config-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ google_scholar = "<googlescholar_userid>"
orcid = "<orcid_userid>"
mastodon_username = "<mastadon_username>"
mastodon_server = "<mastodon_server>" (if not set, defaults to mastodon.social)
kofi = "<kofi_username>"
```

## Google Analytics Setup
Expand Down Expand Up @@ -141,4 +142,4 @@ In order to enable `comments` for your post change as below code snippet in your
```toml
[extra]
comments = true
```
```
44 changes: 44 additions & 0 deletions templates/macros.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,46 @@
</a>
{% endif %}

{% if social_config.github %}
<a href="https://github.com/{{ social_config.github }}" target="_blank">
<span class="icon is-large" title="GitHub">
<i class="fab fa-github fa-lg"></i>
</span>
</a>
{% endif %}

{% if social_config.gitlab %}
<a href="https://gitlab.com/{{ social_config.gitlab }}" target="_blank">
<span class="icon is-large" title="GitLab">
<i class="fab fa-gitlab fa-lg"></i>
</span>
</a>
{% endif %}

{% if social_config.stackoverflow %}
<a href="https://stackoverflow.com/users/{{ social_config.stackoverflow }}" target="_blank">
<span class="icon is-large" title="Stack Overflow">
<i class="fab fa-stack-overflow fa-lg"></i>
</span>
</a>
{% endif %}

{% if social_config.keybase %}
<a href="https://keybase.io/{{ social_config.keybase }}" target="_blank">
<span class="icon is-large" title="Keybase">
<i class="fab fa-keybase fa-lg"></i>
</span>
</a>
{% endif %}

{% if social_config.mastodon %}
<a rel="me" href="{{ social_config.mastodon }}" target="_blank">
<span class="icon is-large" title="Mastodon">
<i class="fab fa-mastodon fa-lg"></i>
</span>
</a>
{% endif %}

{% if social_config.instagram %}
<a class="has-text-instagram" href="https://www.instagram.com/{{ social_config.instagram}}" target="_blank">
<span class="icon is-large" title="Instagram">
Expand Down Expand Up @@ -187,6 +227,10 @@
<a class="has-text-youtube" href="https://www.youtube.com/c/{{ social_config.youtube }}" target="_blank">
<span class="icon is-large" title="YouTube">
<i class="fa-brands fa-youtube"></i>
{% if social_config.kofi %}
<a href="https://ko-fi.com/{{ social_config.kofi }}" target="_blank">
<span class="icon is-large" title="Ko-fi">
<i class="fas fa-mug-hot fa-lg"></i>
</span>
</a>
{% endif %}
Expand Down