Unverified Commit 577a7d29 authored by Yi (Flora) Liu's avatar Yi (Flora) Liu Committed by GitHub
Browse files

initial trial to custom header for sub-sites (#196)



* initial trial to custom header for sub-sites
Signed-off-by: Yi Liu's avatarYi Liu <yi.liu@eclipse-foundation.org>

* add static images
Signed-off-by: Yi Liu's avatarYi Liu <yi.liu@eclipse-foundation.org>

* add custom header logo in nav-toggle
Signed-off-by: Yi Liu's avatarYi Liu <yi.liu@eclipse-foundation.org>

* remove unnecessary in gitignore
Signed-off-by: Yi Liu's avatarYi Liu <yi.liu@eclipse-foundation.org>

* Simplify the code, less vars and less duplications
Signed-off-by: Yi Liu's avatarYi Liu <yi.liu@eclipse-foundation.org>

* remove unnecessary absURL
Signed-off-by: Yi Liu's avatarYi Liu <yi.liu@eclipse-foundation.org>

* move fake logo from static to inside exampleSite
Signed-off-by: Yi Liu's avatarYi Liu <yi.liu@eclipse-foundation.org>
Co-authored-by: Yi Liu's avatarYi Liu <yi.liu@eclipse-foundation.org>
Co-authored-by: Martin Lowe's avatarMartin Lowe <martin.lowe@eclipse-foundation.org>
parent b9ac59f9
/node_modules/
/static/*
!/static/js/
/static/images/vendor/
!/static/images/fake_logo/
/static/js/solstice.js
/exampleSite/public
/exampleSite/layouts/robots.txt
......
......@@ -53,6 +53,12 @@
weight = 7
parent = "examples"
[[main]]
name = "Subsite Custom Logo"
url = "/subsite-1/"
weight = 8
parent = "examples"
[[main]]
name = "Custom Jumbotron"
url = "/custom-jumbotron/"
......
---
title: "SubSite"
headline: "SubSite"
date: 2018-04-05T16:09:45-04:00
description: "SubSite"
hide_sidebar: false
---
SubSite
\ No newline at end of file
---
title: "SubSite-Child 1"
date: 2018-04-05T16:09:45-04:00
description: "SubSite-Child 1"
hide_sidebar: false
---
SubSite-Child 1
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 738.8 253.15"><defs><style>.cls-1{fill:#fff;}</style></defs><title>jakartaone_livestream_wht_full</title><g id="Layer_2" data-name="Layer 2"><path class="cls-1" d="M518.74,12.72a67.86,67.86,0,0,0-56,106.21l5.73,2.27a17.47,17.47,0,0,0,12.88,0,22.3,22.3,0,0,1,16.5,0,17.47,17.47,0,0,0,12.88,0,22.3,22.3,0,0,1,16.5,0,17.47,17.47,0,0,0,12.88,0,22.3,22.3,0,0,1,16.5,0,17.47,17.47,0,0,0,12.88,0l5-2a67.85,67.85,0,0,0-55.8-106.48Zm12.77,30a2.42,2.42,0,0,0,0,.24c0,.1,0,.22.06.37s0,.12,0,.2c.78,5,4,32.05-14.26,55.7l-30.53-7.62Zm-6.09,61.5c-11.53,0-21.84,3.48-28.67,8.93-12.93-19.33-23.63-22.87-23.63-22.87l57.5,14.18C528.92,104.34,527.18,104.26,525.42,104.26Zm9.65-.69-15.23-3.8a72.45,72.45,0,0,0,10.42-19.62,79.16,79.16,0,0,0,4-18.73,81.24,81.24,0,0,0,.35-8.33l18-19.67S564.44,75.92,535.07,103.57Z"/><path class="cls-1" d="M30,112.09l9.13-6.61a11.35,11.35,0,0,0,10,5.07,15,15,0,0,0,8.59-3q4.34-3,4.33-10.64V46.5H73.29V98q0,11.24-7.44,17.51a24.91,24.91,0,0,1-16.46,6.29A23.3,23.3,0,0,1,38,119.14,23.77,23.77,0,0,1,30,112.09Z"/><path class="cls-1" d="M80.89,121.17,108.17,46.4h9.34l27.28,74.77h-11.9l-5.74-16.87H98.79l-6,16.87ZM102.12,94.3h21.64q-2.36-6.93-3.72-10.85c-.9-2.62-1.69-4.93-2.36-7s-1.34-4.07-2-6.15-1.59-4.91-2.72-8.47c-1.2,3.7-2.15,6.65-2.87,8.85L108,77.12c-.67,2-1.43,4.34-2.31,6.87S103.62,90,102.12,94.3Z"/><path class="cls-1" d="M152.7,121.22V46.5H164V85h.26L195,46.5H208.5L184.55,76,211,121.22H197.57L177.16,84.71,164,98.45v22.77Z"/><path class="cls-1" d="M211.17,121.17,238.45,46.4h9.34l27.28,74.77h-11.9l-5.74-16.87H229.07l-5.95,16.87ZM232.4,94.3h21.65q-2.37-6.93-3.72-10.85c-.91-2.62-1.69-4.93-2.36-7s-1.34-4.07-2-6.15-1.59-4.91-2.71-8.47q-1.8,5.55-2.88,8.85c-.71,2.21-1.41,4.33-2.07,6.39S236.84,81.46,236,84,233.91,90,232.4,94.3Z"/><path class="cls-1" d="M283.13,121.22V46.5h29.23q9.58,0,15.18,4.92a23.59,23.59,0,0,1,5.31,6.82A19.21,19.21,0,0,1,335,67.37a21.87,21.87,0,0,1-3.87,12.8A20.72,20.72,0,0,1,320.52,88l17.33,33.18H324.41L309,89.32H294.46v31.9Zm11.33-64.67V79.22h17.13q6.36,0,9.54-3.54a12,12,0,0,0,3.18-8.31q0-5.69-3.79-8.51a13.73,13.73,0,0,0-8.26-2.31Z"/><path class="cls-1" d="M358.12,121.22V56.55H337.65v-10h52.26v10H369.45v64.67Z"/><path class="cls-1" d="M382.43,121.17,409.71,46.4H419l27.29,74.77h-11.9l-5.74-16.87H400.33l-5.95,16.87ZM403.66,94.3H425.3q-2.35-6.93-3.72-10.85c-.9-2.62-1.69-4.93-2.36-7s-1.34-4.07-2-6.15-1.59-4.91-2.72-8.47q-1.8,5.55-2.87,8.85l-2.08,6.39c-.67,2-1.43,4.34-2.31,6.87S405.16,90,403.66,94.3Z"/><path class="cls-1" d="M594.32,121.22V46.5H605l33.8,53.13h.2V46.5h11.39v74.72H639.71l-33.8-53.13h-.25v53.13Z"/><path class="cls-1" d="M661.06,121.22V46.5h47.79V57.22H672.39V78.5h31.08V88.6H672.39v22h36.46v10.67Z"/><path class="cls-1" d="M460.32,185.05a6.86,6.86,0,0,0,2.58-2.94,11.16,11.16,0,0,0,0-8.78,6.92,6.92,0,0,0-2.56-3,7.08,7.08,0,0,0-3.84-1H442.39v16.75H456.5A7,7,0,0,0,460.32,185.05Z"/><path class="cls-1" d="M30,143v97.43h678.9V143ZM98,209.06a17.35,17.35,0,1,1,17.34-17.35A17.35,17.35,0,0,1,98,209.06Zm99.7,7h-34.6V162.19h7.56v46.69h27Zm22.15,0h-7.56V162.19h7.56Zm38.22,0h-7.19l-17.56-53.88h8.22l12.94,42.24,12.93-42.24h8.22Zm65.64-46.69H296.7v16.34h23v7.19h-23v16h27.05v7.19h-34.6V162.19h34.6ZM376.17,201a14.8,14.8,0,0,1-2.34,8.43,14.47,14.47,0,0,1-6.76,5.34,27.94,27.94,0,0,1-10.69,1.83h-3.89l-3.48-.74A27.22,27.22,0,0,1,336.85,210l4.71-5.78a21.08,21.08,0,0,0,6.78,4,23.55,23.55,0,0,0,8,1.34q5.85,0,9.08-2.17a7,7,0,0,0,3.22-6.13v0a6.51,6.51,0,0,0-1.46-4.46,8.78,8.78,0,0,0-3.78-2.45,41.58,41.58,0,0,0-6-1.46.69.69,0,0,0-.25,0,.67.67,0,0,1-.24,0l-.55-.11a56.58,56.58,0,0,1-8.8-2.09,12.45,12.45,0,0,1-5.8-4.26c-1.61-2.06-2.41-5-2.41-8.8v0a15.68,15.68,0,0,1,2.24-8.54,14.16,14.16,0,0,1,6.54-5.39,26.15,26.15,0,0,1,10.34-1.85,25.84,25.84,0,0,1,5.69.63,28.3,28.3,0,0,1,5.52,1.87,31.57,31.57,0,0,1,5.35,3.13l-4.29,6a25.77,25.77,0,0,0-6.14-3.39,17.65,17.65,0,0,0-6.13-1.13q-5.52,0-8.58,2.21a7.25,7.25,0,0,0-3.05,6.24v0a5.94,5.94,0,0,0,1.57,4.37A9.48,9.48,0,0,0,352.4,184a59.9,59.9,0,0,0,6.54,1.58l.28.05.27.06.41.07.41.07a44.54,44.54,0,0,1,8.17,2.38A12.68,12.68,0,0,1,374,192.6c1.47,2,2.21,4.82,2.21,8.35Zm47-31.64H408v46.69h-7.56V169.38H385.19v-7.19h38Zm41.93,46.69-11.5-22.79H442.39v22.79h-7.56V162.16h21.38a17,17,0,0,1,8.21,1.92,13.61,13.61,0,0,1,5.48,5.47,18.09,18.09,0,0,1,0,16.34,13.66,13.66,0,0,1-5.5,5.47,14.94,14.94,0,0,1-2.71,1.1l12.43,23.61Zm59.45-46.69H497.54v16.34h23v7.19h-23v16h27.05v7.19H490V162.19h34.6Zm49.27,46.69-4.06-11.82H548.05L544,216.07h-8.15l19.86-53.88h6.45L582,216.07Zm67.79,0h-7.37V178.94l-12.9,29.64h-5.26l-12.89-28.92v36.41h-7.38V162.19h7.08l15.82,35.57,15.82-35.57h7.08Z"/><polygon class="cls-1" points="550.52 197.06 567.33 197.06 558.93 172.6 550.52 197.06"/></g></svg>
\ No newline at end of file
items:
-
page_url: '/subsite-1'
logo: '/third-parent/images/fake_logo/jakarta_ee_logo_schooner_color_horizontal_default.png'
logo_url: '/subsite-1'
logo_title: 'subsite-1'
-
page_url: '/third-parent'
logo: '/third-parent/images/fake_logo/jakartaone_livestream_test_white_logo.svg'
logo_url: '/third-parent'
logo_title: 'Third Parent'
\ No newline at end of file
......@@ -22,8 +22,21 @@
{{ end }}
<div class="wrapper-logo-mobile">
{{- with .Page.Params.logo | default .Site.Params.logo | default "https://www.eclipse.org/eclipse.org-common/themes/solstice/public/images/logo/eclipse-foundation-white-orange.svg" }}
<a class="navbar-brand visible-xs" title="{{ $.Site.Title }}" href="{{ "" | absLangURL }}">
<img width="{{ $.Page.Params.logo_width | default $.Site.Params.logo_width | default "140"}}" class="logo-eclipse-default-mobile img-responsive" src="{{ . | absURL }}" alt="{{ $.Site.Title }}" />
{{ $currentPageLogo := . }}
{{ $currentPageLogoTitle := $.Site.Title }}
{{ $currentPageLogoLink := "" }}
{{ range $.Site.Data.subsites_custom_logo.items }}
{{ $section := $.Site.GetPage (.page_url) }}
{{ if or (eq ($.Section) ($section)) ( $.Page.IsDescendant $section ) }}
{{ $currentPageLogo = .logo }}
{{ $currentPageLogoTitle = .logo_title }}
{{ $currentPageLogoLink = .logo_url }}
{{ end }}
{{ end }}
<a class="navbar-brand visible-xs" title="{{ $currentPageLogoTitle }}" href="{{ $currentPageLogoLink | absLangURL }}">
<img width="{{ $.Page.Params.logo_width | default $.Site.Params.logo_width | default "140"}}" class="logo-eclipse-default-mobile img-responsive" src="{{ $currentPageLogo | absURL }}" alt="{{ $currentPageLogoTitle }}" />
</a>
{{ end }}
</div>
......
......@@ -42,11 +42,27 @@
<div class="row" id="header-row">
<div class="{{ $.Site.Params.header_left_classes | default "col-sm-5 col-md-4" }}" id="header-left">
<div class="wrapper-logo-default">
{{- with .Page.Params.logo | default .Site.Params.logo | default "https://www.eclipse.org/eclipse.org-common/themes/solstice/public/images/logo/eclipse-foundation-white-orange.svg" }}
<a title="{{ $.Site.Title }}" href="{{ "" | absLangURL }}">
<img width="{{ $.Page.Params.logo_width | default $.Site.Params.logo_width | default "140"}}" class="logo-eclipse-default img-responsive hidden-xs" src="{{ . | absURL }}" alt="{{ $.Site.Title }}" />
{{ with .Page.Params.logo | default .Site.Params.logo | default "https://www.eclipse.org/eclipse.org-common/themes/solstice/public/images/logo/eclipse-foundation-white-orange.svg" }}
{{ $currentPageLogo := . }}
{{ $currentPageLogoTitle := $.Site.Title }}
{{ $currentPageLogoLink := "" }}
{{ range $.Site.Data.subsites_custom_logo.items }}
{{ $section := $.Site.GetPage (.page_url) }}
{{ if or (eq ($.Section) ($section)) ( $.Page.IsDescendant $section ) }}
{{ $currentPageLogo = .logo }}
{{ $currentPageLogoTitle = .logo_title }}
{{ $currentPageLogoLink = .logo_url }}
{{ end }}
{{ end }}
<a title="{{ $currentPageLogoTitle }}" href="{{ $currentPageLogoLink | absLangURL }}">
<img width="{{ $.Page.Params.logo_width | default $.Site.Params.logo_width | default "140"}}" class="logo-eclipse-default img-responsive hidden-xs" src="{{ $currentPageLogo | absURL }}" alt="{{ $currentPageLogoTitle }}" />
</a>
{{ end }}
{{ end }}
</div>
</div>
{{ $has_cfa := 0 }}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment