mirror of
https://github.com/pacnpal/pacnpal.git
synced 2026-02-04 19:55:13 -05:00
Fix SVG formatting to display properly on GitHub
Co-authored-by: pacnpal <183241239+pacnpal@users.noreply.github.com>
This commit is contained in:
26
.github/workflows/update-readme-stats.yml
vendored
26
.github/workflows/update-readme-stats.yml
vendored
@@ -31,6 +31,32 @@ jobs:
|
||||
path: profile/top-langs.svg
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Fix SVG formatting
|
||||
run: |
|
||||
# Remove leading whitespace from SVG files so they render properly on GitHub
|
||||
python3 << 'EOF'
|
||||
import glob
|
||||
|
||||
for filename in glob.glob('profile/*.svg'):
|
||||
with open(filename, 'r') as f:
|
||||
lines = f.readlines()
|
||||
|
||||
# Skip leading empty lines
|
||||
start_idx = 0
|
||||
for i, line in enumerate(lines):
|
||||
if line.strip():
|
||||
start_idx = i
|
||||
break
|
||||
|
||||
# Strip leading whitespace from the first non-empty line
|
||||
if start_idx < len(lines):
|
||||
lines[start_idx] = lines[start_idx].lstrip()
|
||||
|
||||
# Write back starting from the first non-empty line
|
||||
with open(filename, 'w') as f:
|
||||
f.writelines(lines[start_idx:])
|
||||
EOF
|
||||
|
||||
- name: Commit cards
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
|
||||
<svg
|
||||
<svg
|
||||
width="467"
|
||||
height="195"
|
||||
viewBox="0 0 467 195"
|
||||
|
||||
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.5 KiB |
@@ -1,5 +1,4 @@
|
||||
|
||||
<svg
|
||||
<svg
|
||||
width="300"
|
||||
height="165"
|
||||
viewBox="0 0 300 165"
|
||||
|
||||
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
Reference in New Issue
Block a user