Added icons and OpenGraph information

This commit is contained in:
Quantum 2018-12-08 20:42:11 -05:00
parent 86896e7fdd
commit 796915e87b
14 changed files with 260 additions and 0 deletions

View file

@ -3,6 +3,7 @@ import errno
import os import os
from html import escape from html import escape
from hashlib import sha256 from hashlib import sha256
from shutil import copyfile
import yaml import yaml
from rcssmin import cssmin from rcssmin import cssmin
@ -12,6 +13,7 @@ SRC_DIR = os.path.join(DIR, 'src')
DIST_DIR = os.path.join(DIR, 'dist') DIST_DIR = os.path.join(DIR, 'dist')
ASSETS_SRC = os.path.join(SRC_DIR, 'assets') ASSETS_SRC = os.path.join(SRC_DIR, 'assets')
ASSETS_DIST = os.path.join(DIST_DIR, 'assets') ASSETS_DIST = os.path.join(DIST_DIR, 'assets')
ICONS_SRC = os.path.join(SRC_DIR, 'icons')
def build_assets(): def build_assets():
@ -35,6 +37,11 @@ def build_assets():
return name_map return name_map
def build_icons():
for icon in os.listdir(ICONS_SRC):
copyfile(os.path.join(ICONS_SRC, icon), os.path.join(DIST_DIR, icon))
def build_links(links): def build_links(links):
output = [] output = []
for section in links['sections']: for section in links['sections']:
@ -96,6 +103,7 @@ def main():
links = yaml.safe_load(f) links = yaml.safe_load(f)
name_map = build_assets() name_map = build_assets()
build_icons()
build_index(name_map, links) build_index(name_map, links)
build_redirects(links) build_redirects(links)

137
icon.svg Normal file
View file

@ -0,0 +1,137 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="110"
height="110"
viewBox="0 0 110 110"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="icon.svg"
inkscape:export-filename="R:\uwat.cf.png"
inkscape:export-xdpi="209.45"
inkscape:export-ydpi="209.45">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="2"
inkscape:cx="-36.760196"
inkscape:cy="7.1601169"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
units="px"
inkscape:window-width="1600"
inkscape:window-height="837"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-275.20961,-131.22799)">
<g
transform="matrix(0.23343049,0,0,0.23343049,276.8671,132.88565)"
id="link"
style="fill:#fcd634;fill-opacity:1;stroke:#231f20;stroke-opacity:1;stroke-width:4.28393052;stroke-miterlimit:4;stroke-dasharray:none">
<desc
id="desc4971">Based on https://commons.wikimedia.org/wiki/File:Simpleicons_Interface_link-symbol.svg
Licensed under CC-BY 3.0 Unported.</desc>
<path
inkscape:connector-curvature="0"
d="m 421.512,207.074 -85.795,85.767 c -47.352,47.38 -124.169,47.38 -171.529,0 -7.46,-7.439 -13.296,-15.821 -18.421,-24.465 l 39.864,-39.861 c 1.895,-1.911 4.235,-3.006 6.471,-4.296 2.756,9.416 7.567,18.33 14.972,25.736 23.648,23.667 62.128,23.634 85.762,0 l 85.768,-85.765 c 23.666,-23.664 23.666,-62.135 0,-85.781 -23.635,-23.646 -62.105,-23.646 -85.768,0 l -30.499,30.532 c -24.75,-9.637 -51.415,-12.228 -77.373,-8.424 l 64.991,-64.989 c 47.38,-47.371 124.177,-47.371 171.557,0 47.357,47.369 47.357,124.178 0,171.546 z m -226.804,141.03 -30.521,30.532 c -23.646,23.634 -62.128,23.634 -85.778,0 -23.648,-23.667 -23.648,-62.138 0,-85.795 l 85.778,-85.767 c 23.665,-23.662 62.121,-23.662 85.767,0 7.388,7.39 12.204,16.302 14.986,25.706 2.249,-1.307 4.56,-2.369 6.454,-4.266 l 39.861,-39.845 c -5.092,-8.678 -10.958,-17.03 -18.421,-24.477 -47.348,-47.371 -124.172,-47.371 -171.543,0 L 35.526,249.96 c -47.366,47.385 -47.366,124.172 0,171.553 47.371,47.356 124.177,47.356 171.547,0 l 65.008,-65.003 c -25.972,3.826 -52.644,1.213 -77.373,-8.406 z"
id="path4320"
style="fill:#fcd634;fill-opacity:1;stroke:#231f20;stroke-opacity:1;stroke-width:4.28393052;stroke-miterlimit:4;stroke-dasharray:none" />
</g>
<g
transform="matrix(0.11965233,0,0,0.11965233,330.6093,186.5226)"
id="g4322" />
<g
transform="matrix(0.11965233,0,0,0.11965233,330.6093,186.5226)"
id="g4324" />
<g
transform="matrix(0.11965233,0,0,0.11965233,330.6093,186.5226)"
id="g4326" />
<g
transform="matrix(0.11965233,0,0,0.11965233,330.6093,186.5226)"
id="g4328" />
<g
transform="matrix(0.11965233,0,0,0.11965233,330.6093,186.5226)"
id="g4330" />
<g
transform="matrix(0.11965233,0,0,0.11965233,330.6093,186.5226)"
id="g4332" />
<g
transform="matrix(0.11965233,0,0,0.11965233,330.6093,186.5226)"
id="g4334" />
<g
transform="matrix(0.11965233,0,0,0.11965233,330.6093,186.5226)"
id="g4336" />
<g
transform="matrix(0.11965233,0,0,0.11965233,330.6093,186.5226)"
id="g4338" />
<g
transform="matrix(0.11965233,0,0,0.11965233,330.6093,186.5226)"
id="g4340" />
<g
transform="matrix(0.11965233,0,0,0.11965233,330.6093,186.5226)"
id="g4342" />
<g
transform="matrix(0.11965233,0,0,0.11965233,330.6093,186.5226)"
id="g4344" />
<g
transform="matrix(0.11965233,0,0,0.11965233,330.6093,186.5226)"
id="g4346" />
<g
transform="matrix(0.11965233,0,0,0.11965233,330.6093,186.5226)"
id="g4348" />
<g
transform="matrix(0.11965233,0,0,0.11965233,330.6093,186.5226)"
id="g4350" />
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:65.68777466px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#cf0f3d;fill-opacity:1;stroke:#231f20;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
x="292.64102"
y="236.72408"
id="text4973"
sodipodi:linespacing="125%"
transform="scale(0.98646697,1.0137187)"><tspan
sodipodi:role="line"
id="tspan4975"
x="292.64102"
y="236.72408"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:56.30380249px;font-family:'Segoe UI';-inkscape-font-specification:'Segoe UI Bold';fill:#cf0f3d;fill-opacity:1;stroke:#231f20;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">UW</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/mstile-150x150.png"/>
<TileColor>#2b5797</TileColor>
</tile>
</msapplication>
</browserconfig>

BIN
src/icons/favicon-16x16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
src/icons/favicon-32x32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
src/icons/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
src/icons/og-image.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View file

@ -0,0 +1,74 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="1024.000000pt" height="1024.000000pt" viewBox="0 0 1024.000000 1024.000000"
preserveAspectRatio="xMidYMid meet">
<metadata>
Created by potrace 1.11, written by Peter Selinger 2001-2013
</metadata>
<g transform="translate(0.000000,1024.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M7235 10124 c-585 -60 -1069 -258 -1499 -612 -87 -72 -1689 -1662
-1682 -1670 2 -2 75 7 162 19 135 20 203 23 444 24 311 0 404 -8 645 -56 172
-34 236 -52 428 -116 l137 -47 398 395 c413 412 450 443 619 528 166 83 314
120 509 128 224 10 411 -29 610 -127 559 -273 832 -889 664 -1500 -29 -105
-127 -300 -198 -395 -38 -49 -450 -468 -1079 -1096 -866 -864 -1031 -1025
-1104 -1073 -214 -140 -446 -209 -704 -209 -553 0 -1031 347 -1200 873 -15 47
-29 86 -30 88 -2 2 -40 -19 -86 -47 -74 -44 -138 -103 -544 -510 l-460 -461
19 -32 c40 -70 187 -286 241 -353 30 -38 96 -111 145 -161 l90 -90 0 -831 0
-830 -92 -89 c-51 -49 -125 -111 -165 -137 -112 -74 -270 -145 -400 -179 -110
-29 -130 -31 -298 -32 -116 -1 -204 4 -247 13 l-68 13 0 1147 c0 902 -3 1151
-13 1164 -10 14 -38 17 -200 19 l-187 3 897 895 c812 809 906 900 985 949 335
205 718 251 1085 130 379 -125 674 -424 798 -809 15 -47 29 -86 30 -88 1 -1
40 20 86 47 75 44 136 102 544 510 l460 461 -19 32 c-43 75 -188 288 -240 353
-74 92 -240 259 -347 349 -383 323 -878 537 -1389 601 -147 18 -471 21 -616 5
-506 -56 -993 -259 -1404 -586 -108 -85 -2132 -2108 -2232 -2230 -316 -385
-512 -823 -590 -1319 -32 -202 -32 -588 0 -790 176 -1124 1015 -2009 2112
-2230 47 -10 135 -34 195 -55 234 -80 416 -105 724 -97 251 6 379 26 564 87
288 96 491 249 653 490 43 64 82 110 121 140 32 25 275 260 540 523 376 374
482 475 486 460 3 -10 97 -376 208 -813 111 -437 209 -803 217 -812 14 -17 51
-18 502 -18 408 0 489 2 499 14 9 10 646 2451 652 2496 0 3 141 -554 314
-1238 172 -683 318 -1249 325 -1257 11 -13 80 -15 479 -15 256 0 472 4 480 9
19 12 980 3750 971 3776 -7 20 -18 20 -449 23 l-441 2 -10 -22 c-5 -13 -124
-594 -265 -1292 -140 -698 -256 -1271 -258 -1272 -2 -2 -139 571 -306 1274
-167 702 -307 1285 -312 1295 -9 15 -31 17 -237 17 l-227 0 881 883 c485 485
915 923 956 973 315 383 512 824 590 1319 18 117 22 181 22 395 0 214 -4 278
-22 395 -185 1179 -1083 2077 -2256 2256 -126 20 -506 34 -611 23z m591 -113
c1149 -173 2020 -1054 2190 -2216 25 -166 25 -524 0 -690 -70 -481 -257 -914
-554 -1285 -42 -53 -482 -502 -996 -1018 l-921 -922 -173 0 c-169 0 -173 0
-182 -22 -5 -13 -30 -103 -56 -202 l-47 -178 -46 -34 c-121 -87 -369 -217
-534 -278 -109 -41 -329 -106 -356 -106 -15 0 -29 58 -99 396 -45 218 -87 403
-93 410 -10 12 -89 14 -482 12 -417 -3 -471 -5 -480 -19 -7 -12 17 -123 93
-418 57 -221 100 -404 96 -408 -10 -11 -253 44 -389 87 l-127 41 0 334 c0 193
-4 345 -10 359 l-10 26 -433 0 c-323 0 -436 -3 -445 -12 -7 -7 -12 -35 -12
-62 l-1 -51 -79 83 c-72 77 -218 272 -275 368 l-24 40 447 447 c247 246 455
447 463 447 10 0 21 -16 28 -41 7 -23 37 -89 67 -147 185 -364 520 -615 937
-703 145 -31 381 -31 523 -1 203 44 377 119 534 231 64 45 345 320 1116 1093
1111 1113 1090 1091 1183 1289 97 207 126 342 126 589 0 199 -12 281 -61 430
-128 383 -424 694 -799 839 -182 71 -263 85 -485 86 -265 0 -397 -29 -615
-134 -174 -85 -242 -142 -634 -535 l-364 -364 -116 40 c-147 49 -352 100 -512
127 -215 35 -364 44 -647 39 l-265 -5 709 706 c390 389 752 741 804 783 378
303 863 508 1320 558 52 5 111 12 130 14 86 10 431 -4 556 -23z m-2875 -2786
c298 -35 571 -115 844 -249 277 -136 486 -288 700 -507 129 -132 208 -231 305
-381 l60 -93 -427 -428 c-376 -376 -486 -480 -497 -466 -1 2 -11 27 -20 54
-32 89 -117 241 -182 327 -387 517 -1105 683 -1689 390 -191 -95 -185 -89
-1165 -1068 l-925 -924 -176 0 c-123 0 -179 -4 -187 -12 -9 -9 -12 -73 -12
-228 l0 -215 -40 -93 c-148 -344 -148 -740 0 -1084 l40 -93 0 -310 c0 -170 5
-362 11 -425 42 -468 178 -803 422 -1042 43 -43 74 -78 69 -78 -35 0 -302 104
-437 170 -772 378 -1294 1104 -1421 1975 -25 166 -25 524 0 690 70 481 256
913 554 1285 109 138 2119 2145 2250 2249 411 324 872 512 1382 564 99 10 428
6 541 -8z m1830 -4901 c-148 -555 -271 -1018 -273 -1029 -4 -15 -6 -17 -10 -5
-5 12 -337 1633 -342 1664 0 4 40 19 89 32 270 73 548 190 740 313 33 21 61
37 62 36 1 0 -118 -455 -266 -1011z m-5202 464 l-1 -383 -25 95 c-29 117 -41
325 -25 448 11 81 42 222 49 222 1 0 3 -172 2 -382z m3218 236 c64 -20 185
-51 271 -68 l155 -31 72 -282 c40 -155 71 -284 69 -285 -7 -7 -191 12 -318 33
-72 11 -186 35 -255 52 l-126 32 -3 293 c-2 208 1 292 9 292 6 0 63 -16 126
-36z m144 -709 c70 -13 198 -32 285 -41 88 -9 162 -19 165 -22 3 -4 29 -99 58
-211 l52 -205 -475 -475 c-261 -261 -478 -473 -480 -470 -3 3 6 41 20 84 74
239 94 429 101 966 l6 436 71 -18 c39 -10 128 -30 197 -44z m-1181 -614 c0
-445 -107 -707 -332 -814 -97 -47 -170 -61 -303 -61 -360 2 -550 185 -619 595
l-6 36 87 -15 c135 -21 388 -11 519 22 228 57 471 185 599 316 22 22 43 40 47
40 4 0 8 -54 8 -119z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.9 KiB

View file

@ -0,0 +1,19 @@
{
"name": "uwat.cf",
"short_name": "uwat.cf",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}

View file

@ -5,6 +5,19 @@
<title>Useful UWaterloo Links</title> <title>Useful UWaterloo Links</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="assets/style.css"> <link rel="stylesheet" href="assets/style.css">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#2b5797">
<meta name="theme-color" content="#ffffff">
<meta property="og:image:width" content="256">
<meta property="og:image:height" content="256">
<meta property="og:description" content="A gateway to resources related to the University of Waterloo, made by Waterloo students for Waterloo students.">
<meta property="og:title" content="Useful UWaterloo Links">
<meta property="og:image" content="https://uwat.cf/og-image.png">
<meta property="og:url" content="https://uwat.cf/">
</head> </head>
<body> <body>