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
import { Component, effect, inject } from '@angular/core'; | |
import { MatCardModule } from '@angular/material/card'; | |
import { MatDividerModule } from '@angular/material/divider'; | |
import { ArticleDTO, IArticleDTO } from '../objects/dataObjects'; | |
import { ContentService } from '../shared/content.service'; | |
import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; | |
import { MarkdownModule } from 'ngx-markdown'; | |
import { SeoService } from '../shared/seo.service'; |
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
import { Injectable, RendererFactory2, PLATFORM_ID, inject } from '@angular/core'; | |
import { Meta, Title } from '@angular/platform-browser'; | |
import { isPlatformBrowser } from '@angular/common'; | |
import { PostStructuredData, PostTags } from '../objects/seoObjects'; | |
import { ArticleDTO } from '../objects/dataObjects'; | |
import { environment } from '../../environments/environment'; | |
import { Pages } from '../objects/blogObjects'; | |
const ComponentName = 'SeoService'; |
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
. . . | |
private getLocationOrgin(): string { | |
if (!this.isBrowser) { | |
return 'http://www.mydomain.com'; | |
} else { | |
return window.location.origin; | |
} | |
} | |
. . . |
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
. . . | |
const script = this.renderer.createElement('script'); | |
this.renderer.setAttribute(script, 'type', 'application/ld+json'); | |
this.renderer.appendChild(script, this.renderer.createText(JSON.stringify(structuredData))); | |
this.renderer.appendChild(this.renderer.selectRootElement('head', true), script); | |
} | |
. . . |
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
import { inject, Injectable } from '@angular/core'; | |
import { PostStructuredData, PostTags } from '../objects/seoObjects'; | |
import { ArticleDTO } from '../objects/dataObjects'; | |
import { environment } from '../../environments/environment'; | |
import { Pages } from '../objects/blogObjects'; | |
import { Meta, Title } from '@angular/platform-browser'; | |
import { DOCUMENT } from '@angular/common'; | |
@Injectable({ | |
providedIn: 'root', |
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
// Constants | |
const META_VALUES = { | |
BLOG_SITE_NAME: 'A simple Multi-Container Blog Site Project', | |
FAVICON_URL: '/assets/images/favicon.ico', | |
ROBOTS_VALUE: 'index, follow', | |
TWITTER_CARD_VALUE: 'summary_large_image', | |
} as const; | |
const SCHEMA_TYPES = { |
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
import { inject, Injectable, signal } from '@angular/core'; | |
import { DataService } from './data.service'; | |
import { ArticleDTO, IArticleDTO, ICategory } from '../objects/dataObjects'; | |
import { Pages } from '../objects/blogObjects'; | |
import { Location, PlatformLocation } from '@angular/common'; | |
import { environment } from '../../environments/environment'; | |
import { NavigationEnd, Router } from '@angular/router'; | |
import { filter } from 'rxjs'; | |
const ComponentName = 'ContentService'; |
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
/* | |
Blog backend Test schema | |
-------------------------- | |
schema.sql | |
---------------------------------------------------------------------------- | |
MariaDB/MySQL Tables and Data Objectsc for Jdbc default | |
Requires MariaDB version 10.2.1 or MySQL version 8.0.13 and aftrward. | |
(C)opyright Panos Zafeiropoulos - 2024 |
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
INSERT INTO `users` (`userName`, `userPassword`, `userEmail`, `userIsEnabled`, `userSlugName`) VALUES ('Panagiotis', 'panos_passw', 'admin@genmail.com', 1, 'panos'); | |
INSERT INTO `users` (`userName`, `userPassword`, `userEmail`, `userIsEnabled`, `userSlugName`) VALUES ('Kleoniki', 'niki_passw', 'niki@genmail.com', 1, 'niki'); | |
INSERT INTO `users` (`userName`, `userPassword`, `userEmail`, `userIsEnabled`, `userSlugName`) VALUES ('Ioannis', 'john_passw', 'john@genmail.com', 1, 'john'); | |
INSERT INTO `users` (`userName`, `userPassword`, `userEmail`, `userIsEnabled`, `userSlugName`) VALUES ('`Styliani', 'stela_passw', 'stela@genmail.com', 1, 'stela'); | |
INSERT INTO `users` (`userName`, `userPassword`, `userEmail`, `userIsEnabled`, `userIsAuthor`, `userSlugName`) VALUES ('Paraskevi', 'voula_passw', 'voula@genmail.com', 1, 0, 'voula'); |
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
DELIMITER @ | |
CREATE TRIGGER `INS_USER_TIMESTAMP_PASSW` | |
BEFORE INSERT ON `users` | |
FOR EACH ROW | |
BEGIN | |
DECLARE salt VARCHAR(16); | |
-- Check if the password is 80 characters and hexadecimal | |
IF CHAR_LENGTH(NEW.`userPassword`) = 80 AND | |
NEW.`userPassword` REGEXP '^[0-9a-fA-F]+$' THEN | |
-- Leave the password unchanged |
NewerOlder