Skip to content

A simple web service to offer permalinks to your logos

License

Notifications You must be signed in to change notification settings

MaxValue/logos-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Logos Server

A simple web service to offer permalinks to your logos

  • Do you want to have permanent links to the logo of your group/verein?
  • Does your logo come in different variants?
  • Do you want to swap your logos style at specific times during the year?
  • Does your group/verein have subgroups with a different logo?

This script tries to satisfy these requirements.

[TOC]

Script Usage

./logos.sh /path/to/logos/dir defaultGroupName currentStyleName

  • logos.sh is the script name, as seen in this repository
  • /path/to/logos/dir should be replaced with the path where your logos are stored (more about the directory structure needed later)
  • defaultGroupName should be replaced with the name of the subgroup which should be assumed as default (more on that later)
  • currentStyleName should be replaced with the name of style which should be assumed as default (more on that later)
  • there is an optional fourth argument: svg/webp/png/jpg/ico This specifies the preference of file extensions for the symlink without a file extension. If the first format is not found, the next one is tried. With this argument you can change the order in which these extensions are tried.

The required directory structure

  • logosRootDir/
    • groupName/
      • default_full.ico
      • default_full.png
      • default_full.svg
      • default_name.ico
      • default_name.png
      • default_name.svg
      • default_square.ico
      • default_square.png
      • default_square.svg
      • pride_full.ico
      • pride_full.png
      • pride_full.svg
      • pride_name.ico
      • pride_name.png
      • pride_name.svg
      • pride_square.ico
      • pride_square.png
      • pride_square.svg

You do not need to provide all these variants. This is just an example. The important part is, that your canonical logo (the default design) is named beginning with default_ and other style variants have their specific prefix. Everything after the first _ is not important, here it is used for differentiating between the form factors of the logo.

What the script does in detail

  • for each group it creates symlinks to the current style variant. These symlinks start with logo_
  • it also creates a file-extension-less symlink of each format variant for each style, as convenience
  • in the root directory of the logos it creates symlinks for all the files of the default group

This behavior results in links like these:

Script Setup

Prerequisites

  • bash shell
  • find command

Step by Step

  1. Download the script
  2. Create your directory structure
  3. Run the script, e.g.: ./logos.sh /path/to/logos/dir AT default
  4. Setup your web server to point to that directory structure
  5. Optionally setup a cronjob to change the default group at specific times of the year, e.g.:
    • at pride month: */3 * 1 6 * logosuser ./logos.sh /path/to/logos/dir AT pride
    • after pride month: */3 * 1 7 * logosuser ./logos.sh /path/to/logos/dir AT default

Roadmap

  • Support .htaccess files and nginx rules as alternative to cronjobs

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

  • Max Fuxjäger - Initial work - MaxValue

See also the list of contributors who participated in this project.

Project History

This project was created because I (Max) needed a low maintenance solution for swapping logos on a Verein-Website without changing each link and, if possible, have the logos updated if those were hotlinked to from other sites. I did not find anything similar, at least not as simple as this, so in a procrastination streak I wrote this script.