-
Notifications
You must be signed in to change notification settings - Fork 134
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
New social buttons on navbar (#862) #863
Changes from all commits
3a5bc11
0a58a54
2f1c189
64ea706
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,11 +129,53 @@ | |
{{- with .Params.repo_button }} | ||
<div class="d-none d-lg-block pl-auto"> | ||
<a class="btn btn-light ignore-color-change" href="{{ .url }}" role="button" title="{{- i18n "navbar.github" | default "Github" -}}"> | ||
<i class="{{ printf "%s" .icon | default (printf "fab fa-github") }} mr-2"></i> | ||
{{ .text | default (i18n "github.star") }} | ||
<i class="{{ printf "%s" .icon | default (printf "fab fa-github") }} {{ if not .no_text }}mr-2 {{ end }}"></i> | ||
{{- if not .no_text -}} | ||
{{ .text | default (i18n "github.star") }} | ||
{{- end -}} | ||
</a> | ||
</div> | ||
{{- end }} | ||
{{- with .Params.twitter_button }} | ||
<div class="d-none d-lg-block pl-auto"> | ||
<a class="btn btn-light ignore-color-change" href="{{ .url }}" role="button" title="{{- i18n "navbar.twitter" | default "twitter" -}}"> | ||
<i class="{{ printf "%s" .icon | default (printf "fab fa-twitter") }} {{ if not .no_text }}mr-2 {{ end }}"></i> | ||
{{- if not .no_text -}} | ||
{{ .text | default (i18n "twitter.star") }} | ||
{{- end -}} | ||
</a> | ||
</div> | ||
{{- end }} | ||
{{- with .Params.facebook_button }} | ||
<div class="d-none d-lg-block pl-auto"> | ||
<a class="btn btn-light ignore-color-change" href="{{ .url }}" role="button" title="{{- i18n "navbar.facebook" | default "facebook" -}}"> | ||
<i class="{{ printf "%s" .icon | default (printf "fab fa-facebook") }} {{ if not .no_text }}mr-2 {{ end }}"></i> | ||
{{- if not .no_text -}} | ||
{{ .text | default (i18n "facebook.star") }} | ||
{{- end -}} | ||
</a> | ||
</div> | ||
{{- end }} | ||
{{- with .Params.linkedin_button }} | ||
<div class="d-none d-lg-block pl-auto"> | ||
<a class="btn btn-light ignore-color-change" href="{{ .url }}" role="button" title="{{- i18n "navbar.linkedin" | default "linkedin" -}}"> | ||
<i class="{{ printf "%s" .icon | default (printf "fab fa-linkedin") }} {{ if not .no_text }}mr-2 {{ end }}"></i> | ||
{{- if not .no_text -}} | ||
{{ .text | default (i18n "linkedin.star") }} | ||
{{- end -}} | ||
Comment on lines
+132
to
+165
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a bit manual and could be structured as a list. Any ideas on making it a list config wise as well as loop through the list in the code while keeping the backwards compatibility with the repo_button? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm really sorry for my lack of experience with Hugo templates. I'm quite new to Hugo templates. I actually started to mess with it yesterday using Syna as a way to better understand Hugo. As you said, this patch is really to cumbersome to be useful so I'm planning to change it a little bit. In fact, today I notice that there is a better way to extend the template to make those icons more generic and, at same time keeping the backward compatibility with the existing repo_button. My new plan is to left repo_button as is and add a new list of button that will add the new buttons in the same way repo_button works. This way we will be able to combine both repo_button and the new button options to keep backward compatibility or delegate the buttons to use only the new button instead. I'll also try to make shortcuts for the most common icons to make the usage easier. I also notice that there are more places in the sample site that I must update in order to document the new features and I'm planning to update those locations as well. Could you reject this pull request for now? As soon as I have a better solution I will send a new one. We are really glad to be able to contribute to Syna's main repository. Thanks in advance! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure no worries. Will close this one and wait for the next. Happy to help if anything comes up. |
||
</a> | ||
</div> | ||
{{- end }} | ||
{{- with .Params.custom_button }} | ||
<div class="d-none d-lg-block pl-auto"> | ||
<a class="btn btn-light ignore-color-change" href="{{ .url }}" role="button" title="{{- i18n "navbar.custom" | default "custom" -}}"> | ||
<i class="{{ printf "%s" .icon | default (printf "fas fa-star") }} {{ if not .no_text }}mr-2 {{ end }}"></i> | ||
{{- if not .no_text -}} | ||
{{ .text | default (i18n "custom.star") }} | ||
{{- end -}} | ||
</a> | ||
</div> | ||
{{- end }} | ||
</nav> | ||
{{/* | ||
* Get the config of breadcrumbs and set defaults | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah button text should probably not be using the key "star" as this only makes sense for Github starring. Maybe a more neutral
id: facebook.button_text
could work as well as the translation being beingFacebook
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for the other languages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I'll incorporate those changes as well.