From 5d3ceb9eb5ebf8750c7bd8650f6152cf70f931b1 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Tue, 11 Dec 2018 08:12:57 -0800 Subject: [PATCH] perf(svgs): remove unused svg s (#778) * perf(svgs): remove unused svg <title>s * remove double svg wrapper --- bin/build-svg.js | 1 - bin/svgs.js | 76 ++++++++++++++++++++++---------------------- src/template.html | 81 +++++++++++++++++++++++------------------------ 3 files changed, 77 insertions(+), 81 deletions(-) diff --git a/bin/build-svg.js b/bin/build-svg.js index 0d451976..9d89fc8b 100755 --- a/bin/build-svg.js +++ b/bin/build-svg.js @@ -21,7 +21,6 @@ async function main () { let $symbol = $('<symbol></symbol>') .attr('id', svg.id) .attr('viewBox', `0 0 ${optimized.info.width} ${optimized.info.height}`) - .append($('<title>').text(svg.title)) .append($path) return $.xml($symbol) }))).join('\n') diff --git a/bin/svgs.js b/bin/svgs.js index 0ee93bb6..977ecce8 100644 --- a/bin/svgs.js +++ b/bin/svgs.js @@ -1,40 +1,40 @@ module.exports = [ - { id: 'pinafore-logo', src: 'original-static/sailboat.svg', title: 'Home' }, - { id: 'fa-bell', src: 'node_modules/font-awesome-svg-png/white/svg/bell.svg', title: 'Notifications' }, - { id: 'fa-users', src: 'node_modules/font-awesome-svg-png/white/svg/users.svg', title: 'Local' }, - { id: 'fa-globe', src: 'node_modules/font-awesome-svg-png/white/svg/globe.svg', title: 'Federated' }, - { id: 'fa-gear', src: 'node_modules/font-awesome-svg-png/white/svg/gear.svg', title: 'Settings' }, - { id: 'fa-reply', src: 'node_modules/font-awesome-svg-png/white/svg/reply.svg', title: 'Reply' }, - { id: 'fa-reply-all', src: 'node_modules/font-awesome-svg-png/white/svg/reply-all.svg', title: 'Reply to thread' }, - { id: 'fa-retweet', src: 'node_modules/font-awesome-svg-png/white/svg/retweet.svg', title: 'Boost' }, - { id: 'fa-star', src: 'node_modules/font-awesome-svg-png/white/svg/star.svg', title: 'Favorite' }, - { id: 'fa-ellipsis-h', src: 'node_modules/font-awesome-svg-png/white/svg/ellipsis-h.svg', title: 'More' }, - { id: 'fa-spinner', src: 'node_modules/font-awesome-svg-png/white/svg/spinner.svg', title: 'Spinner' }, - { id: 'fa-user', src: 'node_modules/font-awesome-svg-png/white/svg/user.svg', title: 'Empty user profile' }, - { id: 'fa-play-circle', src: 'node_modules/font-awesome-svg-png/white/svg/play-circle.svg', title: 'Play' }, - { id: 'fa-eye', src: 'node_modules/font-awesome-svg-png/white/svg/eye.svg', title: 'Show Sensitive Content' }, - { id: 'fa-eye-slash', src: 'node_modules/font-awesome-svg-png/white/svg/eye-slash.svg', title: 'Hide Sensitive Content' }, - { id: 'fa-lock', src: 'node_modules/font-awesome-svg-png/white/svg/lock.svg', title: 'Locked' }, - { id: 'fa-unlock', src: 'node_modules/font-awesome-svg-png/white/svg/unlock.svg', title: 'Unlocked' }, - { id: 'fa-envelope', src: 'node_modules/font-awesome-svg-png/white/svg/envelope.svg', title: 'Sealed Envelope' }, - { id: 'fa-user-times', src: 'node_modules/font-awesome-svg-png/white/svg/user-times.svg', title: 'Stop Following' }, - { id: 'fa-user-plus', src: 'node_modules/font-awesome-svg-png/white/svg/user-plus.svg', title: 'Follow' }, - { id: 'fa-external-link', src: 'node_modules/font-awesome-svg-png/white/svg/external-link.svg', title: 'External Link' }, - { id: 'fa-search', src: 'node_modules/font-awesome-svg-png/white/svg/search.svg', title: 'Search' }, - { id: 'fa-comments', src: 'node_modules/font-awesome-svg-png/white/svg/comments.svg', title: 'Conversations' }, - { id: 'fa-paperclip', src: 'node_modules/font-awesome-svg-png/white/svg/paperclip.svg', title: 'Paperclip' }, - { id: 'fa-thumb-tack', src: 'node_modules/font-awesome-svg-png/white/svg/thumb-tack.svg', title: 'Thumbtack' }, - { id: 'fa-bars', src: 'node_modules/font-awesome-svg-png/white/svg/bars.svg', title: 'List' }, - { id: 'fa-ban', src: 'node_modules/font-awesome-svg-png/white/svg/ban.svg', title: 'Ban' }, - { id: 'fa-camera', src: 'node_modules/font-awesome-svg-png/white/svg/camera.svg', title: 'Add media' }, - { id: 'fa-smile', src: 'node_modules/font-awesome-svg-png/white/svg/smile-o.svg', title: 'Custom emoji' }, - { id: 'fa-exclamation-triangle', src: 'node_modules/font-awesome-svg-png/white/svg/exclamation-triangle.svg', title: 'Content warning' }, - { id: 'fa-check', src: 'node_modules/font-awesome-svg-png/white/svg/check.svg', title: 'Check' }, - { id: 'fa-trash', src: 'node_modules/font-awesome-svg-png/white/svg/trash-o.svg', title: 'Delete' }, - { id: 'fa-hourglass', src: 'node_modules/font-awesome-svg-png/white/svg/hourglass.svg', title: 'Follow requested' }, - { id: 'fa-pencil', src: 'node_modules/font-awesome-svg-png/white/svg/pencil.svg', title: 'Compose' }, - { id: 'fa-times', src: 'node_modules/font-awesome-svg-png/white/svg/times.svg', title: 'Close' }, - { id: 'fa-volume-off', src: 'node_modules/font-awesome-svg-png/white/svg/volume-off.svg', title: 'Mute' }, - { id: 'fa-volume-up', src: 'node_modules/font-awesome-svg-png/white/svg/volume-up.svg', title: 'Unmute' }, - { id: 'fa-link', src: 'node_modules/font-awesome-svg-png/white/svg/link.svg', title: 'Link' } + { id: 'pinafore-logo', src: 'original-static/sailboat.svg' }, + { id: 'fa-bell', src: 'node_modules/font-awesome-svg-png/white/svg/bell.svg' }, + { id: 'fa-users', src: 'node_modules/font-awesome-svg-png/white/svg/users.svg' }, + { id: 'fa-globe', src: 'node_modules/font-awesome-svg-png/white/svg/globe.svg' }, + { id: 'fa-gear', src: 'node_modules/font-awesome-svg-png/white/svg/gear.svg' }, + { id: 'fa-reply', src: 'node_modules/font-awesome-svg-png/white/svg/reply.svg' }, + { id: 'fa-reply-all', src: 'node_modules/font-awesome-svg-png/white/svg/reply-all.svg' }, + { id: 'fa-retweet', src: 'node_modules/font-awesome-svg-png/white/svg/retweet.svg' }, + { id: 'fa-star', src: 'node_modules/font-awesome-svg-png/white/svg/star.svg' }, + { id: 'fa-ellipsis-h', src: 'node_modules/font-awesome-svg-png/white/svg/ellipsis-h.svg' }, + { id: 'fa-spinner', src: 'node_modules/font-awesome-svg-png/white/svg/spinner.svg' }, + { id: 'fa-user', src: 'node_modules/font-awesome-svg-png/white/svg/user.svg' }, + { id: 'fa-play-circle', src: 'node_modules/font-awesome-svg-png/white/svg/play-circle.svg' }, + { id: 'fa-eye', src: 'node_modules/font-awesome-svg-png/white/svg/eye.svg' }, + { id: 'fa-eye-slash', src: 'node_modules/font-awesome-svg-png/white/svg/eye-slash.svg' }, + { id: 'fa-lock', src: 'node_modules/font-awesome-svg-png/white/svg/lock.svg' }, + { id: 'fa-unlock', src: 'node_modules/font-awesome-svg-png/white/svg/unlock.svg' }, + { id: 'fa-envelope', src: 'node_modules/font-awesome-svg-png/white/svg/envelope.svg' }, + { id: 'fa-user-times', src: 'node_modules/font-awesome-svg-png/white/svg/user-times.svg' }, + { id: 'fa-user-plus', src: 'node_modules/font-awesome-svg-png/white/svg/user-plus.svg' }, + { id: 'fa-external-link', src: 'node_modules/font-awesome-svg-png/white/svg/external-link.svg' }, + { id: 'fa-search', src: 'node_modules/font-awesome-svg-png/white/svg/search.svg' }, + { id: 'fa-comments', src: 'node_modules/font-awesome-svg-png/white/svg/comments.svg' }, + { id: 'fa-paperclip', src: 'node_modules/font-awesome-svg-png/white/svg/paperclip.svg' }, + { id: 'fa-thumb-tack', src: 'node_modules/font-awesome-svg-png/white/svg/thumb-tack.svg' }, + { id: 'fa-bars', src: 'node_modules/font-awesome-svg-png/white/svg/bars.svg' }, + { id: 'fa-ban', src: 'node_modules/font-awesome-svg-png/white/svg/ban.svg' }, + { id: 'fa-camera', src: 'node_modules/font-awesome-svg-png/white/svg/camera.svg' }, + { id: 'fa-smile', src: 'node_modules/font-awesome-svg-png/white/svg/smile-o.svg' }, + { id: 'fa-exclamation-triangle', src: 'node_modules/font-awesome-svg-png/white/svg/exclamation-triangle.svg' }, + { id: 'fa-check', src: 'node_modules/font-awesome-svg-png/white/svg/check.svg' }, + { id: 'fa-trash', src: 'node_modules/font-awesome-svg-png/white/svg/trash-o.svg' }, + { id: 'fa-hourglass', src: 'node_modules/font-awesome-svg-png/white/svg/hourglass.svg' }, + { id: 'fa-pencil', src: 'node_modules/font-awesome-svg-png/white/svg/pencil.svg' }, + { id: 'fa-times', src: 'node_modules/font-awesome-svg-png/white/svg/times.svg' }, + { id: 'fa-volume-off', src: 'node_modules/font-awesome-svg-png/white/svg/volume-off.svg' }, + { id: 'fa-volume-up', src: 'node_modules/font-awesome-svg-png/white/svg/volume-up.svg' }, + { id: 'fa-link', src: 'node_modules/font-awesome-svg-png/white/svg/link.svg' } ] diff --git a/src/template.html b/src/template.html index 363097e9..48f8b3ac 100644 --- a/src/template.html +++ b/src/template.html @@ -61,51 +61,48 @@ html{scrollbar-face-color:var(--scrollbar-face-color);scrollbar-track-color:var( - - - + - -Notifications -Local -Federated -Settings -Reply -Reply to thread -Boost -Favorite -More -Spinner -Empty user profile -Play -Show Sensitive Content -Hide Sensitive Content -Locked -Unlocked -Sealed Envelope -Stop Following -Follow -External Link -Search -Conversations -Paperclip -Thumbtack -List -Ban -Add media -Custom emoji -Content warning -Check -Delete -Follow requested -Compose -Close -Mute -Unmute -Link + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -