Skip to content

Commit

Permalink
Proof of concept of SVG icons next to external header links (#163)
Browse files Browse the repository at this point in the history
* Proof of concept of SVG icons next to external header links

* Use launch icon
  • Loading branch information
stefanv authored Mar 22, 2022
1 parent 475343a commit b147a37
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
File renamed without changes
4 changes: 4 additions & 0 deletions assets/theme-css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ svg.icon {
vertical-align: middle;
}

.navbar svg.icon {
width: 1.5rem;
}

/* Icon size slightly enlargened for footer */
#footer .social-media-icons {
font-size: 1.5em;
Expand Down
1 change: 1 addition & 0 deletions doc/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ params:
url: /getstarted/
- title: Features
url: /features/
is_external: true
- title: Shortcodes
url: /shortcodes/
keyfeatures:
Expand Down
6 changes: 5 additions & 1 deletion layouts/partials/navbar-clone.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</a>
{{- end}}


<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="cloned-navbar-menu">
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
Expand All @@ -28,12 +28,14 @@
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link">
{{ .title }}
{{ if .is_external }}{{ partial "svg-icon" "launch" }}{{ end }}
</a>

<div class="navbar-dropdown">
{{- range .sublinks }}
<a href="{{ .url }}" class="navbar-item">
{{ .title }}
{{ if .is_external }}{{ partial "svg-icon" "launch" }}{{ end }}
</a>
{{- end }}
</div>
Expand All @@ -42,11 +44,13 @@
<a href="{{ .url }}" class="navbar-item">
<span class="button signup-button rounded secondary-btn raised">
{{ .title }}
{{ if .is_external }}{{ partial "svg-icon" "launch" }}{{ end }}
</span>
</a>
{{- else }}
<a href="{{ .url }}" class="navbar-item is-secondary">
{{ .title }}
{{ if .is_external }}{{ partial "svg-icon" "launch" }}{{ end }}
</a>
{{- end }}
{{- end }}
Expand Down
4 changes: 4 additions & 0 deletions layouts/partials/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link">
{{ .title }}
{{ if .is_external }}{{ partial "svg-icon" "launch" }}{{ end }}
</a>

<div class="navbar-dropdown">
{{- range .sublinks }}
<a href="{{ .url }}" class="navbar-item">
{{ .title }}
{{ if .is_external }}{{ partial "svg-icon" "launch" }}{{ end }}
</a>
{{- end }}
</div>
Expand All @@ -42,11 +44,13 @@
<a href="{{ .url }}" class="navbar-item">
<span class="button signup-button rounded secondary-btn raised">
{{ .title }}
{{ if .is_external }}{{ partial "svg-icon" "launch" }}{{ end }}
</span>
</a>
{{- else }}
<a href="{{ .url }}" class="navbar-item is-secondary">
{{ .title }}
{{ if .is_external }}{{ partial "svg-icon" "launch" }}{{ end }}
</a>
{{- end }}
{{- end }}
Expand Down

0 comments on commit b147a37

Please sign in to comment.