Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LQDN Adminsys
generateur-slogans
Commits
f12cfe3a
Verified
Commit
f12cfe3a
authored
Oct 09, 2017
by
Thibaut Broggi
Browse files
Get correct opengraph image
Fix URLs writing
parent
9f01135e
Pipeline
#1357
passed with stage
in 53 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
srv.js
View file @
f12cfe3a
...
...
@@ -107,7 +107,7 @@ app.get('/generate.png', function (req, res) {
});
app
.
get
(
'
/
'
,
function
(
req
,
res
)
{
res
.
render
(
'
index
'
,
{
host
:
req
.
headers
.
host
});
res
.
render
(
'
index
'
,
{
host
:
req
.
headers
.
host
,
imageParams
:
req
.
_parsedUrl
.
query
});
})
app
.
listen
(
process
.
env
.
PORT
||
config
.
port
||
80
);
static/canvas.js
View file @
f12cfe3a
...
...
@@ -94,11 +94,12 @@ let draw = function() {
// Edit URL
history
.
replaceState
(
''
,
''
,
window
.
location
.
pathname
+
'
?
'
+
encodeURIComponent
(
'
bg-color=
'
+
bgColor
+
'
&fg-color=
'
+
fgColor
+
'
&text=
'
+
fillText
+
'
&font=
'
+
font
+
'
&signature=
'
+
signature
)
+
'
bg-color=
'
+
encodeURIComponent
(
bgColor
)
+
'
&fg-color=
'
+
encodeURIComponent
(
fgColor
)
+
'
&text=
'
+
encodeURIComponent
(
fillText
)
+
'
&font=
'
+
encodeURIComponent
(
font
)
+
'
&icon=
'
+
encodeURIComponent
(
icon
)
+
'
&signature=
'
+
encodeURIComponent
(
signature
)
+
window
.
location
.
hash
);
}
...
...
views/index.ejs
View file @
f12cfe3a
...
...
@@ -6,7 +6,7 @@
<meta
property=
"og:title"
content=
"Soutenez La Quadrature du Net !"
/>
<meta
property=
"og:description"
content=
"Soutenez La Quadrature du Net !"
/>
<meta
property=
"og:url"
content=
"http://<%= host %>"
/>
<meta
property=
"og:image"
content=
"http://<%= host %>/generate.png"
/>
<meta
property=
"og:image"
content=
"http://<%= host %>/generate.png
?<%= imageParams %>
"
/>
<link
rel=
"stylesheet"
href=
"./bootstrap-grid.min.css"
/>
<link
rel=
"stylesheet"
href=
"./font-awesome.min.css"
/>
<link
rel=
"stylesheet"
href=
"./style.css"
/>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment