eclipsefdn-hugo-solstice-theme 0.0.166 → 0.0.168
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/exampleSite/config/_default/menus.en.toml +12 -0
- package/exampleSite/content/components/twitter_button.md +54 -0
- package/exampleSite/content/components/twitter_timeline.md +27 -0
- package/layouts/partials/footer_js.html +43 -39
- package/layouts/shortcodes/twitter_button.html +44 -0
- package/layouts/shortcodes/twitter_timeline.html +20 -0
- package/layouts/shortcodes/video_list.html +0 -0
- package/package.json +2 -2
- package/webpack.mix.js +1 -1
|
@@ -183,6 +183,18 @@
|
|
|
183
183
|
weight = 3
|
|
184
184
|
parent = "solstice"
|
|
185
185
|
|
|
186
|
+
[[main]]
|
|
187
|
+
name = "Twitter Timeline"
|
|
188
|
+
url = "/components/twitter_timeline/"
|
|
189
|
+
weight = 3
|
|
190
|
+
parent = "solstice"
|
|
191
|
+
|
|
192
|
+
[[main]]
|
|
193
|
+
name = "Twitter Buttons"
|
|
194
|
+
url = "/components/twitter_button/"
|
|
195
|
+
weight = 3
|
|
196
|
+
parent = "solstice"
|
|
197
|
+
|
|
186
198
|
[[main]]
|
|
187
199
|
name = "RSS Feed"
|
|
188
200
|
url = "/components/rss/"
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Twitter Buttons"
|
|
3
|
+
date: 2019-04-17T15:52:27-04:00
|
|
4
|
+
description: ""
|
|
5
|
+
categories: []
|
|
6
|
+
keywords: []
|
|
7
|
+
slug: ""
|
|
8
|
+
aliases: []
|
|
9
|
+
toc: false
|
|
10
|
+
draft: false
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
A shortcode wrapper for the [Twitter button embeds](https://developer.twitter.com/en/docs/twitter-for-websites).
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Follow Button
|
|
18
|
+
A button to follow a Twitter profile. To display this type of button, set the `type` parameter to `"follow"`.
|
|
19
|
+
|
|
20
|
+
{{< twitter_button type="follow" >}}
|
|
21
|
+
|
|
22
|
+
### Set Handle*
|
|
23
|
+
The Twitter handle can be set from the site's config.toml file or by using the `handle` parameter.
|
|
24
|
+
|
|
25
|
+
{{< twitter_button type="follow" handle="EclipseCon" >}}
|
|
26
|
+
|
|
27
|
+
### Size Property*
|
|
28
|
+
The `size` parameter can be set to "default" or "large".
|
|
29
|
+
|
|
30
|
+
{{< twitter_button type="follow" size="large" >}}
|
|
31
|
+
|
|
32
|
+
### Show Follower Count
|
|
33
|
+
The follower count can be toggled using the `hide_followers` parameter.
|
|
34
|
+
|
|
35
|
+
{{< twitter_button type="follow" hide_followers="false" >}}
|
|
36
|
+
|
|
37
|
+
{{< grid/div class="sideitem margin-top-20" >}}
|
|
38
|
+
**\* Note:** These parameters also apply to the Mention Button and Hashtag Button types.
|
|
39
|
+
{{</ grid/div >}}
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Mention Button
|
|
44
|
+
A button to tweet to a profile. The profile is set using the `handle` parameter. This can be omitted if the Twitter handle is specified in config.toml.
|
|
45
|
+
|
|
46
|
+
{{< twitter_button type="mention" >}}
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Hashtag Button
|
|
51
|
+
A button to tweet with a hashtag. The hashtag can be set using the `hashtag` parameter.
|
|
52
|
+
|
|
53
|
+
{{< twitter_button type="hashtag" hashtag="eclipsecon" >}}
|
|
54
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Twitter Timeline"
|
|
3
|
+
date: 2019-04-17T15:52:27-04:00
|
|
4
|
+
description: ""
|
|
5
|
+
categories: []
|
|
6
|
+
keywords: []
|
|
7
|
+
slug: ""
|
|
8
|
+
aliases: []
|
|
9
|
+
toc: false
|
|
10
|
+
draft: false
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
A shortcode wrapper for the [Twitter timeline embeds](https://developer.twitter.com/en/docs/twitter-for-websites).
|
|
14
|
+
|
|
15
|
+
{{< twitter_timeline tweet_limit="2" >}}
|
|
16
|
+
|
|
17
|
+
### Dark Mode Enabled
|
|
18
|
+
Dark mode can be enabled by setting the `dark` parameter to `"true"`.
|
|
19
|
+
|
|
20
|
+
{{< twitter_timeline dark="true" tweet_limit="2" >}}
|
|
21
|
+
|
|
22
|
+
### Tweet Limits
|
|
23
|
+
The maximum number of tweets displayed can be controlled using the `tweet_limit` parameter.
|
|
24
|
+
|
|
25
|
+
In the following example, we set the `tweet_limit` to `"1"`.
|
|
26
|
+
|
|
27
|
+
{{< twitter_timeline tweet_limit="1" >}}
|
|
@@ -1,45 +1,49 @@
|
|
|
1
|
+
<div id="footer-js">
|
|
2
|
+
<!-- Placed at the end of the document so the pages load faster -->
|
|
3
|
+
{{- with .Site.Params.js | default "https://www.eclipse.org/eclipse.org-common/themes/solstice/public/javascript/main.min.js"}}
|
|
4
|
+
<script src="{{ . | relURL }}?v={{ now.Unix }}"></script>
|
|
5
|
+
{{ end }}
|
|
1
6
|
|
|
2
|
-
|
|
3
|
-
{{
|
|
4
|
-
|
|
5
|
-
{{ end }}
|
|
7
|
+
{{- with .Site.Params.hugo_js }}
|
|
8
|
+
<script src="{{ . | relURL }}"></script>
|
|
9
|
+
{{ end }}
|
|
6
10
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
{{
|
|
11
|
+
<!-- Read in mustache templates registered in page scratch -->
|
|
12
|
+
{{ range $key, $value := (.Page.Scratch.Get "mustache-templates") }}
|
|
13
|
+
<script id="{{ $key }}" type="text/html">
|
|
14
|
+
{{ readFile $value | safeHTML}}
|
|
15
|
+
</script>
|
|
16
|
+
{{ end }}
|
|
10
17
|
|
|
18
|
+
<!-- Initialize any newsroom components on the page -->
|
|
19
|
+
<script>
|
|
20
|
+
(function($, document) {
|
|
21
|
+
{{ range (.Page.Scratch.Get "events-container-ids") }}
|
|
22
|
+
$("#{{ . }}").eclipseFdnApi({
|
|
23
|
+
type: "filteredEvents"
|
|
24
|
+
});
|
|
25
|
+
{{ end }}
|
|
26
|
+
{{ range (.Page.Scratch.Get "news-container-ids") }}
|
|
27
|
+
$("#{{ . }}").eclipseFdnApi({
|
|
28
|
+
type: "newsItems"
|
|
29
|
+
});
|
|
30
|
+
{{ end }}
|
|
31
|
+
})(jQuery, document);
|
|
32
|
+
</script>
|
|
11
33
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
{
|
|
16
|
-
|
|
17
|
-
|
|
34
|
+
<script>
|
|
35
|
+
(function (eclipseFdnAdopters) {
|
|
36
|
+
if (typeof eclipsefdn_adopters_configs !== 'undefined') {
|
|
37
|
+
eclipseFdnAdopters.getWGList({
|
|
38
|
+
src_root: 'https://api.eclipse.org/adopters',
|
|
39
|
+
working_group: eclipsefdn_adopters_configs.working_group,
|
|
40
|
+
ul_classes: eclipsefdn_adopters_configs.ul_classes,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
})(eclipseFdnAdopters);
|
|
44
|
+
</script>
|
|
18
45
|
|
|
19
|
-
|
|
20
|
-
<script>
|
|
21
|
-
(function($, document) {
|
|
22
|
-
{{ range (.Page.Scratch.Get "events-container-ids") }}
|
|
23
|
-
$("#{{ . }}").eclipseFdnApi({
|
|
24
|
-
type: "filteredEvents"
|
|
25
|
-
});
|
|
26
|
-
{{ end }}
|
|
27
|
-
{{ range (.Page.Scratch.Get "news-container-ids") }}
|
|
28
|
-
$("#{{ . }}").eclipseFdnApi({
|
|
29
|
-
type: "newsItems"
|
|
30
|
-
});
|
|
46
|
+
{{ if eq (.Page.Scratch.Get "is_using_twitter") "true" }}
|
|
47
|
+
<script src="https://platform.twitter.com/widgets.js" async></script>
|
|
31
48
|
{{ end }}
|
|
32
|
-
|
|
33
|
-
</script>
|
|
34
|
-
|
|
35
|
-
<script>
|
|
36
|
-
(function (eclipseFdnAdopters) {
|
|
37
|
-
if (typeof eclipsefdn_adopters_configs !== 'undefined') {
|
|
38
|
-
eclipseFdnAdopters.getWGList({
|
|
39
|
-
src_root: 'https://api.eclipse.org/adopters',
|
|
40
|
-
working_group: eclipsefdn_adopters_configs.working_group,
|
|
41
|
-
ul_classes: eclipsefdn_adopters_configs.ul_classes,
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
})(eclipseFdnAdopters);
|
|
45
|
-
</script>
|
|
49
|
+
</div>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{{ $class := .Get "class" | default "" }}
|
|
2
|
+
{{ $type := .Get "type" }}
|
|
3
|
+
{{ $handle := .Get "handle" | default .Site.Author.twitter }}
|
|
4
|
+
{{ $hide_followers := .Get "hide_followers" | default "true" }}
|
|
5
|
+
{{ $hashtag := .Get "hashtag" }}
|
|
6
|
+
{{ $preload_text := .Get "preload_text" }}
|
|
7
|
+
{{ $size := .Get "size" | default "default" }}
|
|
8
|
+
|
|
9
|
+
{{ if not $type }}
|
|
10
|
+
{{ errorf "A type must be provided to display a Twitter button from twitter_button.html" }}
|
|
11
|
+
{{ end }}
|
|
12
|
+
|
|
13
|
+
{{ $type_map := dict "follow" "twitter-follow-button" "mention" "twitter-mention-button" "hashtag" "twitter-hashtag-button" }}
|
|
14
|
+
{{ $twitter_class := index $type_map $type | default false }}
|
|
15
|
+
|
|
16
|
+
{{ if not $twitter_class }}
|
|
17
|
+
{{ errorf "Invalid type shortcode parameter value provided to twitter_button.html" }}
|
|
18
|
+
{{ else if and (eq $type "follow") (not $handle) }}
|
|
19
|
+
{{ errorf "A handle must be provided to display a Twitter follow button from twitter_button.html" }}
|
|
20
|
+
{{ else if and (eq $type "hashtag") (not $hashtag) }}
|
|
21
|
+
{{ errorf "A hashtag must be provided to display a Twitter hashtag button from twitter_button.html"}}
|
|
22
|
+
{{ end }}
|
|
23
|
+
|
|
24
|
+
{{ $href := "https://twitter.com/" }}
|
|
25
|
+
{{ if eq $type "follow" }}
|
|
26
|
+
{{ $href = printf "%s%s" $href $handle }}
|
|
27
|
+
{{ else if eq $type "mention" }}
|
|
28
|
+
{{ $href = printf "%s%s%s" $href "/intent/tweet?screen_name=" $handle }}
|
|
29
|
+
{{ else if eq $type "hashtag" }}
|
|
30
|
+
{{ $href = printf "%s%s%s" $href "/intent/tweet?button_hashtag=" $hashtag }}
|
|
31
|
+
{{ end }}
|
|
32
|
+
|
|
33
|
+
<div class="eclipsefdn-twitter-button eclipsefdn-twitter-button-{{- $type -}} {{ $class }}">
|
|
34
|
+
<a class="eclipsefdn-twitter-button-preloaded eclipsefdn-twitter-button-{{- $type -}}-preloaded {{ $twitter_class }}"
|
|
35
|
+
href="{{ $href }}"
|
|
36
|
+
data-dnt="true"
|
|
37
|
+
data-size="{{ $size }}"
|
|
38
|
+
{{ if eq $hide_followers "true" }} data-show-count="false" {{ end }}
|
|
39
|
+
>
|
|
40
|
+
{{ $preload_text }}
|
|
41
|
+
</a>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
{{ .Page.Scratch.Set "is_using_twitter" "true" }}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{{ $class := .Get "class" }}
|
|
2
|
+
{{ $handle := .Get "handle" | default .Site.Author.twitter }}
|
|
3
|
+
{{ $dark := .Get "dark" | default "" }}
|
|
4
|
+
{{ $tweet_limit := .Get "tweet_limit" | default "20" }}
|
|
5
|
+
|
|
6
|
+
{{ if not $handle }}
|
|
7
|
+
{{ errorf "A handle must be provided to display a Twitter timeline from twitter_timeline.html" }}
|
|
8
|
+
{{ end }}
|
|
9
|
+
|
|
10
|
+
<div class="eclipsefdn-twitter-timeline {{ $class }}">
|
|
11
|
+
<a class="eclipsefdn-twitter-timeline-preloaded twitter-timeline"
|
|
12
|
+
href="https://twitter.com/{{ $handle }}"
|
|
13
|
+
{{- if $dark -}} data-theme="dark" {{ end }}
|
|
14
|
+
data-tweet-limit="{{ $tweet_limit }}"
|
|
15
|
+
data-dnt="true">
|
|
16
|
+
Follow @{{ $handle }}
|
|
17
|
+
</a>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
{{ .Page.Scratch.Set "is_using_twitter" "true" }}
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"main": "webpack.min.js",
|
|
5
5
|
"author": "Christopher Guindon",
|
|
6
6
|
"license": "EPL-2.0",
|
|
7
|
-
"version": "0.0.
|
|
7
|
+
"version": "0.0.168",
|
|
8
8
|
"bugs": {
|
|
9
9
|
"url": "https://gitlab.eclipse.org/eclipsefdn/it/webdev/hugo-solstice-theme/-/issues"
|
|
10
10
|
},
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"readmeFilename": "README.md",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"axios": "^0.21.1",
|
|
27
|
-
"eclipsefdn-solstice-assets": "^0.0.
|
|
27
|
+
"eclipsefdn-solstice-assets": "^0.0.207",
|
|
28
28
|
"json2yaml": "^1.1.0",
|
|
29
29
|
"toml": "^3.0.0"
|
|
30
30
|
},
|
package/webpack.mix.js
CHANGED
|
@@ -28,4 +28,4 @@ mix.js(
|
|
|
28
28
|
'./static/js/solstice.js'
|
|
29
29
|
);
|
|
30
30
|
|
|
31
|
-
mix.js(['./node_modules/eclipsefdn-solstice-assets/js/solstice/eclipsefdn.projects.js'], './static/js/eclipsefdn.projects.js');
|
|
31
|
+
mix.js(['./node_modules/eclipsefdn-solstice-assets/js/solstice/eclipsefdn.projects.js'], './static/js/eclipsefdn.projects.js');
|