jekyll-bluesky 0.19.0 → 0.21.0
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.
- checksums.yaml +4 -4
- data/lib/jekyll-bluesky/version.rb +1 -1
- data/lib/jekyll-bluesky.rb +64 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f87a26c51b1e9a33e070fd362b2aa4295b10a58f6b68008273d8dd307d171eb
|
4
|
+
data.tar.gz: fef8b54d1214625c01ad749533510d7749ba43f06cbd6d04f0b95689d594c576
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2aa58193ff5a0b119df71d48d2599724a1850a7f6adb4cc6993db2006352597cee8a1ad7cb3ada2c8e3d1b8b1279692753785184bc987f934fb201c064cdf561
|
7
|
+
data.tar.gz: f6531b202ab8312566a3562135c68a7b27bcc2f519f798b5d13c257c54c1366bec9a32d4f5a965ff141935dac3d133d91ed7797dae7f6ea48b16f1b9077a1a33
|
data/lib/jekyll-bluesky.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
require 'http'
|
4
4
|
require 'json'
|
5
5
|
require 'digest'
|
6
|
-
require 'fileutils'
|
6
|
+
require 'fileutils'
|
7
7
|
|
8
8
|
puts 'Plugin jekyll-bluesky load successfully!'
|
9
9
|
|
@@ -64,7 +64,66 @@
|
|
64
64
|
|
65
65
|
def self.format_post(data)
|
66
66
|
posts = data['feed']
|
67
|
-
|
67
|
+
styles = <<~HTML
|
68
|
+
<style>
|
69
|
+
@font-face {
|
70
|
+
font-family: 'InterVariable';
|
71
|
+
src: url("https://web-cdn.bsky.app/static/media/InterVariable.c504db5c06caaf7cdfba.woff2") format('woff2');
|
72
|
+
font-weight: 300 1000;
|
73
|
+
font-style: normal;
|
74
|
+
font-display: swap;
|
75
|
+
}
|
76
|
+
.bluesky-post {
|
77
|
+
border-bottom: 1px solid #e1e8ed;
|
78
|
+
padding: 12px;
|
79
|
+
width: 500px;
|
80
|
+
font-family: 'InterVariable', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Liberation Sans', Helvetica, Arial, sans-serif;
|
81
|
+
background: #fff;
|
82
|
+
margin-bottom: 10px;
|
83
|
+
}
|
84
|
+
.bluesky-header {
|
85
|
+
display: flex;
|
86
|
+
align-items: center;
|
87
|
+
justify-content: flex-start; /* Alinha tudo à esquerda */
|
88
|
+
gap: 8px; /* Espaço entre a foto e o nome */
|
89
|
+
}
|
90
|
+
.bluesky-avatar {
|
91
|
+
width: 40px;
|
92
|
+
height: 40px;
|
93
|
+
border-radius: 50%;
|
94
|
+
}
|
95
|
+
.bluesky-author-info {
|
96
|
+
display: flex;
|
97
|
+
flex-direction: column;
|
98
|
+
}
|
99
|
+
.author-name {
|
100
|
+
font-weight: bold;
|
101
|
+
font-size: 14px;
|
102
|
+
color: #000;
|
103
|
+
}
|
104
|
+
.author-handle {
|
105
|
+
font-size: 12px;
|
106
|
+
color: #657786;
|
107
|
+
}
|
108
|
+
.bluesky-content {
|
109
|
+
font-size: 14px;
|
110
|
+
line-height: 1.5;
|
111
|
+
color: #14171A;
|
112
|
+
}
|
113
|
+
.bluesky-footer {
|
114
|
+
display: flex;
|
115
|
+
justify-content: space-between;
|
116
|
+
font-size: 12px;
|
117
|
+
color: #657786;
|
118
|
+
margin-top: 10px;
|
119
|
+
}
|
120
|
+
.icon {
|
121
|
+
cursor: pointer;
|
122
|
+
}
|
123
|
+
</style>
|
124
|
+
HTML
|
125
|
+
|
126
|
+
formatted_posts = posts.map do |post|
|
68
127
|
post_data = post['post']
|
69
128
|
author = post_data['author']
|
70
129
|
record = post_data['record']
|
@@ -73,7 +132,7 @@
|
|
73
132
|
text = record['text'].gsub("\n", "<br>")
|
74
133
|
author_name = author['displayName']
|
75
134
|
author_handle = author['handle']
|
76
|
-
post_time = "3h"
|
135
|
+
post_time = "3h"
|
77
136
|
|
78
137
|
image_html = ''
|
79
138
|
if embed && embed['$type'] == 'app.bsky.embed.images#view'
|
@@ -106,10 +165,10 @@
|
|
106
165
|
</div>
|
107
166
|
HTML
|
108
167
|
end.join("\n")
|
168
|
+
|
169
|
+
styles + formatted_posts
|
109
170
|
end
|
110
171
|
|
111
|
-
end
|
112
|
-
|
113
172
|
class FileCache
|
114
173
|
def initialize(path)
|
115
174
|
@cache_folder = File.expand_path path
|