-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
107 changed files
with
179 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export default interface MetaTags { | ||
description: string; | ||
keywords: string; | ||
title: string; | ||
image: string; | ||
imageAlt: string; | ||
favicons?: { type: string; sizes: string; href: string }[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import { Injectable, Inject, PLATFORM_ID } from '@angular/core'; | ||
import { isPlatformBrowser } from '@angular/common'; | ||
import { Meta, Title } from '@angular/platform-browser'; | ||
import MetaTags from '@interfaces/meta-tags.interface'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class MetaService { | ||
isBrowser: boolean = false; | ||
|
||
constructor( | ||
private meta: Meta, | ||
private titleService: Title, | ||
@Inject(PLATFORM_ID) private platformId: Object | ||
) { | ||
this.isBrowser = isPlatformBrowser(this.platformId); | ||
} | ||
|
||
updateSiteInfoMeta(metaTags: MetaTags) { | ||
this.meta.updateTag({ name: 'description', content: metaTags.description }); | ||
this.meta.updateTag({ name: 'keywords', content: metaTags.keywords }); | ||
this.meta.updateTag({ property: 'og:title', content: metaTags.title }); | ||
this.meta.updateTag({ property: 'og:description', content: metaTags.description }); | ||
this.meta.updateTag({ property: 'og:image', content: metaTags.image }); | ||
this.meta.updateTag({ property: 'og:image:secure_url', content: metaTags.image }); | ||
this.meta.updateTag({ property: 'og:image:alt', content: metaTags.imageAlt }); | ||
this.meta.updateTag({ name: 'twitter:title', content: metaTags.title }); | ||
this.meta.updateTag({ name: 'twitter:description', content: metaTags.description }); | ||
this.meta.updateTag({ name: 'twitter:image', content: metaTags.image }); | ||
|
||
this.titleService.setTitle(metaTags.title); | ||
|
||
if (metaTags.favicons) { | ||
this.updateFavicons(metaTags.favicons); | ||
} | ||
} | ||
|
||
updateSiteColorMeta(color: string) { | ||
this.meta.updateTag({ | ||
name: "theme-color", | ||
content: color | ||
}); | ||
} | ||
|
||
updateFavicons(favicons: { type: string; sizes: string; href: string }[]) { | ||
if (this.isBrowser) { | ||
// Remove existing favicons | ||
const existingIcons = document.querySelectorAll("link[rel*='icon']"); | ||
existingIcons.forEach(icon => icon.remove()); | ||
this.writeFavicons(favicons); | ||
} | ||
} | ||
|
||
writeFavicons(favicons: { type: string; sizes: string; href: string }[]) { | ||
if (this.isBrowser) { | ||
// Add new favicons | ||
favicons.forEach(favicon => { | ||
const link: HTMLLinkElement = document.createElement('link'); | ||
link.rel = 'icon'; | ||
link.type = favicon.type; | ||
link.setAttribute('sizes', favicon.sizes); // Use setAttribute to handle read-only properties | ||
link.href = favicon.href; | ||
document.getElementsByTagName('head')[0].appendChild(link); | ||
}); | ||
} | ||
} | ||
|
||
restoreOriginalSiteInfo() { | ||
const metaTags = { | ||
description: "The website and home page of Dartegnian Velarde—dartegnian.com. Includes a mood calendar, journal, MBTI, and other info.", | ||
keywords: "Dartegnian, Dartegnian Velarde, Velarde Dartegnian, Dartegnian L. Velarde, Portfolio, Landing Page, About Me, Home Page, Mood Calendar, Journal, Web Journal, MBTI", | ||
title: "Dartegnian L. Velarde | DevOps Engineer", | ||
image: "https://dartegnian.com/assets/img/main-min-1024.jpg", | ||
imageAlt: "Material You-style introduction banner for Dartegnian.com", | ||
favicons: [ | ||
{ type: "image/png", sizes: "192x192", href: "/assets/icons/icon-192x192.png" }, | ||
{ type: "image/png", sizes: "32x32", href: "/assets/icons/favicon-32x32.png" }, | ||
{ type: "image/png", sizes: "16x16", href: "/assets/icons/favicon-16x16.png" } | ||
] | ||
}; | ||
|
||
this.updateSiteInfoMeta(metaTags); | ||
} | ||
} |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,14 @@ | ||
User-agent: * | ||
Disallow: | ||
|
||
Sitemap: https://portfolio.dartegnian.com/sitemap.xml | ||
Sitemap: https://dartegnian.com/sitemap.xml | ||
|
||
# [NOW PLAYING] | ||
# | ||
# BAHAMA | ||
# aespa | ||
# | ||
# 0:39 ──O─────────── 3:34 | ||
# ↻ ⊲ Ⅱ ⊳ ↺ | ||
# Volume: ▁▂▃▄▅▆▇ 100% | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters