Skip to content

Commit

Permalink
Rename img/ to icons/
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlgo11 committed Nov 15, 2023
1 parent 121e16a commit 89757ac
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/repository.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
File renamed without changes
File renamed without changes
2 changes: 1 addition & 1 deletion tests/svg_lint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
4 changes: 2 additions & 2 deletions tests/validate_fs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/validate_images.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 89757ac

Please sign in to comment.