1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2026-05-07 17:28:39 +00:00

feat: add edit this post link (#2517)

This commit is contained in:
Alexander Fuks
2026-05-06 18:31:32 +04:00
committed by GitHub
parent 2685b91957
commit 6bd446ccde
37 changed files with 91 additions and 10 deletions
+23
View File
@@ -0,0 +1,23 @@
<!-- Link to edit the post to contribute. -->
{% assign enabled = site.actions.edit_post.enabled %}
{% assign url = site.actions.edit_post.url %}
{% assign static_url = site.actions.edit_post.static_url %}
{% unless static_url %}
{% assign url = url | append: '/' | append: page.path %}
{% endunless %}
{% if enabled %}
<div class="post-edit">
{% assign edit = site.data.locales[include.lang].post.edit %}
<a
href="{{ url }}"
target="_blank"
rel="noopener"
>
<i class="fa fa-pen fa-fw me-1"></i>
<span>{{ edit }}</span>
</a>
</div>
{% endif %}