1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2026-05-07 09:18:38 +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
+10
View File
@@ -108,6 +108,16 @@ social_preview_image: # string, local or CORS resources
# boolean type, the global switch for TOC in posts. # boolean type, the global switch for TOC in posts.
toc: true toc: true
actions:
# Display "Edit this post" action on each post page to encourage contributions.
edit_post:
enabled: false # set to true to display the "Edit this post" action.
url: "" # repository base URL, e.g. https://github.com/cotes2020/jekyll-theme-chirpy/edit/master
# Use dynamic or static URL for the edit link.
# If `static_url` is false, the post's path will be appended to the `url` above as the final edit link.
# Set to true if the URL should remain unchanged, which means each post will share the same edit link.
static_url: false # [ true | false ]
comments: comments:
# Global switch for the post-comment system. Keeping it empty means disabled. # Global switch for the post-comment system. Keeping it empty means disabled.
provider: # [disqus | utterances | giscus] provider: # [disqus | utterances | giscus]
+1
View File
@@ -60,6 +60,7 @@ post:
read_time: read_time:
unit: دقيقة unit: دقيقة
prompt: قراءة prompt: قراءة
edit: حرر هذا المنشور
relate_posts: إقرأ المزيد relate_posts: إقرأ المزيد
share: شارك share: شارك
button: button:
+1
View File
@@ -60,6 +60,7 @@ post:
read_time: read_time:
unit: мин unit: мин
prompt: четиво prompt: четиво
edit: Редактирай тази публикация
relate_posts: Още за четене relate_posts: Още за четене
share: Споделете share: Споделете
button: button:
+1
View File
@@ -60,6 +60,7 @@ post:
read_time: read_time:
unit: min unit: min
prompt: " de lectura" prompt: " de lectura"
edit: Edita aquesta entrada
relate_posts: Entrades relacionades relate_posts: Entrades relacionades
share: Compartir share: Compartir
button: button:
+1
View File
@@ -60,6 +60,7 @@ post:
read_time: read_time:
unit: minut unit: minut
prompt: čtení prompt: čtení
edit: Uprav tento příspěvek
relate_posts: Další čtení relate_posts: Další čtení
share: Sdílet share: Sdílet
button: button:
+1
View File
@@ -60,6 +60,7 @@ post:
read_time: read_time:
unit: min unit: min
prompt: læsetid prompt: læsetid
edit: Rediger dette opslag
relate_posts: Læs videre relate_posts: Læs videre
share: Del share: Del
button: button:
+1
View File
@@ -59,6 +59,7 @@ post:
read_time: read_time:
unit: Minuten unit: Minuten
prompt: Lesezeit prompt: Lesezeit
edit: Diesen Eintrag bearbeiten
relate_posts: Weiterlesen relate_posts: Weiterlesen
share: Teilen share: Teilen
button: button:
+1
View File
@@ -60,6 +60,7 @@ post:
read_time: read_time:
unit: މިނެޓް unit: މިނެޓް
prompt: އިސްކާރު prompt: އިސްކާރު
edit: މި ޕޯސްޓް އެޑިޓް ކުރު
relate_posts: އެއްޗެހި ފަހުރަށްދަން relate_posts: އެއްޗެހި ފަހުރަށްދަން
share: ސެއާރް share: ސެއާރް
button: button:
+1
View File
@@ -60,6 +60,7 @@ post:
read_time: read_time:
unit: Λεπτά unit: Λεπτά
prompt: διαβάσματος prompt: διαβάσματος
edit: Επεξεργασία αυτής της δημοσίευσης
relate_posts: Περισσότερα relate_posts: Περισσότερα
share: Κοινοποιήστε share: Κοινοποιήστε
button: button:
+1
View File
@@ -60,6 +60,7 @@ post:
read_time: read_time:
unit: min unit: min
prompt: read prompt: read
edit: Edit this post
relate_posts: Further Reading relate_posts: Further Reading
share: Share share: Share
button: button:
+1
View File
@@ -60,6 +60,7 @@ post:
read_time: read_time:
unit: min unit: min
prompt: " de lectura" prompt: " de lectura"
edit: Edita esta entrada
relate_posts: Lecturas adicionales relate_posts: Lecturas adicionales
share: Compartir share: Compartir
button: button:
+1
View File
@@ -60,6 +60,7 @@ post:
read_time: read_time:
unit: "دقیقه " unit: "دقیقه "
prompt: " زمان مطالعه" prompt: " زمان مطالعه"
edit: ویرایش این پست
relate_posts: بیشتر بخوانید relate_posts: بیشتر بخوانید
share: اشتراک‌گذاری share: اشتراک‌گذاری
button: button:
+1
View File
@@ -59,6 +59,7 @@ post:
read_time: read_time:
unit: minuuttia unit: minuuttia
prompt: lukea prompt: lukea
edit: Muokkaa tätä julkaisua
relate_posts: Jatka lukemista relate_posts: Jatka lukemista
share: Jaa share: Jaa
button: button:
+1
View File
@@ -60,6 +60,7 @@ post:
read_time: read_time:
unit: min unit: min
prompt: lire prompt: lire
edit: Modifier cet article
relate_posts: Autres lectures relate_posts: Autres lectures
share: Partager share: Partager
button: button:
+1
View File
@@ -61,6 +61,7 @@ post:
read_time: read_time:
unit: perc unit: perc
prompt: elolvasni prompt: elolvasni
edit: Szerkesztés
relate_posts: További olvasnivaló relate_posts: További olvasnivaló
share: Megosztás share: Megosztás
button: button:
+1
View File
@@ -60,6 +60,7 @@ post:
read_time: read_time:
unit: menit unit: menit
prompt: baca prompt: baca
edit: Sunting entri ini
relate_posts: Postingan Lainya relate_posts: Postingan Lainya
share: Bagikan share: Bagikan
button: button:
+1
View File
@@ -59,6 +59,7 @@ post:
read_time: read_time:
unit: min unit: min
prompt: lettura prompt: lettura
edit: Modifica questo post
relate_posts: Continua a leggere relate_posts: Continua a leggere
share: Condividi share: Condividi
button: button:
+1
View File
@@ -60,6 +60,7 @@ post:
read_time: read_time:
unit: unit:
prompt: で読めます prompt: で読めます
edit: この投稿を編集
relate_posts: さらに読む relate_posts: さらに読む
share: シェア share: シェア
button: button:
+1
View File
@@ -60,6 +60,7 @@ post:
read_time: read_time:
unit: unit:
prompt: 읽는 시간 prompt: 읽는 시간
edit: 이 글 편집
relate_posts: 관련된 글 relate_posts: 관련된 글
share: 공유하기 share: 공유하기
button: button:
+1
View File
@@ -60,6 +60,7 @@ post:
read_time: read_time:
unit: خولەک unit: خولەک
prompt: خوێندنەوە prompt: خوێندنەوە
edit: ئەم بابەتە دەستکاری بکە
relate_posts: بابەتی پەیوەندیدار relate_posts: بابەتی پەیوەندیدار
share: بڵاوکردنەوە share: بڵاوکردنەوە
button: button:
+1
View File
@@ -60,6 +60,7 @@ post:
read_time: read_time:
unit: မိနစ် unit: မိနစ်
prompt: ဖတ်ပါမည် prompt: ဖတ်ပါမည်
edit: ဤပို့စ်ကို တည်းဖြတ်ပါ
relate_posts: နောက်ထပ်ဖတ်ရန် relate_posts: နောက်ထပ်ဖတ်ရန်
share: မျှဝေရန် share: မျှဝေရန်
button: button:
+1
View File
@@ -59,6 +59,7 @@ post:
read_time: read_time:
unit: min unit: min
prompt: lees prompt: lees
edit: Bewerk dit bericht
relate_posts: Verder Lezen relate_posts: Verder Lezen
share: Deel share: Deel
button: button:
+1
View File
@@ -60,6 +60,7 @@ post:
read_time: read_time:
unit: دقیقې unit: دقیقې
prompt: لوستل prompt: لوستل
edit: دغه لیکنه سمول
relate_posts: نوره لوستنه relate_posts: نوره لوستنه
share: شریکول share: شریکول
button: button:
+1
View File
@@ -60,6 +60,7 @@ post:
read_time: read_time:
unit: min unit: min
prompt: " de leitura" prompt: " de leitura"
edit: Editar esta postagem
relate_posts: Leia também relate_posts: Leia também
share: Compartilhar share: Compartilhar
button: button:
+1
View File
@@ -59,6 +59,7 @@ post:
read_time: read_time:
unit: мин. unit: мин.
prompt: чтения prompt: чтения
edit: Редактировать этот пост
relate_posts: Похожие посты relate_posts: Похожие посты
share: Поделиться share: Поделиться
button: button:
+1
View File
@@ -60,6 +60,7 @@ post:
read_time: read_time:
unit: min unit: min
prompt: beri #read prompt: beri #read
edit: Uredi to objavo #Edit this post
relate_posts: Nadaljnje branje #Further Reading relate_posts: Nadaljnje branje #Further Reading
share: Deli #Share share: Deli #Share
button: button:
+1
View File
@@ -60,6 +60,7 @@ post:
read_time: read_time:
unit: min unit: min
prompt: läsning prompt: läsning
edit: Redigera detta inlägg
relate_posts: Mer läsning relate_posts: Mer läsning
share: Dela share: Dela
button: button:
+1
View File
@@ -60,6 +60,7 @@ post:
read_time: read_time:
unit: นาที unit: นาที
prompt: อ่าน prompt: อ่าน
edit: แก้ไขโพสต์นี้
relate_posts: อ่านต่อ relate_posts: อ่านต่อ
share: แชร์ share: แชร์
button: button:
+1
View File
@@ -60,6 +60,7 @@ post:
read_time: read_time:
unit: dakikada unit: dakikada
prompt: okunabilir prompt: okunabilir
edit: Bu gönderiyi düzenle
relate_posts: Benzer Gönderiler relate_posts: Benzer Gönderiler
share: Paylaş share: Paylaş
button: button:
+1
View File
@@ -60,6 +60,7 @@ post:
read_time: read_time:
unit: хвилин unit: хвилин
prompt: читання prompt: читання
edit: Редагувати цей пост
relate_posts: Вас також може зацікавити relate_posts: Вас також може зацікавити
share: Поділитися share: Поділитися
button: button:
+1
View File
@@ -60,6 +60,7 @@ post:
read_time: read_time:
unit: منٹ unit: منٹ
prompt: پڑھیں prompt: پڑھیں
edit: اس تحریر میں ترمیم کریں
relate_posts: مزید مطالعہ relate_posts: مزید مطالعہ
share: شیئر share: شیئر
button: button:
+1
View File
@@ -59,6 +59,7 @@ post:
read_time: read_time:
unit: phút unit: phút
prompt: đọc prompt: đọc
edit: Chỉnh sửa bài viết này
relate_posts: Bài viết liên quan relate_posts: Bài viết liên quan
share: Chia sẻ share: Chia sẻ
button: button:
+1
View File
@@ -59,6 +59,7 @@ post:
read_time: read_time:
unit: 分钟 unit: 分钟
prompt: 阅读 prompt: 阅读
edit: 编辑此文
relate_posts: 相关文章 relate_posts: 相关文章
share: 分享 share: 分享
button: button:
+1
View File
@@ -59,6 +59,7 @@ post:
read_time: read_time:
unit: 分鐘 unit: 分鐘
prompt: 閱讀 prompt: 閱讀
edit: 編輯此文
relate_posts: 相關文章 relate_posts: 相關文章
share: 分享 share: 分享
button: button:
+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 %}
+15 -10
View File
@@ -126,16 +126,21 @@ script_includes:
</div> </div>
<div class="post-tail-wrapper text-muted"> <div class="post-tail-wrapper text-muted">
<!-- categories --> <div class="d-flex justify-content-between align-items-center gap-3 mb-3">
{% if page.categories.size > 0 %} <!-- categories -->
<div class="post-meta mb-3"> {% if page.categories.size > 0 %}
<i class="far fa-folder-open fa-fw me-1"></i> <div class="post-meta">
{% for category in page.categories %} <i class="far fa-folder-open fa-fw me-1"></i>
<a href="{{ site.baseurl }}/categories/{{ category | slugify | url_encode }}/">{{ category }}</a> {% for category in page.categories %}
{%- unless forloop.last -%},{%- endunless -%} <a href="{{ site.baseurl }}/categories/{{ category | slugify | url_encode }}/">{{ category }}</a>
{% endfor %} {%- unless forloop.last -%},{%- endunless -%}
</div> {% endfor %}
{% endif %} </div>
{% endif %}
<!-- "Edit this post" link -->
{% include post-edit.html lang=lang %}
</div>
<!-- tags --> <!-- tags -->
{% if page.tags.size > 0 %} {% if page.tags.size > 0 %}
+10
View File
@@ -148,6 +148,16 @@ header {
} }
} }
.post-edit {
line-height: 1.2rem;
> a {
&:hover {
@extend %link-hover;
}
}
}
.post-navigation { .post-navigation {
@include bp.lt(bp.get(lg)) { @include bp.lt(bp.get(lg)) {
@include mx.pl-pr(0); @include mx.pl-pr(0);