From 89757aceb8285fc4715002543d90d2fd95245eb3 Mon Sep 17 00:00:00 2001 From: Carlgo11 Date: Wed, 15 Nov 2023 16:11:59 +0100 Subject: [PATCH] Rename img/ to icons/ --- .github/workflows/repository.yml | 2 +- CONTRIBUTING.md | 2 +- README.md | 2 +- {img => icons}/v/visma.com.svg | 0 {img => icons}/y/yahoo.com.svg | 0 tests/svg_lint.rb | 2 +- tests/validate_fs.sh | 4 ++-- tests/validate_images.rb | 4 ++-- 8 files changed, 8 insertions(+), 8 deletions(-) rename {img => icons}/v/visma.com.svg (100%) rename {img => icons}/y/yahoo.com.svg (100%) diff --git a/.github/workflows/repository.yml b/.github/workflows/repository.yml index 6f922e6..04ad8ce 100644 --- a/.github/workflows/repository.yml +++ b/.github/workflows/repository.yml @@ -80,7 +80,7 @@ jobs: PGP_PASSWORD: ${{ secrets.PGP_PASSWORD }} PGP_KEY_ID: ${{ steps.pgp.outputs.keyid }} - name: Prepare publish directory - run: mv img/ public/icons + run: mv icons/ public/icons - uses: actions/upload-pages-artifact@v1 with: path: public/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7680a35..6eb7e05 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -182,7 +182,7 @@ If linking to more than one, add each category in an array. Icons enhance brand recognition and contribute to a cohesive user experience within the Passkeys Directory. When adding a new entry, including an icon is mandatory. -Icons should be placed in `img/` subdirectories and named after the entry's domain. For instance, the icon for `youtube.com` should be in `img/y/` and named `youtube.com.svg` or `youtube.com.png`. +Icons should be placed in `icons/` subdirectories and named after the entry's domain. For instance, the icon for `youtube.com` should be in `icons/y/` and named `youtube.com.svg` or `youtube.com.png`. SVG format is preferred due to its smaller size and compatibility with various resolutions. If you don't have an SVG icon, a PNG is acceptable with resolutions of 32x32, 64x64, or 128x128. For SVG icons, consider optimizing them using tools like [SVGOMG][svgomg] to reduce the file size. diff --git a/README.md b/README.md index f64822b..99a573b 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ We welcome all contributions to the project, but please read [CONTRIBUTING.md][c The data in this repository is licensed under a Creative Commons Attribution 4.0 International License. A copy of the license can be found in the [LICENSE.md][license] file, and on [creativecommons.org](https://creativecommons.org/licenses/by/4.0/). -The images inside `img/` are not subject to the repository's license; their respective authors own them. +The images inside `icons/` are not subject to the repository's license; their respective authors own them. Our intention is to showcase and utilize these images in a manner that respects the original creators' work and complies with fair use principles. [api]: https://passkeys.2fa.directory/api/ diff --git a/img/v/visma.com.svg b/icons/v/visma.com.svg similarity index 100% rename from img/v/visma.com.svg rename to icons/v/visma.com.svg diff --git a/img/y/yahoo.com.svg b/icons/y/yahoo.com.svg similarity index 100% rename from img/y/yahoo.com.svg rename to icons/y/yahoo.com.svg diff --git a/tests/svg_lint.rb b/tests/svg_lint.rb index 774e965..daefd04 100755 --- a/tests/svg_lint.rb +++ b/tests/svg_lint.rb @@ -23,7 +23,7 @@ def test(svg_content, xpath_expression, parent_element = '/svg') end @status = 0 -diff = `git diff --name-only --diff-filter=Ard origin/master...HEAD -- 'img/***.svg'`.split("\n") +diff = `git diff --name-only --diff-filter=Ard origin/master...HEAD -- 'icons/***.svg'`.split("\n") diff.each do |file| svg = File.read(file) error(file, 'Invalid SVG file') if Nokogiri::XML(svg).errors.any? diff --git a/tests/validate_fs.sh b/tests/validate_fs.sh index 1bf10a2..57d1294 100755 --- a/tests/validate_fs.sh +++ b/tests/validate_fs.sh @@ -32,11 +32,11 @@ function checkPerm() } [ -e api ] && checkExt api json sig -checkExt img svg png +checkExt icons svg png checkExt entries json checkExt scripts rb checkExt tests rb sh json -checkPerm img 664 644 +checkPerm icons 664 644 checkPerm tests 775 755 664 644 checkPerm entries 664 644 checkPerm scripts 775 755 diff --git a/tests/validate_images.rb b/tests/validate_images.rb index bb2d22b..3f8803c 100755 --- a/tests/validate_images.rb +++ b/tests/validate_images.rb @@ -26,7 +26,7 @@ def alternative_src(image) website = JSON.parse(File.read(file)).values[0] domain = File.basename(file, '.*') img = website['img'] || "#{domain}.svg" - path = "img/#{img[0]}/#{img}" + path = "icons/#{img[0]}/#{img}" unless File.exist?(path) || alternative_src(img) error(file, "Image does not exist for #{domain} - #{path} cannot be found.") end @@ -36,7 +36,7 @@ def alternative_src(image) seen_sites.push(path) if File.exist?(path) end -Dir.glob('img/*/*') do |file| +Dir.glob('icons/*/*') do |file| next if file.include? '/icons/' error(file, 'Unused image') unless seen_sites.include? file