From d5585894dfe1e37db75889aa084c195d8d375f0c Mon Sep 17 00:00:00 2001 From: birjolaxew Date: Fri, 20 Jul 2018 20:55:35 +0200 Subject: [PATCH 1/3] Limit destructive filename mapping Changes our title -> filename mapping to be less destructive There is still some information lost (namely "!" and "`") Closes #882 --- icons/{aboutme.svg => about-dot-me.svg} | 0 icons/{brandai.svg => brand-dot-ai.svg} | 0 icons/{coop.svg => co-op.svg} | 0 icons/{devto.svg => dev-dot-to.svg} | 0 icons/{draugiemlv.svg => draugiem-dot-lv.svg} | 0 icons/{govuk.svg => gov-dot-uk.svg} | 0 icons/{lastfm.svg => last-dot-fm.svg} | 0 icons/{mailru.svg => mail-dot-ru.svg} | 0 icons/{microblog.svg => micro-dot-blog.svg} | 0 icons/{nodejs.svg => node-dot-js.svg} | 0 icons/{picartotv.svg => picarto-dot-tv.svg} | 0 icons/{playerme.svg => player-dot-me.svg} | 0 icons/{protoio.svg => proto-dot-io.svg} | 0 icons/{vuejs.svg => vue-dot-js.svg} | 0 index.html | 2 +- 15 files changed, 1 insertion(+), 1 deletion(-) rename icons/{aboutme.svg => about-dot-me.svg} (100%) rename icons/{brandai.svg => brand-dot-ai.svg} (100%) rename icons/{coop.svg => co-op.svg} (100%) rename icons/{devto.svg => dev-dot-to.svg} (100%) rename icons/{draugiemlv.svg => draugiem-dot-lv.svg} (100%) rename icons/{govuk.svg => gov-dot-uk.svg} (100%) rename icons/{lastfm.svg => last-dot-fm.svg} (100%) rename icons/{mailru.svg => mail-dot-ru.svg} (100%) rename icons/{microblog.svg => micro-dot-blog.svg} (100%) rename icons/{nodejs.svg => node-dot-js.svg} (100%) rename icons/{picartotv.svg => picarto-dot-tv.svg} (100%) rename icons/{playerme.svg => player-dot-me.svg} (100%) rename icons/{protoio.svg => proto-dot-io.svg} (100%) rename icons/{vuejs.svg => vue-dot-js.svg} (100%) diff --git a/icons/aboutme.svg b/icons/about-dot-me.svg similarity index 100% rename from icons/aboutme.svg rename to icons/about-dot-me.svg diff --git a/icons/brandai.svg b/icons/brand-dot-ai.svg similarity index 100% rename from icons/brandai.svg rename to icons/brand-dot-ai.svg diff --git a/icons/coop.svg b/icons/co-op.svg similarity index 100% rename from icons/coop.svg rename to icons/co-op.svg diff --git a/icons/devto.svg b/icons/dev-dot-to.svg similarity index 100% rename from icons/devto.svg rename to icons/dev-dot-to.svg diff --git a/icons/draugiemlv.svg b/icons/draugiem-dot-lv.svg similarity index 100% rename from icons/draugiemlv.svg rename to icons/draugiem-dot-lv.svg diff --git a/icons/govuk.svg b/icons/gov-dot-uk.svg similarity index 100% rename from icons/govuk.svg rename to icons/gov-dot-uk.svg diff --git a/icons/lastfm.svg b/icons/last-dot-fm.svg similarity index 100% rename from icons/lastfm.svg rename to icons/last-dot-fm.svg diff --git a/icons/mailru.svg b/icons/mail-dot-ru.svg similarity index 100% rename from icons/mailru.svg rename to icons/mail-dot-ru.svg diff --git a/icons/microblog.svg b/icons/micro-dot-blog.svg similarity index 100% rename from icons/microblog.svg rename to icons/micro-dot-blog.svg diff --git a/icons/nodejs.svg b/icons/node-dot-js.svg similarity index 100% rename from icons/nodejs.svg rename to icons/node-dot-js.svg diff --git a/icons/picartotv.svg b/icons/picarto-dot-tv.svg similarity index 100% rename from icons/picartotv.svg rename to icons/picarto-dot-tv.svg diff --git a/icons/playerme.svg b/icons/player-dot-me.svg similarity index 100% rename from icons/playerme.svg rename to icons/player-dot-me.svg diff --git a/icons/protoio.svg b/icons/proto-dot-io.svg similarity index 100% rename from icons/protoio.svg rename to icons/proto-dot-io.svg diff --git a/icons/vuejs.svg b/icons/vue-dot-js.svg similarity index 100% rename from icons/vuejs.svg rename to icons/vue-dot-js.svg diff --git a/index.html b/index.html index 6368507f..a057ba06 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ {% assign greyscaleIconsUnsortedString = "" %} {% for icon in site.data.simple-icons.icons %} {% assign title = icon.title %} - {% assign filename = icon.title | replace: "+", "plus" | replace: " ", "" | replace: ".", "" | replace: "-", "" | replace: "!", "" | replace: "’", "" | downcase %} + {% assign filename = icon.title | replace: "+", "plus" | replace: " ", "" | replace: ".", "-dot-" | replace: "!", "" | replace: "’", "" | downcase %} {% assign hex = icon.hex %} {% assign hex = icon.hex %} {% assign hexCharacter1 = hex | slice: 0, 1 %} From 80fe9c2ff3a76505bed7f45a75dfcf6c0dfe9e83 Mon Sep 17 00:00:00 2001 From: birjolaxew Date: Sat, 21 Jul 2018 13:17:19 +0200 Subject: [PATCH 2/3] Rename Ko-fi file --- icons/{kofi.svg => ko-fi.svg} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename icons/{kofi.svg => ko-fi.svg} (100%) diff --git a/icons/kofi.svg b/icons/ko-fi.svg similarity index 100% rename from icons/kofi.svg rename to icons/ko-fi.svg From 276f7d05c62830dad0c9e273c5deda2939a382be Mon Sep 17 00:00:00 2001 From: birjolaxew Date: Sat, 21 Jul 2018 13:22:33 +0200 Subject: [PATCH 3/3] Remove potentional extra dashes from title->filename mapping Removes dashes at start/end of filename that would appear as result of mapping This is *very* hacky, but such is Jekyll --- index.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index a057ba06..10d46ba1 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,16 @@ {% assign greyscaleIconsUnsortedString = "" %} {% for icon in site.data.simple-icons.icons %} {% assign title = icon.title %} - {% assign filename = icon.title | replace: "+", "plus" | replace: " ", "" | replace: ".", "-dot-" | replace: "!", "" | replace: "’", "" | downcase %} + {% assign filename = icon.title %} + {% assign _splitFilename = filename | split: "" %} + {% if _splitFilename.first == "." %} + {% assign filename = filename | replace_first: ".", "dot-" %} + {% endif %} + {% if _splitFilename.last == "." %} + {% assign _filenameLenMin1 = filename | size | minus: 1 %} + {% assign filename = filename | slice: 0, _filenameLenMin1 | append: "-dot" %} + {% endif %} + {% assign filename = filename | replace: "+", "plus" | replace: " ", "" | replace: ".", "-dot-" | replace: "!", "" | replace: "’", "" | downcase %} {% assign hex = icon.hex %} {% assign hex = icon.hex %} {% assign hexCharacter1 = hex | slice: 0, 1 %}