Skip to content

Commit

Permalink
Merge pull request #310 from GSA/seo-expansion
Browse files Browse the repository at this point in the history
Add experimental seo fields
  • Loading branch information
akuny authored Mar 15, 2024
2 parents 264bd9a + 78c5be2 commit b1ce6e4
Show file tree
Hide file tree
Showing 7 changed files with 690 additions and 0 deletions.
204 changes: 204 additions & 0 deletions entities/core-result.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,210 @@ export class CoreResult {
@Expose({ name: 'cumulative_layout_shift' })
cumulativeLayoutShift?: number;

/**
* #852
* The following fields are experimental and were added in March 2024 for
* prototyping purposes. They are not yet used in the application and may be
* removed in the future.
*/
@Column({ nullable: true })
@Expose({ name: 'meta_keywords_content' })
@Exclude()
metaKeywordsContent?: string;

@Column({ nullable: true })
@Expose({ name: 'meta_robots_content' })
@Exclude()
metaRobotsContent?: string;

@Column({ nullable: true })
@Expose({ name: 'meta_article_section_content' })
@Exclude()
metaArticleSectionContent?: string;

@Column({ nullable: true })
@Expose({ name: 'meta_article_tag_content' })
@Exclude()
metaArticleTagContent?: string;

@Column({ nullable: true })
@Expose({ name: 'og_image_final_url' })
@Exclude()
ogImageFinalUrl?: string;

@Column({ nullable: true })
@Expose({ name: 'dcterms_keywords_content' })
@Exclude()
dctermsKeywordsContent?: string;

@Column({ nullable: true })
@Expose({ name: 'dc_subject_content' })
@Exclude()
dcSubjectContent?: string;

@Column({ nullable: true })
@Expose({ name: 'dcterms_subject_content' })
@Exclude()
dctermsSubjectContent?: string;

@Column({ nullable: true })
@Expose({ name: 'dcterms_audience_content' })
@Exclude()
dctermsAudienceContent?: string;

@Column({ nullable: true })
@Expose({ name: 'dc_type_content' })
@Exclude()
dcTypeContent?: string;

@Column({ nullable: true })
@Expose({ name: 'dcterms_type_content' })
@Exclude()
dctermsTypeContent?: string;

@Column({ nullable: true })
@Expose({ name: 'dc_date_content' })
@Exclude()
dcDateContent?: string;

@Column({ nullable: true })
@Expose({ name: 'dc_date_created_content' })
@Exclude()
dcDateCreatedContent?: string;

@Column({ nullable: true })
@Expose({ name: 'dcterms_created_content' })
@Exclude()
dctermsCreatedContent?: string;

@Column({ nullable: true })
@Expose({ name: 'og_locale_content' })
@Exclude()
ogLocaleContent?: string;

@Column({ nullable: true })
@Expose({ name: 'og_site_name_content' })
@Exclude()
ogSiteNameContent?: string;

@Column({ nullable: true })
@Expose({ name: 'og_type_content' })
@Exclude()
ogTypeContent?: string;

@Column({ nullable: true })
@Expose({ name: 'og_url_content' })
@Exclude()
ogUrlContent?: string;

@Column({ nullable: true })
@Expose({ name: 'og_image_alt_content' })
@Exclude()
ogImageAltContent?: string;

@Column({ nullable: true })
@Expose({ name: 'revised_content' })
@Exclude()
revisedContent?: string;

@Column({ nullable: true })
@Expose({ name: 'last_modified_content' })
@Exclude()
lastModifiedContent?: string;

@Column({ nullable: true })
@Expose({ name: 'language_content' })
@Exclude()
languageContent?: string;

@Column({ nullable: true })
@Expose({ name: 'date_content' })
@Exclude()
dateContent?: string;

@Column({ nullable: true })
@Expose({ name: 'subject_content' })
@Exclude()
subjectContent?: string;

@Column({ nullable: true })
@Expose({ name: 'owner_content' })
@Exclude()
ownerContent?: string;

@Column({ nullable: true })
@Expose({ name: 'pagename_content' })
@Exclude()
pagenameContent?: string;

@Column({ nullable: true })
@Expose({ name: 'dc_title_content' })
@Exclude()
dcTitleContent?: string;

@Column({ nullable: true })
@Expose({ name: 'og_site_name' })
@Exclude()
ogSiteName?: string;

@Column({ nullable: true })
@Expose({ name: 'item_type_content' })
@Exclude()
itemTypeContent?: string;

@Column({ nullable: true })
@Expose({ name: 'item_scope_content' })
@Exclude()
itemScopeContent?: string;

@Column({ nullable: true })
@Expose({ name: 'item_prop_content' })
@Exclude()
itemPropContent?: string;

@Column({ nullable: true })
@Expose({ name: 'vocab_content' })
@Exclude()
vocabContent?: string;

@Column({ nullable: true })
@Expose({ name: 'type_of_content' })
@Exclude()
typeOfContent?: string;

@Column({ nullable: true })
@Expose({ name: 'propertyContent' })
@Exclude()
propertyContent?: string;

@Column({ nullable: true })
@Expose({ name: 'context_content' })
@Exclude()
contextContent?: string;

@Column({ nullable: true })
@Expose({ name: 'type_content' })
@Exclude()
typeContent?: string;

@Column({ nullable: true })
@Expose({ name: 'html_lang_content' })
@Exclude()
htmlLangContent?: string;

@Column({ nullable: true })
@Expose({ name: 'hreflang_content' })
@Exclude()
hrefLangContent?: string;

@Column({ nullable: true })
@Expose({ name: 'me_content' })
@Exclude()
meContent?: string;
/**
* End experimental fields.
*/

static getColumnNames(): string[] {
// return class-transformer version of column names
return Object.keys(classToPlain(new CoreResult()));
Expand Down
41 changes: 41 additions & 0 deletions entities/scan-data.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,47 @@ export type SeoScan = {
pageTitle: string;
metaDescriptionContent: string;
hreflangCodes: string;
// #852 Begin March 2024 experimental fields
metaKeywordsContent: string;
metaRobotsContent: string;
metaArticleSectionContent: string;
metaArticleTagContent: string;
ogImageFinalUrl: string;
dctermsKeywordsContent: string;
dcSubjectContent: string;
dctermsSubjectContent: string;
dctermsAudienceContent: string;
dcTypeContent: string;
dctermsTypeContent: string;
dcDateContent: string;
dcDateCreatedContent: string;
dctermsCreatedContent: string;
ogLocaleContent: string;
ogSiteNameContent: string;
ogTypeContent: string;
ogUrlContent: string;
ogImageAltContent: string;
revisedContent: string;
lastModifiedContent: string;
languageContent: string;
dateContent: string;
subjectContent: string;
ownerContent: string;
pagenameContent: string;
dcTitleContent: string;
ogSiteName: string;
itemTypeContent: string;
itemScopeContent: string;
itemPropContent: string;
vocabContent: string;
typeOfContent: string;
propertyContent: string;
contextContent: string;
typeContent: string;
htmlLangContent: string;
hrefLangContent: string;
meContent: string;
// End March 2024 experimental fields
};

export type ThirdPartyScan = {
Expand Down
42 changes: 42 additions & 0 deletions libs/core-scanner/src/pages/primary.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,48 @@ describe('primary scanner', () => {
metaDescriptionContent:
'18F builds effective, user-centric digital services focused on the interaction between government and the people and businesses it serves.',
hreflangCodes: '',
// #852 Begin March 2024 experimental fields
contextContent: null,
dateContent: null,
dcDateContent: null,
dcDateCreatedContent: null,
dcSubjectContent: null,
dcTitleContent: null,
dcTypeContent: null,
dctermsAudienceContent: null,
dctermsCreatedContent: null,
dctermsKeywordsContent: null,
dctermsSubjectContent: null,
dctermsTypeContent: null,
hrefLangContent: '',
htmlLangContent: 'en-US',
itemPropContent: null,
itemScopeContent: null,
itemTypeContent: null,
languageContent: null,
lastModifiedContent: null,
meContent: null,
metaArticleSectionContent: null,
metaArticleTagContent: null,
metaKeywordsContent: null,
metaRobotsContent: null,
ogImageAltContent: null,
ogImageFinalUrl:
'https://18f.gsa.gov/assets/img/logos/18F-Logo-M.png',
ogLocaleContent: null,
ogSiteName: null,
ogSiteNameContent: null,
ogTypeContent: null,
ogUrlContent: null,
ownerContent: null,
pagenameContent: null,
propertyContent: 'og:title',
revisedContent: null,
subjectContent: null,
typeContent: 'image/png',
typeOfContent: null,
vocabContent: null,
// End March 2024 experimental fields
},
thirdPartyScan: {
thirdPartyServiceDomains:
Expand Down
44 changes: 44 additions & 0 deletions libs/core-scanner/src/scans/seo.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,50 @@ describe('seo scan', () => {
metaDescriptionContent: '',

hreflangCodes: '',
// #852 Begin March 2024 experimental fields
contextContent: null,
dateContent: null,
dcDateContent: null,
dcDateCreatedContent: null,
dcSubjectContent: null,
dcTitleContent: null,
dcTypeContent: null,
dctermsAudienceContent: null,
dctermsCreatedContent: null,
dctermsKeywordsContent: null,
dctermsSubjectContent: null,
dctermsTypeContent: null,
hrefLangContent: '',
htmlLangContent: 'en-US',
itemPropContent: null,
itemScopeContent: null,
itemTypeContent: null,
languageContent: null,
lastModifiedContent: null,
meContent: null,
metaArticleSectionContent: null,
metaArticleTagContent: null,
metaKeywordsContent: null,
metaRobotsContent:
'index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1',
ogImageAltContent: null,
ogImageFinalUrl:
'https://www.arc.gov/wp-content/uploads/2020/08/48982308566_5ce274f0ab_o-washington-scaled.jpg',
ogLocaleContent: 'en_US',
ogSiteName: null,
ogSiteNameContent: 'Appalachian Regional Commission',
ogTypeContent: 'website',
ogUrlContent: 'https://www.arc.gov/',
ownerContent: null,
pagenameContent: null,
propertyContent: 'og:locale',
revisedContent: null,
subjectContent: null,
typeContent:
'text/css,application/rss+xml,application/json,application/rsd+xml,application/wlwmanifest+xml,application/json+oembed,text/xml+oembed',
typeOfContent: null,
vocabContent: null,
// End March 2024 experimental fields
});
}, 'arc_gov_dump.mht');
});
Expand Down
Loading

0 comments on commit b1ce6e4

Please sign in to comment.