@@ -2,10 +2,8 @@ package geonet_footer
22
33import (
44 "bytes"
5- "embed"
5+ _ "embed"
66 "html/template"
7- "net/http"
8- "path"
97)
108
119//go:embed footer.html
@@ -21,22 +19,24 @@ var nhcLogo template.HTML
2119//go:embed images/toka_tu_ake_nhc_logo_stacked.svg
2220var nhcLogoStacked template.HTML
2321
24- //go:embed images/footer_pngs/*
25- var FooterAssetServer embed. FS
22+ //go:embed images/esnz_logo.svg
23+ var esnzLogo template. HTML
2624
27- const FOOTER_ASSET_DIR = "/images/footer_pngs/"
25+ //go:embed images/esnz_logo_stacked.svg
26+ var esnzLogoStacked template.HTML
2827
2928type FooterConfig struct {
3029 // Whether to use relative links in footer. If false, uses www.geonet.org.nz.
3130 UseRelativeLinks bool
3231 // The origin to be used at the beginning of GeoNet links in the footer.
3332 // Cannot be changed.
3433 Origin string
35- // The GeoNet, ESI, and NHC logos are fixed and cannot be changed.
36- GeoNetLogo template.HTML
37- EsiLogo string
38- NhcLogo template.HTML
39- NhcLogoStacked template.HTML
34+ // The GeoNet, ESNZ, and NHC logos are fixed and cannot be changed.
35+ GeoNetLogo template.HTML
36+ EsnzLogo template.HTML
37+ EsnzLogoStacked template.HTML
38+ NhcLogo template.HTML
39+ NhcLogoStacked template.HTML
4040 // URLs for extra logos to be added to the footer can be passed in.
4141 ExtraLogos []FooterLogo
4242 // Set whether footer is a stripped down, basic version.
@@ -49,6 +49,8 @@ type FooterLogo struct {
4949 URL string
5050 // The URL to the logo image.
5151 LogoURL string
52+ // The alt text to add to the logo image.
53+ Alt string
5254}
5355
5456// ReturnGeoNetFooter returns HTML for the main GeoNet footer that
@@ -58,7 +60,8 @@ func ReturnGeoNetFooter(config FooterConfig) (template.HTML, error) {
5860 var contents template.HTML
5961
6062 config .GeoNetLogo = geonetLogo
61- config .EsiLogo = path .Join (FOOTER_ASSET_DIR , "esi_logo_cropped_downsized.png" )
63+ config .EsnzLogo = esnzLogo
64+ config .EsnzLogoStacked = esnzLogoStacked
6265 config .NhcLogo = nhcLogo
6366 config .NhcLogoStacked = nhcLogoStacked
6467
@@ -72,13 +75,3 @@ func ReturnGeoNetFooter(config FooterConfig) (template.HTML, error) {
7275 }
7376 return template .HTML (b .String ()), nil // nolint: gosec // The source is our HTML file.
7477}
75-
76- // ReturnFooterAssetServer returns a handler for serving embedded PNGs for the footer.
77- func ReturnFooterAssetServer () http.Handler {
78- return http .FileServer (http .FS (FooterAssetServer ))
79- }
80-
81- // ReturnFooterAssetPattern returns the path pattern for the footer asset server.
82- func ReturnFooterAssetPattern () string {
83- return FOOTER_ASSET_DIR
84- }
0 commit comments