Skip to content

Instantly share code, notes, and snippets.

View elgreatly's full-sized avatar

Abdelrhman ElGreatly elgreatly

View GitHub Profile
@elgreatly
elgreatly / index.html
Last active November 21, 2020 19:38
index.html
<meta name="description" content="An angular app that is actually search crawler bot friendly">
<meta name="keywords" content="summary">
<!-- twitter -->
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@content">
<meta name="twitter:title" content="Home page">
<meta name="twitter:description" content="An angular app that is actually search crawler bot friendly">
<meta name="twitter:image" content="https://www.example.com/assets/seo.jpeg">
<!-- facebook and other social sites -->
@elgreatly
elgreatly / SeoService.ts
Created December 21, 2018 19:13
SeoService.ts
import { Injectable } from '@angular/core';
import { Meta } from '@angular/platform-browser';
@Injectable()
export class SeoService {
constructor(private meta: Meta) { }
generateTags(config) {
// default values
config = {
title: 'Angular <3 Linkbots',
description: 'My SEO friendly Angular Component',
@elgreatly
elgreatly / page.component.ts
Created December 21, 2018 19:14
page.component.ts
import { Component, OnInit } from '@angular/core';
import { SeoService } from '../seo.service';
@Component({
selector: 'about-page',
templateUrl: './about-page.component.html',
styleUrls: ['./about-page.component.sass'],
})
export class AboutPageComponent implements OnInit {
constructor(private seo: SeoService) { }
ngOnInit() {
@elgreatly
elgreatly / www
Created December 21, 2018 19:17
www
#!/usr/bin/env node
/**
* Module dependencies.
*/
var app = require('../app');
var debug = require('debug')('mean-app:server');
var http = require('http');
/*
* Get port from environment and store in Express.
@elgreatly
elgreatly / app.js
Created December 21, 2018 19:20
app.js
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var bodyParser = require('body-parser');
var http = require('http');
const fetch = require('node-fetch');
const url = require('url');
const rendertron = require('rendertron-middleware');
var app = express();
@elgreatly
elgreatly / app.js
Last active December 25, 2018 20:22
app.js
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var bodyParser = require('body-parser');
var http = require('http');
const fetch = require('node-fetch');
const url = require('url');
const rendertron = require('rendertron-middleware');
var app = express();
@elgreatly
elgreatly / app.js
Last active December 25, 2018 20:29
add custom bots
var express = require('express');
var path = require('path');
var fs = require('fs');
const rendertron = require('rendertron-middleware');
var app = express();
const bots = [
'baiduspider',
'bingbot',