Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ttui-header and ttui-footer #1265

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions doc/config/_default/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,18 @@ pygmentsUseClasses = true
name = "Get The Things Stack"
url = "https://www.thethingsindustries.com/stack/plans/"
weight = 1

[[menu.social_media]]
name = "X"
url = "https://twitter.com/thethingsindust"
weight = 1

[[menu.social_media]]
name = "LinkedIn"
url = "https://www.linkedin.com/company/10346190"
weight = 2

[[menu.social_media]]
name = "YouTube"
url = "https://www.youtube.com/channel/UCv85CXnZUXEKnlZpQapTAwQ"
weight = 3
2 changes: 1 addition & 1 deletion doc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"description": "Hugo Theme for The Things Stack",
"dependencies": {
"@ttui/design": "https://ttui.thethingsindustries.com/release/ttui-1.7.4.tar.gz"
"@tti/design": "https://ttui.thethingsindustries.com/release/ttui-1.10.0.tar.gz"
},
"devDependencies": {}
}
4 changes: 4 additions & 0 deletions doc/themes/the-things-stack/assets/css/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@
}

@import "vendor/bulma-tooltip.min";

.DocSearch-Modal {
transform: translate(0, 56px)
}
7 changes: 4 additions & 3 deletions doc/themes/the-things-stack/assets/js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import "@ttui/design/ui/ttui-vendor.js";
import "@ttui/design/ui/main.js";
import "@ttui/design/ui/components/heading-expanded/index.js";
import "@tti/design/ui/ttui-vendor.js";
import "@tti/design/ui/main.js";
import "@tti/design/ui/components/ttui-header";
import "@tti/design/ui/components/ttui-footer";

function addNavBarBurgers(){
var $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0)
Expand Down
2 changes: 1 addition & 1 deletion doc/themes/the-things-stack/layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE html>

<html class="has-navbar-fixed-top">
<html>

{{ partial "head/head.html" . }}

Expand Down
77 changes: 45 additions & 32 deletions doc/themes/the-things-stack/layouts/partials/footer/footer.html
Original file line number Diff line number Diff line change
@@ -1,38 +1,51 @@
<footer class="footer">
<div class="container">
<div class="columns">
<nav class="column is-one-third">
<h3 class="title is-6">The Things Stack</h3>
{{- $currentPage := . -}}
{{- range .Site.Menus.main }}
<p><a class="{{ if $currentPage.IsMenuCurrent "main" . }} is-active{{ end }}" href="{{ .URL }}">{{ .Name }}</a></p>
{{- end }}
</nav>
{{- if .Site.Menus.contributing }}
<nav class="column is-one-third">
<h3 class="title is-6">Contributing</h3>
{{- $currentPage := . -}}
{{- range .Site.Menus.contributing }}
<p><a class="{{ if $currentPage.IsMenuCurrent "contributing" . }} is-active{{ end }}" href="{{ .URL }}">{{ .Name }}</a></p>
{{- end }}
</nav>
{{ end -}}
{{- if .Site.Menus.about_us }}
<nav class="column is-one-third">
<h3 class="title is-6">About Us</h3>
{{- $currentPage := . -}}
{{- range .Site.Menus.about_us }}
<p><a class="{{ if $currentPage.IsMenuCurrent "about_us" . }} is-active{{ end }}" href="{{ .URL }}">{{ .Name }}</a></p>
{{- end }}
</nav>
{{ end -}}
</div>
</div>
</footer>
<section class="ttui-container bg-background-07 pb-ls-s pt-ls-s">
<ttui-footer
privacy-policy-url="https://www.thethingsindustries.com/document/privacypolicy/"
terms-url="https://www.thethingsindustries.com/document/eula/"
>
<ttui-footer-nav slot="menu" title="The Things Stack">
{{- range .Site.Menus.main }}
<ttui-footer-nav-item>
<a href="{{ .URL }}">{{ .Name }}</a>
</ttui-footer-nav-item>
{{- end }}
</ttui-footer-nav>
{{- if .Site.Menus.contributing }}
<ttui-footer-nav slot="menu" title="Contributing">
{{- range .Site.Menus.contributing }}
<ttui-footer-nav-item>
<a href="{{ .URL }}">{{ .Name }}</a>
</ttui-footer-nav-item>
{{- end }}
</ttui-footer-nav>
{{ end -}}
{{- if .Site.Menus.about_us }}
<ttui-footer-nav slot="menu" title="About Us">
{{- range .Site.Menus.about_us }}
<ttui-footer-nav-item>
<a href="{{ .URL }}">{{ .Name }}</a>
</ttui-footer-nav-item>
{{- end }}
</ttui-footer-nav>
{{ end -}}

{{- if .Site.Menus.social_media }}
<ttui-footer-social slot="social">
{{- range .Site.Menus.social_media }}
<ttui-footer-social-icon
platform="{{ .Name | lower }}"
url="{{ .URL }}"
align-left
></ttui-footer-social-icon>
{{- end }}
</ttui-footer-social>
</ttui-footer>
{{ end -}}
</section>

{{- $script := resources.Get "js/vendor/basicLightbox.min.js" }}
<script src="{{ $script.Permalink }}"></script>
{{- $script := resources.Get "js/theme.js" | js.Build | resources.Minify | resources.Fingerprint }}
{{- $script := resources.Get "js/theme.js" | js.Build }}
<script src="{{ $script.Permalink }}" integrity="{{ $script.Data.Integrity }}" crossorigin="anonymous"></script>

{{- partial "intercom.html" . -}}
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
<meta name="twitter:card" content="summary" />
{{ partial "gtm_head.html" . }}

<link rel="stylesheet" href="https://ttui.thethingsindustries.com/release/1.7.2/main.css" />
<link rel="stylesheet" href="https://ttui.thethingsindustries.com/release/1.9.4/main.css" />
</head>
81 changes: 28 additions & 53 deletions doc/themes/the-things-stack/layouts/partials/header/nav.html
Original file line number Diff line number Diff line change
@@ -1,60 +1,35 @@
<nav class="navbar is-fixed-top" role="navigation" aria-label="main navigation">
<div class="container is-fluid">
<div class="navbar-brand">
<a class="navbar-item" href="{{ relURL "" }}">
<img class="logo" src="{{ "img/TTS-logo.svg" | relURL }}">
</a>
{{- if .Site.Params.search.enabled -}}
<div class="navbar-item navbar-search-menu" id="search-input-menu">
</div>
{{- end -}}
{{- $currentPage := . -}}
{{- range .Site.Menus.brand }}
<a class="navbar-item{{ if $currentPage.IsMenuCurrent "brand" . }} is-active{{ end }}" href="{{ .URL }}">{{ .Pre }}{{ .Name }}</a>
<div class="theme-tts">
<ttui-header>
<nav slot="nav">
{{- range .Site.Menus.main }}
<a href="{{ .URL }}">{{ .Pre }}{{ .Name }}</a>
{{- end }}
<span class="navbar-burger burger" data-target="topMenu">
<span></span>
<span></span>
<span></span>
</span>
</div>
<div id="topMenu" class="navbar-menu">
<div class="navbar-start">
{{- $currentPage := . -}}
{{- range .Site.Menus.main }}
<a class="navbar-item{{ if $currentPage.IsMenuCurrent "main" . }} is-active{{ end }}" href="{{ .URL }}">{{ .Pre }}{{ .Name }}</a>
{{- end }}

</div>
<div class="navbar-end">
{{- if .Site.Menus.right }}
{{- range .Site.Menus.right }}
<a class="navbar-item{{ if $currentPage.IsMenuCurrent "right" . }} is-active{{ end }}" href="{{ .URL }}">{{ .Pre }}{{ .Name }}</a>
{{- end }}
{{- end }}
{{- if .Site.Menus.buttons }}
{{- if not .Params.hidebuttons -}}
<div class="navbar-item">
{{- range .Site.Menus.buttons }}
<a class="button is-primary{{ if $currentPage.IsMenuCurrent "buttons" . }} is-active{{ end }}" href="{{ .URL }}">{{ .Pre }}{{ .Name }}</a>
{{- end }}
</div>
{{- end -}}
</nav>
<div slot="right">
{{- if .Site.Params.search.enabled -}}
<div class="navbar-item navbar-search-menu" id="search-input-menu"></div>
{{- end -}} {{- if .Site.Menus.buttons }} {{- if not .Params.hidebuttons
-}}
<div class="navbar-item">
{{- range .Site.Menus.buttons }}
<button class="ttui-btn ttui-btn--primary md:d-none" onclick="window.open('{{ .URL }}', '_blank')"
>{{ .Pre }}{{ .Name }}</button>
{{- end }}
</div>
{{- end -}} {{- end }}
</div>
</div>
</nav>
</ttui-header>
</div>

{{- if .Site.Params.search.enabled -}}
<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@3"></script>
<script type="text/javascript">
docsearch({
appId: {{ .Site.Params.search.appid }},
apiKey: {{ .Site.Params.search.apikey }},
indexName: {{ .Site.Params.search.index }},
container: '#search-input-menu',
debug: false, // Set debug to true if you want to inspect the dropdown.
});
</script>
<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@3"></script>
<script type="text/javascript">
docsearch({
appId: {{ .Site.Params.search.appid }},
apiKey: {{ .Site.Params.search.apikey }},
indexName: {{ .Site.Params.search.index }},
container: '#search-input-menu',
debug: false, // Set debug to true if you want to inspect the dropdown.
});
</script>
{{- end -}}
4 changes: 2 additions & 2 deletions doc/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# yarn lockfile v1


"@ttui/design@https://ttui.thethingsindustries.com/release/ttui-1.7.4.tar.gz":
"@tti/design@https://ttui.thethingsindustries.com/release/ttui-1.10.0.tar.gz":
version "0.0.0"
resolved "https://ttui.thethingsindustries.com/release/ttui-1.7.4.tar.gz#03bddf2d0cc548d977ba7b4a2fb7c6876bd3b939"
resolved "https://ttui.thethingsindustries.com/release/ttui-1.10.0.tar.gz#11a69b26b4c21181c37b1784452f27c12c4111d5"
Loading