mirror of
https://github.com/konpa/devicon.git
synced 2025-08-31 02:00:39 +02:00
Major build improvements (#1668)
* Major build improvements * Cleanup and fix path * chore: apply suggestions from code review Co-authored-by: Jørgen Kalsnes Hagen <43886029+Snailedlt@users.noreply.github.com> * Remove `selenium` from the NPM dependencies * Revert `nano` icon changes * Use quote notes * Update * chore: apply suggestions from code review Co-authored-by: Jørgen Kalsnes Hagen <43886029+Snailedlt@users.noreply.github.com> * Snailedlt/improve build changes (#187) * Make README more readable * move logic from index.html to script.js * fix devicon min css in head * Fix build script missing token error * Add more print statements to local build script * Change from ng-href to href in code view * Minor readme improvements --------- Co-authored-by: David Leal <halfpacho@gmail.com> --------- Co-authored-by: Jørgen Kalsnes Hagen <43886029+Snailedlt@users.noreply.github.com>
This commit is contained in:
@@ -14,7 +14,7 @@ devicon.controller('IconListCtrl', function($scope, $http, $compile) {
|
||||
var gitHubPath = 'devicons/devicon';
|
||||
var url = 'https://api.github.com/repos/' + gitHubPath + '/tags';
|
||||
|
||||
$scope.latestReleaseTagging = 'master';
|
||||
$scope.latestReleaseTagging = 'latest';
|
||||
$http.get(url).success(function (data) {
|
||||
if(data.length > 0) {
|
||||
$scope.latestReleaseTagging = data[0].name;
|
||||
@@ -24,7 +24,20 @@ devicon.controller('IconListCtrl', function($scope, $http, $compile) {
|
||||
});
|
||||
|
||||
var versionStr = '@' + $scope.latestReleaseTagging;
|
||||
var baseUrl = `https://cdn.jsdelivr.net/gh/${gitHubPath}${versionStr}/`
|
||||
var baseUrl
|
||||
|
||||
// Make sure one of the files exist, otherwise, use fallback link.
|
||||
var path = '/devicon.json';
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('HEAD', path, false);
|
||||
xhr.send();
|
||||
if (xhr.status == "404") {
|
||||
baseUrl = `https://cdn.jsdelivr.net/gh/${gitHubPath}${versionStr}/`
|
||||
} else {
|
||||
baseUrl = `/`;
|
||||
}
|
||||
|
||||
$scope.baseUrl = baseUrl
|
||||
|
||||
// Get devicon.json
|
||||
$http.get(baseUrl + 'devicon.json').success(function(data) {
|
||||
|
@@ -3,7 +3,7 @@
|
||||
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
|
||||
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
|
||||
<!--[if gt IE 8]><!-->
|
||||
<html class="no-js">
|
||||
<html class="no-js" ng-app="devicon" ng-controller="IconListCtrl">
|
||||
<!--<![endif]-->
|
||||
|
||||
<head>
|
||||
@@ -31,7 +31,7 @@
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="msapplication-TileImage" content="./logos/mstile-144x144.png">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/devicons/devicon/devicon.min.css">
|
||||
<link rel="stylesheet" type='text/css' ng-href="{{baseUrl}}devicon.min.css">
|
||||
<link rel="stylesheet" href="./assets/css/style.css">
|
||||
<meta property="og:title" content="Devicon" />
|
||||
<meta property="og:image" content="https://raw.githubusercontent.com/devicons/devicon/master/icons/devicon/devicon-original-wordmark.svg" />
|
||||
@@ -41,12 +41,7 @@
|
||||
<meta property="og:description" content="Devicon aims to gather all logos representing development languages and tools in one font. 🚀" />
|
||||
</head>
|
||||
|
||||
<body ng-app="devicon" ng-controller="IconListCtrl">
|
||||
<link rel="stylesheet" ng-if="latestReleaseTagging" ng-href="https://cdn.jsdelivr.net/gh/devicons/devicon@{{ latestReleaseTagging }}/devicon.min.css">
|
||||
|
||||
<!--[if lt IE 7]>
|
||||
<p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
|
||||
<![endif]-->
|
||||
<body>
|
||||
<noscript style="color:red; text-align:center;">
|
||||
<h1>To use this website, JavaScript needs to be enabled.</h1>
|
||||
<p>You can come back when you turn it on though :)</p>
|
||||
@@ -88,7 +83,7 @@
|
||||
</span>
|
||||
</p>
|
||||
<div class="cde" id='headerLinkCode'>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/devicons/devicon@{{ latestReleaseTagging }}/devicon.min.css">
|
||||
<link rel="stylesheet" type='text/css' href="{{baseUrl}}devicon.min.css" />
|
||||
</div>
|
||||
|
||||
<ul class="icons-list">
|
||||
@@ -136,8 +131,8 @@
|
||||
</h4>
|
||||
<ul class="icons-list">
|
||||
<li ng-repeat="svgVersion in selectedIcon.svg" ng-click="selectSvg(svgVersion, $index)" ng-class="{'selected-version' : $index == selectedSvgIndex}" ng-style="{'background-color': svgBackground}">
|
||||
<img src="assets/img/checkerboard.png" ng-style="{'visibility': svgDisplayCheckerboard ? 'visible' : 'hidden'}">
|
||||
<img class='svgLogo' ng-src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/{{selectedIcon.name}}/{{selectedIcon.name}}-{{svgVersion}}.svg">
|
||||
<img src="./assets/img/checkerboard.png" ng-style="{'visibility': svgDisplayCheckerboard ? 'visible' : 'hidden'}">
|
||||
<img class='svgLogo' ng-src="{{baseUrl}}icons/{{selectedIcon.name}}/{{selectedIcon.name}}-{{svgVersion}}.svg">
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
@@ -148,7 +143,7 @@
|
||||
</span>
|
||||
</p>
|
||||
<div class="cde" id='imgCode'>
|
||||
<img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/{{selectedIcon.name}}/{{selectedIcon.name}}-{{selectedIcon.svg[selectedSvgIndex]}}.svg" /><br />
|
||||
<img src="{{baseUrl}}icons/{{selectedIcon.name}}/{{selectedIcon.name}}-{{selectedIcon.svg[selectedSvgIndex]}}.svg" /><br />
|
||||
</div>
|
||||
<p><i>*To change the size, change the <img>'s <code>`height`</code> and <code>`width`</code>.</i></p>
|
||||
|
||||
@@ -172,6 +167,7 @@
|
||||
|
||||
<h3>GitHub repository</h3>
|
||||
<h5>If you prefer a local install, you can download all the files on the GitHub repository.</h5>
|
||||
<h5>Check out our <a href=https://github.com/devicons/devicon#building-devicon>ultimate guide</a> in order to compile Devicon locally.</h5>
|
||||
<p class="buttonLink">
|
||||
<a href="https://github.com/devicons/devicon/archive/master.zip"><i class="devicon-github-original"></i>DOWNLOAD</a>
|
||||
</p>
|
||||
@@ -182,18 +178,18 @@
|
||||
<a href="https://github.com/devicons/devicon/blob/master/CONTRIBUTING.md" target="blank"><i class="devicon-github-original"></i>CONTRIBUTE</a>
|
||||
</p>
|
||||
<p class="buttonLink">
|
||||
<a href="https://discord.gg/hScy8KWACQ" target="blank"><i class="discord-logo"></i>DISCORD SERVER</a>
|
||||
<a href="https://discord.gg/hScy8KWACQ" target="blank"><i class="discord-logo"></i>DISCORD COMMUNITY</a>
|
||||
</p>
|
||||
|
||||
<h3>Contact</h3>
|
||||
<h5>If you have any legal concerns regarding copyrights or want to report an abuse, please reach out to us at <b><a href="mailto:info@devicon.dev">info@devicon.dev</a></b>. Any code/logo contributions should be made through our GitHub repository listed above.</h5>
|
||||
<h5>If you have any legal concerns regarding copyrights or want to report an abuse, please reach out to us via <b><a href="mailto:info@devicon.dev">info@devicon.dev</a> or our <a href="https://discord.gg/hScy8KWACQ" target="blank">Discord community</a></b>. Any code/logo contributions should be made through our GitHub repository listed above.</h5>
|
||||
|
||||
<footer>
|
||||
Originally created by <a href="https://github.com/konpa">Konpa</a> (under <a href="https://github.com/devicons/devicon/blob/master/LICENSE">MIT License</a>) and <br />
|
||||
supported by various <a href="https://github.com/devicons/devicon/graphs/contributors">contributors</a>.<br />
|
||||
Originally created by <a href="https://github.com/konpa">Konpa</a> (under the <a href="https://github.com/devicons/devicon/blob/master/LICENSE">MIT License</a>) and <br />
|
||||
supported by many <a href="https://github.com/devicons/devicon/graphs/contributors">contributors</a>.<br />
|
||||
Copyright © 2015 <a href="https://github.com/konpa">Konpa</a><br />
|
||||
<br />
|
||||
Final font build with <a href="https://icomoon.io/">Icomoon</a><br />
|
||||
Final font built with <a href="https://icomoon.io/">IcoMoon</a><br />
|
||||
<br>
|
||||
<i>*All product names, logos, and brandsare property of their respective owners. All company, product and service names used in this website are for identification purposes only. Usage of these names, logos, and brands does not imply endorsement of Devicon or its members. All icons/SVGs in this project are not monetized in anyway. It is up to the user to use the logo properly according to the company/group's brand policy. Usage of this site or any icons/SVGs from Devicon means acknowledgement of these conditions.</i>
|
||||
</footer>
|
||||
|
Reference in New Issue
Block a user