Add repository button to the navbar

This commit is contained in:
daudix
2024-08-18 02:32:22 +03:00
parent 67c698b949
commit c69b4a3e4f
6 changed files with 28 additions and 10 deletions

View File

@ -98,10 +98,12 @@ show_read_time = true
# words_per_minute = "200" # words_per_minute = "200"
[extra.nav] [extra.nav]
# Whether to show Atom/RSS feed button in the nav # Whether to show the Atom/RSS feed button in the nav
show_feed = true show_feed = true
# Whether to show manual theme switcher in the nav # Whether to show the manual theme switcher in the nav
show_theme_switcher = true show_theme_switcher = true
# Whether to show the link to the source repository in the nav
show_repo = true
# Links used in the nav. # Links used in the nav.
# For local files use same link format as in Markdown, # For local files use same link format as in Markdown,
# i.e "@/blog/_index.md". # i.e "@/blog/_index.md".
@ -110,7 +112,6 @@ links = [
{ url = "@/blog/_index.md", name = "Blog" }, { url = "@/blog/_index.md", name = "Blog" },
{ url = "@/demo/index.md", name = "Demo" }, { url = "@/demo/index.md", name = "Demo" },
{ url = "@/tricks/index.md", name = "Tricks" }, { url = "@/tricks/index.md", name = "Tricks" },
{ url = "https://codeberg.org/daudix/duckquill", name = "Repo" },
] ]
[extra.footer] [extra.footer]
@ -120,7 +121,6 @@ links = [
{ url = "@/blog/_index.md", name = "Blog" }, { url = "@/blog/_index.md", name = "Blog" },
{ url = "@/demo/index.md", name = "Demo" }, { url = "@/demo/index.md", name = "Demo" },
{ url = "@/tricks/index.md", name = "Tricks" }, { url = "@/tricks/index.md", name = "Tricks" },
{ url = "https://codeberg.org/daudix/duckquill", name = "Repo" },
] ]
# Social links in the footer. # Social links in the footer.
# Any URL-encoded SVG can be used as an icon. # Any URL-encoded SVG can be used as an icon.

View File

@ -51,6 +51,7 @@ powered_by_and = "و"
previous = "السابق" previous = "السابق"
published = "منشور" published = "منشور"
reload = "إعادة التحميل" reload = "إعادة التحميل"
repo = "المستودع"
search = "بحث" search = "بحث"
search_for = "ابحث عن" search_for = "ابحث عن"
skip_to_content = "تخطي إلى المحتوى الرئيسي" skip_to_content = "تخطي إلى المحتوى الرئيسي"

View File

@ -55,6 +55,7 @@ powered_by_and = "and"
previous = "Previous" previous = "Previous"
published = "Published on" published = "Published on"
reload = "Reload" reload = "Reload"
repo = "Repository"
search = "Search" search = "Search"
search_for = "Search for" search_for = "Search for"
skip_to_content = "Skip to main content" skip_to_content = "Skip to main content"

View File

@ -34,6 +34,7 @@ drafted = "Черновик"
faves_from = "Избранное с" faves_from = "Избранное с"
featured = "Подборка" featured = "Подборка"
feed = "Лента" feed = "Лента"
few_minutes_read = "$NUMBER минут чтения"
few_posts = "Всего $NUMBER поста" few_posts = "Всего $NUMBER поста"
few_tags = "Всего $NUMBER тега" few_tags = "Всего $NUMBER тега"
file_an_issue = "Отправить Отчет об Ошибке" file_an_issue = "Отправить Отчет об Ошибке"
@ -43,8 +44,10 @@ important = "Важно"
language = "Язык" language = "Язык"
load_comments = "Загрузить Комментарии" load_comments = "Загрузить Комментарии"
loading = "Загрузка" loading = "Загрузка"
many_minutes_read = "$NUMBER минуты чтения"
many_posts = "Всего $NUMBER постов" many_posts = "Всего $NUMBER постов"
many_tags = "Всего $NUMBER тегов" many_tags = "Всего $NUMBER тегов"
minutes_read = "$NUMBER минута чтения"
newest_to_oldest = "От новейшего к старейшему" newest_to_oldest = "От новейшего к старейшему"
next = "Следующий" next = "Следующий"
no_comments = "Комментариев пока нет :/" no_comments = "Комментариев пока нет :/"
@ -59,6 +62,7 @@ powered_by_and = "и"
previous = "Предыдущий" previous = "Предыдущий"
published = "Опубликовано" published = "Опубликовано"
reload = "Перезагрузить" reload = "Перезагрузить"
repo = "Репозиторий"
search = "Поиск" search = "Поиск"
search_for = "Искать" search_for = "Искать"
skip_to_content = "Перейти к основному содержанию" skip_to_content = "Перейти к основному содержанию"
@ -76,6 +80,3 @@ updated = "Обновлено"
view_comment = "Показать комментарий на" view_comment = "Показать комментарий на"
view_profile = "Показать профиль на" view_profile = "Показать профиль на"
warning = "Внимание" warning = "Внимание"
minutes_read = "$NUMBER минута чтения"
few_minutes_read = "$NUMBER минут чтения"
many_minutes_read = "$NUMBER минуты чтения"

View File

@ -56,7 +56,7 @@
list-style: none; list-style: none;
@media only screen and (max-width: 480px) { @media only screen and (max-width: 480px) {
&:not(#search, #language-switcher, #theme-switcher, #feed) { &:not(#search, #language-switcher, #theme-switcher, #feed, #repo) {
width: 100%; width: 100%;
} }
} }
@ -234,9 +234,10 @@
&#search button, &#search button,
&#language-switcher summary, &#language-switcher summary,
&#feed a,
&#theme-switcher summary, &#theme-switcher summary,
&#theme-switcher button { &#theme-switcher button,
&#feed a,
&#repo a {
padding: 0.5rem 0.625rem; padding: 0.5rem 0.625rem;
&:hover .icon { &:hover .icon {
@ -284,6 +285,13 @@
} }
} }
&#repo .icon {
// $icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath d='M5 4c-.309 0-.55.09-.75.281L.594 8l3.656 3.719c.2.191.441.281.75.281h1v-1c0-.258-.129-.527-.312-.719L3.438 8l2.25-2.281C5.87 5.527 6 5.258 6 5V4zm5 0v1c0 .258.129.527.313.719L12.563 8l-2.25 2.281c-.184.192-.313.461-.313.719v1h1c.309 0 .55-.09.75-.281L15.406 8 11.75 4.281C11.55 4.09 11.309 4 11 4z'/%3E%3C/svg%3E");
$icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath d='M8 0a1 1 0 0 0-.707.293L5.707 1.875l5.238 5.234c.176-.07.364-.109.555-.109A1.5 1.5 0 1 1 10 8.5q0-.276.102-.535L8.05 5.915v4.19a1.5 1.5 0 1 1-1-.035V4.914L4.859 2.727.293 7.293a1 1 0 0 0 0 1.414l7 7a1 1 0 0 0 1.414 0l7-7a1.007 1.007 0 0 0 0-1.414l-7-7A1 1 0 0 0 8 0m0 0'/%3E%3C/svg%3E");
-webkit-mask-image: $icon;
mask-image: $icon;
}
details { details {
position: relative; position: relative;
box-shadow: none; box-shadow: none;

View File

@ -79,6 +79,13 @@
</a> </a>
</li> </li>
{%- endif %} {%- endif %}
{%- if config.extra.source_url and config.extra.nav.show_repo %}
<li id="repo">
<a href="{{ config.extra.source_url }}" title="{{ macros_translate::translate(key='repo', default='Repository', language_strings=language_strings) }}">
<i class="icon"></i>
</a>
</li>
{%- endif %}
</ul> </ul>
</nav> </nav>
{%- if config.build_search_index %} {%- if config.build_search_index %}