A curated list of libraries & SDKs for the Bluesky API and AT Protocol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

allow multiple urls per project, merge the info

+34 -3
+1 -1
_includes/project_card.html
··· 17 17 18 18 <li class="{% if info.user_login == 'bluesky-social' %}official{% endif %}"> 19 19 <p class="title"> 20 - <a class="project-name" href="{{ include.project.url }}" target="_blank">{{ info.name }}</a> 20 + <a class="project-name" href="{{ include.project.url | default: include.project.urls[0] }}" target="_blank">{{ info.name }}</a> 21 21 <span class="author"><span class="dot">•</span> 22 22 <a href="{{ info.user_profile }}" target="_blank">{{ user }}</a></span> 23 23 {% if info.user_login == "bluesky-social" %}
+32 -1
_plugins/inject_info.rb
··· 1 + def first_nonempty(list) 2 + list.compact.detect { |x| x.strip.length > 0 } 3 + end 4 + 5 + def latest_of(list, field) 6 + list.compact.sort_by { |x| x[field] }.last 7 + end 8 + 9 + def merge_infos(infos) 10 + { 11 + 'name' => infos[0]['name'], 12 + 'user_login' => infos[0]['user_login'], 13 + 'user_profile' => infos[0]['user_profile'], 14 + 15 + 'description' => first_nonempty(infos.map { |x| x['description'] }), 16 + 'homepage' => first_nonempty(infos.map { |x| x['homepage'] }), 17 + 'license' => first_nonempty(infos.map { |x| x['license'] }), 18 + 'user_name' => first_nonempty(infos.map { |x| x['user_name'] }), 19 + 20 + 'last_release' => latest_of(infos.map { |x| x['last_release'] }, 'published_at'), 21 + 'last_tag' => latest_of(infos.map { |x| x['last_tag'] }, 'committer_date'), 22 + 'last_commit' => latest_of(infos.map { |x| x['last_commit'] }, 'committer_date'), 23 + 24 + 'stars' => infos.map { |x| x['stars'] || 0 }.reduce(&:+) 25 + } 26 + end 27 + 1 28 Jekyll::Hooks.register :site, :post_read do |site| 2 29 data = site.data 3 30 data['projects'].each do |key, section| 4 31 section['repos'].each do |repo| 5 - repo['info'] = data['metadata'][repo['url']] 32 + if repo['urls'] 33 + repo['info'] = repo['urls'].map { |u| data['metadata'][u] }.then { |x| merge_infos(x) } 34 + else 35 + repo['info'] = data['metadata'][repo['url']] 36 + end 6 37 end 7 38 end 8 39 end
+1 -1
lib/metadata_import.rb
··· 31 31 32 32 def get_repo_urls(language = nil) 33 33 yamls = Dir[File.join(__dir__, '..', '_data', 'projects', language ? "#{language}.yml" : '*.yml')] 34 - yamls.map { |x| YAML.load(File.read(x))['repos'] }.flatten.map { |x| x['url'] } 34 + yamls.map { |x| YAML.load(File.read(x))['repos'] }.flatten.map { |x| x['url'] || x['urls'] }.flatten 35 35 end 36 36 end