From e88d43b24196aa81582c371e398c40da7b724385 Mon Sep 17 00:00:00 2001
From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com>
Date: Wed, 5 Oct 2022 09:55:04 -0500
Subject: [PATCH] Switch to FontAwesome API
---
assets/scripts/fa-icons.js | 75 ++++++++++++++++++++++++++++++++----
layouts/_default/baseof.html | 8 +---
package-lock.json | 73 +++++++++++++++++++++++++++++++----
package.json | 4 +-
4 files changed, 139 insertions(+), 21 deletions(-)
diff --git a/assets/scripts/fa-icons.js b/assets/scripts/fa-icons.js
index 5164bed..6dfa204 100644
--- a/assets/scripts/fa-icons.js
+++ b/assets/scripts/fa-icons.js
@@ -1,13 +1,74 @@
-var faBullSperm = {
- prefix: 'fax',
- iconName: 'bull-sperm',
+import { library, icon, config, dom } from "@fortawesome/fontawesome-svg-core";
+import {
+ faBook,
+ faBrowser,
+ faComment,
+ faEllipsis,
+ faFileAlt,
+ faFileSignature,
+ faGraduationCap,
+ faHome,
+ faNotebook,
+ faPodium,
+ faPresentation,
+ faUniversity,
+ faUserAstronaut,
+ faVideo,
+ faW,
+} from "@fortawesome/pro-duotone-svg-icons";
+import {
+ faDiscord,
+ faGithub,
+ faGitlab,
+ faGolang,
+ faHtml5,
+ faOrcid,
+ faStackOverflow,
+ faSteam,
+ faVimeo,
+} from "@fortawesome/free-brands-svg-icons";
+
+config.familyDefault = "duotone";
+config.styleDefault = "duotone";
+
+const faBullSperm = {
+ prefix: "fax",
+ iconName: "bull-sperm",
icon: [
512,
512,
[],
null,
- "M96 32c-6.691.363-12.375 4.062-15.375 7.062l-64 64c-12.8 12.8-5.333 26.667 0 32l96 64c10.3 10.301 22.938 4.887 37.563-7.812 8.635 9.735 16.63 18.38 23.125 24.875 8.33 8.33 23.436 16.284 41.75 24.313 18.313 8.028 39.82 16.065 60.812 24.062 20.992 7.997 41.474 15.986 57.625 23.938 16.15 7.95 27.882 16.013 31.5 23.25 6.52 13.038 26.468 44.939 48.875 79.75 22.32 34.674 46.99 72.043 63 96.062.02.029.042.096.064.125.045.064.144.185.189.25l2.812-1.5c-10.685-26.697-28.285-68.26-46.44-106.437-18.155-38.179-36.666-72.792-49.937-86.063-16.566-16.566-56.5-32.375-96.5-48.375s-80.066-32.19-95.5-47.625c-6.45-6.45-14.409-15.11-23.063-24.875 12.926-14.779 18.51-27.552 8.125-37.938-16-26.666-51.2-83.2-64-96-5.6-5.6-11.42-7.345-16.625-7.062zm372.688 436.75c.201.487.488 1.079.687 1.563-.291-.44-.644-.995-.937-1.438.023-.012.06.001.064 0 .002 0 .185-.06.188-.064.002-.001-.011-.038 0-.064z"
- ]
-}
+ "M96 32c-6.691.363-12.375 4.062-15.375 7.062l-64 64c-12.8 12.8-5.333 26.667 0 32l96 64c10.3 10.301 22.938 4.887 37.563-7.812 8.635 9.735 16.63 18.38 23.125 24.875 8.33 8.33 23.436 16.284 41.75 24.313 18.313 8.028 39.82 16.065 60.812 24.062 20.992 7.997 41.474 15.986 57.625 23.938 16.15 7.95 27.882 16.013 31.5 23.25 6.52 13.038 26.468 44.939 48.875 79.75 22.32 34.674 46.99 72.043 63 96.062.02.029.042.096.064.125.045.064.144.185.189.25l2.812-1.5c-10.685-26.697-28.285-68.26-46.44-106.437-18.155-38.179-36.666-72.792-49.937-86.063-16.566-16.566-56.5-32.375-96.5-48.375s-80.066-32.19-95.5-47.625c-6.45-6.45-14.409-15.11-23.063-24.875 12.926-14.779 18.51-27.552 8.125-37.938-16-26.666-51.2-83.2-64-96-5.6-5.6-11.42-7.345-16.625-7.062zm372.688 436.75c.201.487.488 1.079.687 1.563-.291-.44-.644-.995-.937-1.438.023-.012.06.001.064 0 .002 0 .185-.06.188-.064.002-.001-.011-.038 0-.064z",
+ ],
+};
-FontAwesome.library.add(faBullSperm)
+library.add(
+ faBook,
+ faBrowser,
+ faBullSperm,
+ faComment,
+ faDiscord,
+ faEllipsis,
+ faFileAlt,
+ faFileSignature,
+ faGithub,
+ faGitlab,
+ faGolang,
+ faGraduationCap,
+ faHome,
+ faHtml5,
+ faNotebook,
+ faOrcid,
+ faPodium,
+ faPresentation,
+ faStackOverflow,
+ faSteam,
+ faUniversity,
+ faUserAstronaut,
+ faVideo,
+ faVimeo,
+ faW
+);
+
+dom.i2svg();
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 37f8d00..4d92820 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -111,12 +111,8 @@
- {{ $fontawesome := resources.Get "scripts/fontawesome/fontawesome.min.js" }}
- {{ $fontawesomebrands := resources.Get "scripts/fontawesome/brands.min.js" }}
- {{ $fontawesomeduo := resources.Get "scripts/fontawesome/duotone.min.js" }}
- {{ $fontawesomecustom := resources.Get "scripts/fa-icons.js" | minify }}
- {{ $fontawesomebundle := slice $fontawesome $fontawesomebrands $fontawesomeduo $fontawesomecustom | resources.Concat "js/fa-bundle.js" | fingerprint }}
-
+ {{ $fontawesome := resources.Get "scripts/fa-icons.js" | js.Build "js/fontawesome.js" | minify | fingerprint }}
+
{{ $jquery := resources.Get "scripts/jquery/jquery.min.js" }}
diff --git a/package-lock.json b/package-lock.json
index 2d97b27..83fde2e 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -9,7 +9,9 @@
"version": "0.0.0",
"license": "MIT",
"dependencies": {
- "@fortawesome/fontawesome-pro": "^6.1.1",
+ "@fortawesome/fontawesome-svg-core": "^6.2.0",
+ "@fortawesome/free-brands-svg-icons": "^6.2.0",
+ "@fortawesome/pro-duotone-svg-icons": "^6.2.0",
"@popperjs/core": "^2.11.4",
"bootstrap": "^5.1.3",
"fittext.js": "^1.2.0",
@@ -26,10 +28,43 @@
"prettier-plugin-toml": "^0.3.1"
}
},
- "node_modules/@fortawesome/fontawesome-pro": {
+ "node_modules/@fortawesome/fontawesome-common-types": {
"version": "6.2.0",
- "resolved": "https://npm.fontawesome.com/@fortawesome/fontawesome-pro/-/6.2.0/fontawesome-pro-6.2.0.tgz",
- "integrity": "sha512-T1JhszQ75ofAaa42XWBte5KsiBb7YM6CKMZTiR3zL0CHZGBabPg8J5FgMoJYlaxgrfLf+jOebDnoB0h43ljAsA==",
+ "resolved": "https://npm.fontawesome.com/@fortawesome/fontawesome-common-types/-/6.2.0/fontawesome-common-types-6.2.0.tgz",
+ "integrity": "sha512-rBevIsj2nclStJ7AxTdfsa3ovHb1H+qApwrxcTVo+NNdeJiB9V75hsKfrkG5AwNcRUNxrPPiScGYCNmLMoh8pg==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/@fortawesome/fontawesome-svg-core": {
+ "version": "6.2.0",
+ "resolved": "https://npm.fontawesome.com/@fortawesome/fontawesome-svg-core/-/6.2.0/fontawesome-svg-core-6.2.0.tgz",
+ "integrity": "sha512-Cf2mAAeMWFMzpLC7Y9H1I4o3wEU+XovVJhTiNG8ZNgSQj53yl7OCJaS80K4YjrABWZzbAHVaoHE1dVJ27AAYXw==",
+ "dependencies": {
+ "@fortawesome/fontawesome-common-types": "6.2.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/@fortawesome/free-brands-svg-icons": {
+ "version": "6.2.0",
+ "resolved": "https://npm.fontawesome.com/@fortawesome/free-brands-svg-icons/-/6.2.0/free-brands-svg-icons-6.2.0.tgz",
+ "integrity": "sha512-fm1y4NyZ2qKYNmYhdMz9VAWRw1Et7PMHNunSw3W0SVAwKwv6o0qiJworLH3Y9SnmhHzAymXJwCX1op22FFvGiA==",
+ "dependencies": {
+ "@fortawesome/fontawesome-common-types": "6.2.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/@fortawesome/pro-duotone-svg-icons": {
+ "version": "6.2.0",
+ "resolved": "https://npm.fontawesome.com/@fortawesome/pro-duotone-svg-icons/-/6.2.0/pro-duotone-svg-icons-6.2.0.tgz",
+ "integrity": "sha512-cphSgDxTr+o7qhq6AW8RrBbVfIvIqA6c/Fcbx5WgculmER+Hv6cnuliw4CrZ6KhxsfRWQRLMiYLxgTctqlpB5g==",
+ "dependencies": {
+ "@fortawesome/fontawesome-common-types": "6.2.0"
+ },
"engines": {
"node": ">=6"
}
@@ -1997,10 +2032,34 @@
}
},
"dependencies": {
- "@fortawesome/fontawesome-pro": {
+ "@fortawesome/fontawesome-common-types": {
"version": "6.2.0",
- "resolved": "https://npm.fontawesome.com/@fortawesome/fontawesome-pro/-/6.2.0/fontawesome-pro-6.2.0.tgz",
- "integrity": "sha512-T1JhszQ75ofAaa42XWBte5KsiBb7YM6CKMZTiR3zL0CHZGBabPg8J5FgMoJYlaxgrfLf+jOebDnoB0h43ljAsA=="
+ "resolved": "https://npm.fontawesome.com/@fortawesome/fontawesome-common-types/-/6.2.0/fontawesome-common-types-6.2.0.tgz",
+ "integrity": "sha512-rBevIsj2nclStJ7AxTdfsa3ovHb1H+qApwrxcTVo+NNdeJiB9V75hsKfrkG5AwNcRUNxrPPiScGYCNmLMoh8pg=="
+ },
+ "@fortawesome/fontawesome-svg-core": {
+ "version": "6.2.0",
+ "resolved": "https://npm.fontawesome.com/@fortawesome/fontawesome-svg-core/-/6.2.0/fontawesome-svg-core-6.2.0.tgz",
+ "integrity": "sha512-Cf2mAAeMWFMzpLC7Y9H1I4o3wEU+XovVJhTiNG8ZNgSQj53yl7OCJaS80K4YjrABWZzbAHVaoHE1dVJ27AAYXw==",
+ "requires": {
+ "@fortawesome/fontawesome-common-types": "6.2.0"
+ }
+ },
+ "@fortawesome/free-brands-svg-icons": {
+ "version": "6.2.0",
+ "resolved": "https://npm.fontawesome.com/@fortawesome/free-brands-svg-icons/-/6.2.0/free-brands-svg-icons-6.2.0.tgz",
+ "integrity": "sha512-fm1y4NyZ2qKYNmYhdMz9VAWRw1Et7PMHNunSw3W0SVAwKwv6o0qiJworLH3Y9SnmhHzAymXJwCX1op22FFvGiA==",
+ "requires": {
+ "@fortawesome/fontawesome-common-types": "6.2.0"
+ }
+ },
+ "@fortawesome/pro-duotone-svg-icons": {
+ "version": "6.2.0",
+ "resolved": "https://npm.fontawesome.com/@fortawesome/pro-duotone-svg-icons/-/6.2.0/pro-duotone-svg-icons-6.2.0.tgz",
+ "integrity": "sha512-cphSgDxTr+o7qhq6AW8RrBbVfIvIqA6c/Fcbx5WgculmER+Hv6cnuliw4CrZ6KhxsfRWQRLMiYLxgTctqlpB5g==",
+ "requires": {
+ "@fortawesome/fontawesome-common-types": "6.2.0"
+ }
},
"@popperjs/core": {
"version": "2.11.6",
diff --git a/package.json b/package.json
index 14e2a61..59593c7 100644
--- a/package.json
+++ b/package.json
@@ -13,7 +13,9 @@
},
"homepage": "https://github.com/MillironX/millironx.github.io#readme",
"dependencies": {
- "@fortawesome/fontawesome-pro": "^6.1.1",
+ "@fortawesome/fontawesome-svg-core": "^6.2.0",
+ "@fortawesome/free-brands-svg-icons": "^6.2.0",
+ "@fortawesome/pro-duotone-svg-icons": "^6.2.0",
"@popperjs/core": "^2.11.4",
"bootstrap": "^5.1.3",
"fittext.js": "^1.2.0",