mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 02:09:37 +02:00
Fix SEO and refactor HTML pages generation
* Split methods in multiple classes * Add JSONLD tags in embed too * Index embeds but use a canonical URL tag (targeting the watch page) * Remote objects don't include a canonical URL tag anymore. Instead we forbid indexation * Canonical URLs now use the official short URL (/w/, /w/p, /a, /c etc.)
This commit is contained in:
parent
e731f4b724
commit
f90db24233
23 changed files with 1876 additions and 1213 deletions
18
server/core/lib/html/shared/common-embed-html.ts
Normal file
18
server/core/lib/html/shared/common-embed-html.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { MVideo, MVideoPlaylist } from '../../../types/models/index.js'
|
||||
import { TagsHtml } from './tags-html.js'
|
||||
|
||||
export class CommonEmbedHtml {
|
||||
|
||||
static buildEmptyEmbedHTML (options: {
|
||||
html: string
|
||||
playlist?: MVideoPlaylist
|
||||
video?: MVideo
|
||||
}) {
|
||||
const { html, playlist, video } = options
|
||||
|
||||
let htmlResult = TagsHtml.addTitleTag(html)
|
||||
htmlResult = TagsHtml.addDescriptionTag(htmlResult)
|
||||
|
||||
return TagsHtml.addTags(htmlResult, { indexationPolicy: 'never' }, { playlist, video })
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue