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
web-et-numerique
web-et-numerique-internet
data.grandlyon.com
web-portal
components
custom-apps
web-app
Commits
da6c4b35
Commit
da6c4b35
authored
Apr 15, 2021
by
Matthieu Benoist
Browse files
change meta desc truncate method
parent
7f12a1f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/app/editorialisation/services/seo.service.ts
View file @
da6c4b35
...
...
@@ -31,6 +31,16 @@ export class SeoSErvice {
const
imageUrl
=
(
post
.
content
.
og_image
!=
null
)
?
post
.
content
.
og_image
:
post
.
content
.
featureImage
;
var
description
:
string
=
''
;
if
(
post
.
content
.
meta_description
)
{
description
=
post
.
content
.
meta_description
;
}
else
{
description
=
post
.
content
.
excerpt
;
if
(
description
.
length
>
140
)
{
description
=
`
${
description
.
substr
(
0
,
description
.
substr
(
0
,
136
).
lastIndexOf
(
'
'
))}
...`
;
}
}
var
description
:
string
=
post
.
content
.
meta_description
?
post
.
content
.
meta_description
:
`
${
post
.
content
.
excerpt
.
slice
(
0
,
136
)}
...`
;
...
...
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