Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
web-et-numerique
Factory
Resin
Client
Commits
73200e71
Commit
73200e71
authored
1 year ago
by
Etienne LOUPIAS
Browse files
Options
Downloads
Patches
Plain Diff
test
parent
c5f07c04
No related branches found
No related tags found
1 merge request
!634
Draft: Resolve "[Actualités] - Partage article via RS : image d'illus à la place du logo rés'in"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/post/components/post-details/post-details.component.ts
+13
-2
13 additions, 2 deletions
...pp/post/components/post-details/post-details.component.ts
with
13 additions
and
2 deletions
src/app/post/components/post-details/post-details.component.ts
+
13
−
2
View file @
73200e71
import
{
Component
,
ElementRef
,
OnInit
,
Renderer2
,
ViewEncapsulation
}
from
'
@angular/core
'
;
import
{
DomSanitizer
}
from
'
@angular/platform-browser
'
;
import
{
DomSanitizer
,
Meta
}
from
'
@angular/platform-browser
'
;
import
{
ActivatedRoute
}
from
'
@angular/router
'
;
import
{
RouterListenerService
}
from
'
../../../services/routerListener.service
'
;
import
{
Post
}
from
'
../../models/post.model
'
;
...
...
@@ -20,7 +20,8 @@ export class PostDetailsComponent implements OnInit {
private
sanitizer
:
DomSanitizer
,
private
routerListener
:
RouterListenerService
,
private
readonly
elementRef
:
ElementRef
,
private
renderer
:
Renderer2
private
renderer
:
Renderer2
,
private
meta
:
Meta
)
{}
ngOnInit
():
void
{
...
...
@@ -32,12 +33,22 @@ export class PostDetailsComponent implements OnInit {
this
.
postService
.
getPost
(
postId
).
subscribe
((
post
)
=>
{
this
.
post
=
post
.
posts
[
0
];
this
.
post
.
safeHtml
=
this
.
sanitizer
.
bypassSecurityTrustHtml
(
this
.
post
.
html
);
this
.
meta
.
addTag
({
property
:
'
og:title
'
,
content
:
this
.
post
.
title
});
//this.meta.addTag({ property: 'og:image', content: this.post.feature_image });
this
.
meta
.
addTag
({
property
:
'
og:image
'
,
content
:
'
https://resin-dev.apps.grandlyon.com/assets/logos/logo_europe.png
'
,
});
});
}
// add ghost JS
const
script
=
this
.
renderer
.
createElement
(
'
script
'
);
script
.
src
=
'
/assets/ghost/cards.min.js
'
;
this
.
renderer
.
appendChild
(
this
.
elementRef
.
nativeElement
,
script
);
this
.
meta
.
updateTag
({
property
:
'
og:title
'
,
content
:
this
.
post
.
title
});
this
.
meta
.
updateTag
({
property
:
'
og:image
'
,
content
:
this
.
post
.
feature_image
});
}
public
backToPosts
():
void
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment