Skip to content

Commit

Permalink
feat: using l2 structure, cncf/landscape#3679 (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
alswl authored Jan 20, 2024
1 parent 7ced93a commit 96e459d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ python_lib_path = $(shell pip3 show -f omnigraffle-stencil | grep Location | awk

.PHONY: install
install:
pip3 install omnigraffle-stencil
pip3 install omnigraffle-stencil==1.1.0
pip3 install pyyaml==6.0.1

.PHONY: patch
Expand All @@ -17,21 +17,22 @@ vendor:
git clone --depth=1 $(source_git_url) vendor/landscape

.PHONY: build
build: source_icons_version=$(shell git -C vendor/landscape log --format="%h" cached_logos | head -n 1)
build: source_icons_version=$(shell git -C vendor/landscape log --format="%h" hosted_logos | head -n 1)
build:
mkdir -p output
mkdir -p build/hosted_logos
mkdir -p build/cached_logos
mkdir -p build/final
# height limits
(cd vendor/landscape/cached_logos && find . -name "*.svg" -exec rsvg-convert -h 96 -f svg {} -o ../../../build/cached_logos/{} \;)
(cd vendor/landscape/hosted_logos && find . -name "*.svg" -exec rsvg-convert -h 96 -f svg {} -o ../../../build/hosted_logos/{} \;)
# grouping
python scripts/group.py
python3 scripts/group.py
# build stencil
omnigraffle-stencil --svg build/final --stencil-file ./output/cncf-$(source_icons_version).gstencil
zip -r ./output/cncf-$(source_icons_version).gstencil.zip ./output/cncf-$(source_icons_version).gstencil

.PHONY: clean
clean:
rm -rf build
rm -rf vendor
pip3 uninstall -y omnigraffle-stencil
pip3 install omnigraffle-stencil==1.1.0
8 changes: 3 additions & 5 deletions scripts/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@
def copy(category, sub_category, logo):
os.makedirs(os.path.join(ROOT, 'build', 'final', category + " > " + sub_category), exist_ok=True)

src = os.path.join(ROOT, 'build/cached_logos', logo)
src = os.path.join(ROOT, 'build/hosted_logos', logo)
if not os.path.isfile(src):
src = os.path.join(ROOT, 'build/hosted_logos', logo)
if not os.path.isfile(src):
print('Not exist ' + src)
return
print('Not exist ' + src)
return
dest = os.path.join(ROOT, 'build', 'final', category + " > " + sub_category, logo)

copy2(src, dest)
Expand Down

0 comments on commit 96e459d

Please sign in to comment.