From 2ab6c4604d0344c6bbdb6fd872f0f27844f2f7e4 Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <othacehe@gnu.org>
Date: Fri, 19 Feb 2021 09:53:16 +0100
Subject: [PATCH] Add favicon support.

* src/cuirass/http.scm (%file-white-list): Rename "logo.png" into "guix.png".
Add "icon.png" and "icon.svg".
* src/cuirass/templates.scm (html-page): Adapt it.
* src/static/images/logo.png: Rename it ...
* src/static/images/guix.png: ... into this file.
* src/static/images/icon.png: New file.
* src/static/images/icon.svg: New file.
---
 src/cuirass/http.scm                     |   4 +-
 src/cuirass/templates.scm                |   6 +-
 src/static/images/{logo.png => guix.png} | Bin
 src/static/images/icon.png               | Bin 0 -> 864 bytes
 src/static/images/icon.svg               | 152 +++++++++++++++++++++++
 5 files changed, 160 insertions(+), 2 deletions(-)
 rename src/static/images/{logo.png => guix.png} (100%)
 create mode 100644 src/static/images/icon.png
 create mode 100644 src/static/images/icon.svg

diff --git a/src/cuirass/http.scm b/src/cuirass/http.scm
index 73f71511..d6eeb8c2 100644
--- a/src/cuirass/http.scm
+++ b/src/cuirass/http.scm
@@ -77,7 +77,9 @@
     "css/open-iconic-bootstrap.css"
     "fonts/open-iconic.otf"
     "fonts/open-iconic.woff"
-    "images/logo.png"
+    "images/icon.png"
+    "images/icon.svg"
+    "images/guix.png"
     "js/chart.js"))
 
 (define (build->hydra-build build)
diff --git a/src/cuirass/templates.scm b/src/cuirass/templates.scm
index 6e8cc8f2..2a99fa61 100644
--- a/src/cuirass/templates.scm
+++ b/src/cuirass/templates.scm
@@ -117,12 +117,16 @@ system whose names start with " (code "guile-") ":" (br)
                    (href "/static/css/open-iconic-bootstrap.css")))
           (link (@ (rel "stylesheet")
                    (href "/static/css/cuirass.css")))
+          (link (@ (rel "icon") (type "image/png")
+                   (href "/static/images/icon.png")))
+          (link (@ (rel "icon") (type "image/svg+xml") (sizes "any")
+                   (href "/static/images/icon.svg")))
           (title ,title))
          (body
           (nav (@ (class "navbar navbar-expand-lg navbar-light bg-light"))
                (a (@ (class "navbar-brand pt-0")
                      (href "/"))
-                  (img (@ (src "/static/images/logo.png")
+                  (img (@ (src "/static/images/guix.png")
                           (alt "logo")
                           (height "25")
                           (style "margin-top: -12px"))))
diff --git a/src/static/images/logo.png b/src/static/images/guix.png
similarity index 100%
rename from src/static/images/logo.png
rename to src/static/images/guix.png
diff --git a/src/static/images/icon.png b/src/static/images/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..14f7cf24f8fcc1da0941ad6e67e2054f5e3a7d6b
GIT binary patch
literal 864
zcmV-m1E2hfP)<h;3K|Lk000e1NJLTq000mG000mO1^@s6AM^iV0004mX+uL$Nkc;*
zaB^>EX>4Tx04R}tkv&MmKpe$i(@Kj}9NIy|AwzYt;1}YkRVYG*P%E_RU~=gfG-*gu
zTpR`0f`cE6RR<SmT^(EnLGS~_&CN;CMN0f%QfLwD!Ery{-Fw`<1B6C}X;xqi&~)2O
zClg{ew<-o-As~Vf#u1R2Wz0!Z3SGz7J$!t<i}S4R=l&dhYTjaiPb8jYhG`RT5KnK~
z2Iqa^C@aY-@j3CRNf#u3<htVV8|R|S0?&+^ne;qylvpfwu+qV-WNO4y#4%OVDPPEX
zta9GstW|2Pbx;1na9&?o<~q$GB(aDkND!f*hB7L!5vNrr#X_3)6J7j+u3sXTLas6x
zITlcb2HEw4|H1EWt-|DlmlRF_Jui;)F$@HEfo9!tzK<QJc>?&Kfh)c3uQq_0Ptxmc
zEp`O-Zvz+CZB5w&E_Z-|Cqp)6SMt*o3I*W(jJ_!cL~eoJHLthUK29Hi40V;d0S*p<
zks@WUcX@ZHv$ucGwEFu2Ika++^lKRu00006VoOIv0RI600RN!9r;`8x010qNS#tmY
z4c7nw4c7reD4Tcy000McNliru<pL83F)&=F?Ir*K0bNN%K~y-)#go5FLQxcezo!l+
zad{bm5Bgz4M2kW}X>C4o4MfC6|AE$)XlQC^u{|2f2MrEQE<JzHXp4aqK@dg0!9@ur
z7va5zFnFaPNc2tT-UA=!+;gs^D2l}xI2aRGKhQJ{RaI?CUDvTLQ*1Aow)^s%MEcrg
z7pSUAG#W*gWdMW_BoYY#UfW=FzKRXbm_+8S!7X^bUUIn{*=!a7kH^DRbCLb$HH^p!
z_p66!kIum@0JvPXBY{AG-J?_7Za0NO0Yy=$Th?&FPb!rPx0w_Vok`|4V^phE)Coox
z0Id7qV51G3gXb^DIE))Z;_OM_--^*{wNO9uB$v(61ffs}Uq=6a#BexF{USfSf?ls@
zOV(;NwBtSAC7GRMnnt66Q<8=Yn$0HhcpQhrfe?ajw@YmLg{3JIqkP9K5L___3reLD
q#bWW-Dg*ch_=Ra(<v!BC|He<z9%^}Aie@AL0000<MNUMnLSTYKo^pu*

literal 0
HcmV?d00001

diff --git a/src/static/images/icon.svg b/src/static/images/icon.svg
new file mode 100644
index 00000000..84fda229
--- /dev/null
+++ b/src/static/images/icon.svg
@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<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="200"
+   height="200.00011"
+   id="svg2"
+   version="1.1"
+   inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"
+   sodipodi:docname="icon.svg">
+  <title
+     id="title3831">Cuirass icon</title>
+  <defs
+     id="defs4" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="1"
+     inkscape:cx="387.83802"
+     inkscape:cy="172.5298"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1920"
+     inkscape:window-height="1016"
+     inkscape:window-x="0"
+     inkscape:window-y="27"
+     inkscape:window-maximized="1"
+     inkscape:showpageshadow="false"
+     borderlayer="true"
+     inkscape:document-rotation="0"
+     inkscape:snap-global="true"
+     showguides="true"
+     inkscape:guide-bbox="true"
+     inkscape:snap-bbox="true"
+     fit-margin-top="0"
+     fit-margin-left="0"
+     fit-margin-right="0"
+     fit-margin-bottom="0"
+     showborder="false">
+    <inkscape:grid
+       type="axonomgrid"
+       id="grid3004"
+       units="mm"
+       empspacing="5"
+       visible="true"
+       enabled="true"
+       snapvisiblegridlinesonly="true"
+       spacingy="3.7mm"
+       originx="-9436.2206"
+       originy="-1853.1371" />
+  </sodipodi:namedview>
+  <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>Cuirass icon</dc:title>
+        <dc:date>2021-01-09</dc:date>
+        <dc:creator>
+          <cc:Agent>
+            <dc:title>Luis Felipe Lè´¸pez Acevedo</dc:title>
+          </cc:Agent>
+        </dc:creator>
+        <dc:rights>
+          <cc:Agent>
+            <dc:title />
+          </cc:Agent>
+        </dc:rights>
+        <cc:license
+           rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
+      </cc:Work>
+      <cc:License
+         rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#Reproduction" />
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#Distribution" />
+        <cc:requires
+           rdf:resource="http://creativecommons.org/ns#Notice" />
+        <cc:requires
+           rdf:resource="http://creativecommons.org/ns#Attribution" />
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
+        <cc:requires
+           rdf:resource="http://creativecommons.org/ns#ShareAlike" />
+      </cc:License>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:groupmode="layer"
+     id="layer2"
+     inkscape:label="ref"
+     sodipodi:insensitive="true"
+     transform="translate(-9421.1025,-1821.0111)" />
+  <g
+     inkscape:label="layer"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-9421.1025,-2673.3733)">
+    <rect
+       style="fill:#191919;fill-opacity:1;stroke:none;stroke-width:0.284347"
+       id="rect4281"
+       width="200"
+       height="200.00011"
+       x="9421.1025"
+       y="2673.3733" />
+    <g
+       id="g1247"
+       transform="matrix(0.75,0,0,0.75,2361.5257,674.59333)">
+      <path
+         id="path4303"
+         style="fill:#fd7e14;fill-opacity:1;stroke:none;stroke-width:1.40209;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+         d="m 9551.1873,2698.3734 v 38.6156 h 15.2577 v -3.0224 l 6.7796,-6.7797 h 20.339 20.339 l 6.7797,6.7797 v 20.0692 a 27.118644,27.118644 0 0 1 0,0.2698 v 20.3389 l -6.7797,6.7797 h -20.339 -20.339 l -6.7796,-6.7797 v -3.7572 h -15.2577 v 54.2372 h 15.2577 v -3.0223 l 6.7796,-6.7797 h 20.339 20.339 l 6.7797,6.7797 v 20.0692 a 27.118644,27.118644 0 0 1 0,0.2698 v 20.3389 l -6.7797,6.7797 h -20.339 -20.339 l -6.7796,-6.7797 v -3.7573 h -15.2577 v 39.3506 h 82.2034 l 12.7119,-12.7119 v -174.5763 l -12.7119,-12.7118 z" />
+      <path
+         id="path4305"
+         style="fill:#ffffff;fill-opacity:1;stroke-width:1.86014"
+         d="m 9458.8145,2698.3733 -12.7119,12.7119 v 174.5763 l 12.7119,12.7119 h 82.2034 v -39.3506 -8.9545 h 35.5966 v 5.9322 l 3.3898,3.3898 h 27.1186 l 3.3899,-3.3898 v -27.1187 l -3.3899,-3.3898 h -27.1186 l -3.3898,3.3898 v 5.9322 h -35.5966 v -9.6895 -54.2372 -8.9546 h 35.5966 v 5.9322 l 3.3898,3.3898 h 27.1186 l 3.3899,-3.3898 v -27.1187 l -3.3899,-3.3898 h -27.1186 l -3.3898,3.3898 v 5.9322 h -35.5966 v -9.6894 -38.6157 z m 13.5593,16.9492 h 51.6949 v 166.1017 h -51.6949 l -9.322,-9.322 v -147.4577 z m 8.4746,11.8644 -5.9322,7.6271 v 127.1187 l 7.6271,7.6271 h 29.661 v -142.3729 z m 108.4779,19.4915 h 8.4746 l 3.3898,3.3899 v 8.4745 l -3.3898,3.3899 h -8.4746 l -3.3898,-3.3899 v -8.4745 z m 0,88.1356 h 8.4746 l 3.3898,3.3899 v 8.4745 l -3.3898,3.3899 h -8.4746 l -3.3898,-3.3899 v -8.4745 z" />
+    </g>
+    <g
+       id="g850"
+       transform="translate(0,-20)">
+      <rect
+         style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.284347"
+         id="rect14"
+         width="200"
+         height="200.00011"
+         x="9421.1025"
+         y="2973.3733" />
+      <path
+         id="path16"
+         style="fill:#fd7e14;fill-opacity:1;stroke:none;stroke-width:1.05157;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+         d="m 9524.9162,2998.3734 v 28.9617 h 11.4433 v -2.2668 l 5.0846,-5.0848 h 15.2543 15.2542 l 5.0848,5.0848 v 15.0519 a 20.338983,20.338983 0 0 1 0,0.2023 v 15.2542 l -5.0848,5.0848 h -15.2542 -15.2543 l -5.0846,-5.0848 v -2.8179 h -11.4433 v 40.6779 h 11.4433 v -2.2667 l 5.0846,-5.0848 h 15.2543 15.2542 l 5.0848,5.0848 v 15.0519 a 20.338983,20.338983 0 0 1 0,0.2023 v 15.2542 l -5.0848,5.0848 h -15.2542 -15.2543 l -5.0846,-5.0848 v -2.818 h -11.4433 v 29.513 h 61.6525 l 9.534,-9.5339 v -130.9323 l -9.534,-9.5338 z" />
+      <path
+         id="path18"
+         style="fill:#191919;fill-opacity:1;stroke-width:1.39511"
+         d="m 9455.6366,2998.3733 -9.5339,9.5339 v 130.9323 l 9.5339,9.5339 h 61.6525 v -29.513 -6.7158 h 26.6975 v 4.4491 l 2.5423,2.5424 h 20.339 l 2.5424,-2.5424 v -20.339 l -2.5424,-2.5424 h -20.339 l -2.5423,2.5424 v 4.4491 h -26.6975 v -7.2671 -40.6779 -6.7159 h 26.6975 v 4.4491 l 2.5423,2.5424 h 20.339 l 2.5424,-2.5424 v -20.339 l -2.5424,-2.5424 h -20.339 l -2.5423,2.5424 v 4.4491 h -26.6975 v -7.267 -28.9618 z m 10.1695,12.7119 h 38.7711 v 124.5763 h -38.7711 l -6.9915,-6.9915 v -110.5933 z m 6.3559,8.8983 -4.4491,5.7203 v 95.3391 l 5.7203,5.7203 h 22.2457 v -106.7797 z m 81.3584,14.6186 h 6.356 l 2.5423,2.5425 v 6.3558 l -2.5423,2.5425 h -6.356 l -2.5423,-2.5425 v -6.3558 z m 0,66.1017 h 6.356 l 2.5423,2.5425 v 6.3558 l -2.5423,2.5425 h -6.356 l -2.5423,-2.5425 v -6.3558 z" />
+    </g>
+  </g>
+</svg>
-- 
GitLab