|
1 | 1 | import { Component } from '@angular/core';
|
2 | 2 | import { load } from './index.server';
|
3 | 3 | import { toSignal } from '@angular/core/rxjs-interop';
|
4 |
| -import { injectLoad } from '@analogjs/router'; |
| 4 | +import { injectLoad, RouteMeta } from '@analogjs/router'; |
5 | 5 | import { DividerModule } from 'primeng/divider';
|
| 6 | +import { Title } from '@angular/platform-browser'; |
| 7 | +import { JsonLdService } from '../../services/json-ld.service'; |
| 8 | + |
| 9 | +export const routeMeta: RouteMeta = { |
| 10 | + meta: [ |
| 11 | + { |
| 12 | + name: 'description', |
| 13 | + content: 'Curated list of Angular Call for papers', |
| 14 | + }, |
| 15 | + ], |
| 16 | +}; |
6 | 17 |
|
7 | 18 | @Component({
|
8 | 19 | selector: 'app-callforpapers',
|
@@ -116,4 +127,44 @@ import { DividerModule } from 'primeng/divider';
|
116 | 127 | })
|
117 | 128 | export default class CallForPapersComponent {
|
118 | 129 | callForPapers = toSignal(injectLoad<typeof load>(), { requireSync: true });
|
| 130 | + |
| 131 | + constructor( |
| 132 | + private title: Title, |
| 133 | + private jsonldService: JsonLdService, |
| 134 | + ) { |
| 135 | + this.title.setTitle('Angular HUB - Call for papers'); |
| 136 | + this.jsonldService.updateJsonLd(this.setJsonLd()); |
| 137 | + } |
| 138 | + |
| 139 | + setJsonLd() { |
| 140 | + return { |
| 141 | + '@context': 'https://schema.org', |
| 142 | + '@type': 'ItemList', |
| 143 | + itemListElement: [ |
| 144 | + ...this.callForPapers().events.map((event, index) => ({ |
| 145 | + '@type': 'ListItem', |
| 146 | + position: index + 1, |
| 147 | + item: { |
| 148 | + '@type': 'Event', |
| 149 | + name: event.name, |
| 150 | + description: event.name, |
| 151 | + startDate: event.date, |
| 152 | + location: event.location, |
| 153 | + url: event.callForPapersUrl, |
| 154 | + }, |
| 155 | + })), |
| 156 | + ...this.callForPapers().communities.map((community, index) => ({ |
| 157 | + '@type': 'ListItem', |
| 158 | + position: index + 1, |
| 159 | + item: { |
| 160 | + '@type': 'Organization', |
| 161 | + name: community.name, |
| 162 | + description: community.name, |
| 163 | + location: community.location, |
| 164 | + url: community.callForPapersUrl, |
| 165 | + }, |
| 166 | + })), |
| 167 | + ], |
| 168 | + }; |
| 169 | + } |
119 | 170 | }
|
0 commit comments