Skip to content

Commit

Permalink
Merge pull request #4615 from Franz-Kafka/main
Browse files Browse the repository at this point in the history
Added GitHub Star Count to Community Extensions
  • Loading branch information
szarnyasg authored Jan 20, 2025
2 parents e8ff6af + 3390393 commit 3c93b5f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
21 changes: 16 additions & 5 deletions _layouts/community_extension_doc.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,26 @@

</div>

{% if page.extension_download_count_pretty %}
{% if page.extension_download_count_pretty || page.extension_star_count_pretty %}
<div class="box-link-wrapper">
<div class="box-link auto-width downloads">
<a href="/community_extensions/download_metrics"></a>
{% if page.extension_download_count_pretty %}
<div class="box-link half-width downloads">
<a href="/community_extensions/download_metrics" aria-label="Download Metrics"></a>
<span class="symbol"><img src="/images/icons/download.svg"></span>
<span>Downloads</span>
<span class="week"><span class="num">{{ page.extension_download_count_pretty }}</span>this week</span>
<span class="chevron"></span>
</div>
{% endif %}
{% if page.extension_star_count_pretty %}
<div class="box-link half-width stars">
<a href="https://github.com/{{ page.repo.github }}/stargazers" target="_blank" aria-label="Stargazers on GitHub" rel="noopener noreferrer"></a>
<span class="symbol"><img src="/images/icons/star.svg"></span>
<span>GitHub stars</span>
<span class="num">{{ page.extension_star_count_pretty }}</span>
<span class="chevron"></span>
</div>
{% endif %}
</div>
{% endif %}

Expand All @@ -91,14 +102,14 @@
{% if page.repo.github %}
<div class="box-link-wrapper">
<div class="box-link half-width">
<a href="https://github.com/{{ page.repo.github }}" target="_blank"></a>
<a href="https://github.com/{{ page.repo.github }}" target="_blank" rel="noopener noreferrer" aria-label="Repository on GitHub"></a>
<span class="symbol"><img src="/images/icons/github.svg"></span>
<span>Extension repository on GitHub</span>
<span class="chevron"></span>
</div>
{% if page.extension.name %}
<div class="box-link half-width">
<a href="https://github.com/duckdb/community-extensions/blob/main/extensions/{{ page.extension.name }}/description.yml" target="_blank"></a>
<a href="https://github.com/duckdb/community-extensions/blob/main/extensions/{{ page.extension.name }}/description.yml" target="_blank" rel="noopener noreferrer" aria-label="Extension descriptor (YAML)"></a>
<span class="symbol"><img src="/images/icons/yaml.svg"></span>
<span>Extension descriptor (YAML)</span>
<span class="chevron"></span>
Expand Down
1 change: 1 addition & 0 deletions css/docu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,7 @@ body.documentation main .wrap a.pill{
margin: 0!important;
}
}
&.stars,
&.downloads{
span.num{
color: var(--interactive-folderbox-text-color, #1A1A1A);
Expand Down
3 changes: 3 additions & 0 deletions images/icons/star.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ $(document).ready(function(){

/** HIGHLIGHT TOC MENU **/
if ( $('body').hasClass('documentation') ) {
var headings = $('#main_content_wrap h1, #main_content_wrap h2');
var headings = $('#main_content_wrap h1, #main_content_wrap h2, #main_content_wrap h3');
var tocEntries = $('.toc-entry');

$(window).on('scroll', function() {
Expand Down

0 comments on commit 3c93b5f

Please sign in to comment.