Skip to content

Commit

Permalink
Add github star button (#307)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkbnz authored Jun 26, 2023
1 parent 9a27761 commit 0ea84d8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
11 changes: 3 additions & 8 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ menushortcutsnewtab = false # set true to open shortcuts links to a new tab/wind
editURL = "https://github.com/Minimum-CD/cd-manifesto/blob/master/content/"
enableGitInfo = true
logo = '/images/minimumCD-logo-hex.png'

custom_js = ["https://buttons.github.io/buttons.js"]
github_repo = "Minimum-CD/cd-manifesto"

[mediaTypes]
[mediaTypes."application/netlifyconfig"]
Expand Down Expand Up @@ -59,11 +60,5 @@ noClasses = true
style = "monokai"
tabWidth = 2

[[menu.shortcuts]]
name = "Github"
identifier = "ds"
url = "https://github.com/Minimum-CD/cd-manifesto"
weight = 10

[create-footer-md]
other = "Licensed MIT"
other = "Licensed MIT"
19 changes: 10 additions & 9 deletions layouts/partials/body-header.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@
{{- partial "_mdinclude.html" (dict "name" "header" "context" . "tip" $defaultheader ) -}}
</div>

{{- with .Site.Menus.shortcuts}}
<nav class="shortcuts">
{{- range sort . "Weight"}}
<li class="" role="">
<a href="{{.URL}}" {{if eq $.Site.Params.menushortcutsnewtab true}}target="_blank"{{end}} rel="noopener">
{{safeHTML .Name}}
</a>
</li>
{{- end}}
{{- with .Site.Params.github_repo }}
<nav>
<a
class="github-button"
href="https://github.com/{{.}}"
data-color-scheme="no-preference: light; light: light; dark: dark;"
data-size="large"
data-show-count="true"
aria-label="Star {{.}} on GitHub"
>Star</a>
</nav>
{{- end}}

Expand Down
4 changes: 4 additions & 0 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

{{ range .Site.Params.custom_js -}}
<script async defer src="{{ . | absURL }}"></script>
{{- end }}

0 comments on commit 0ea84d8

Please sign in to comment.