Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor fontawesome handling #19

Open
WolfgangFahl opened this issue Aug 8, 2024 · 2 comments
Open

refactor fontawesome handling #19

WolfgangFahl opened this issue Aug 8, 2024 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@WolfgangFahl
Copy link
Member

WolfgangFahl commented Aug 8, 2024

The Icons are outdated and that leads to e.g. https://contexts.bitplan.com/index.php/Template:Icon not displaying correctly

@WolfgangFahl WolfgangFahl added the bug Something isn't working label Aug 8, 2024
@WolfgangFahl WolfgangFahl added this to the 0.2.1 milestone Aug 8, 2024
@WolfgangFahl WolfgangFahl self-assigned this Aug 8, 2024
@WolfgangFahl
Copy link
Member Author

WolfgangFahl commented Aug 12, 2024

#!/bin/bash
# WF 2024-08-12
# aided by ChatGPT

# Directory containing SVG files
SVG_DIR="/var/www/fontawesome/svgs/solid"

# MediaWiki page output file
OUTPUT_FILE=/tmp/"icons.wiki"
# Initialize a counter
counter=0
# remove file if it exists
rm $OUTPUT_FILE
# Loop through all SVG files in the directory
for f in "$SVG_DIR"/*.svg
do
  # Get the basename of the file (without the path and extension)
  basename=$(basename "$f" .svg)

  # Append the MediaWiki markup to the output file using cat << EOF
  echo "{{Icon|name=$basename|style=regular|size=48|storemode=subobject}}" >> "$OUTPUT_FILE"

  # Increment the counter
  ((counter++))

  # Add a newline after every 25 icons
  if (( counter % 25 == 0 )); then
    echo "" >> "$OUTPUT_FILE"
  fi
done

echo "Icon MediaWiki markup now at $OUTPUT_FILE"
head $OUTPUT_FILE

@WolfgangFahl
Copy link
Member Author

/var/www/fontawesome/svg# ln -s house.svg home.svg
https://contexts.bitplan.com/font-awesome/svg/home.svg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant