@lenne.tech/ng-base 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/lenne.tech-ng-base-src-lib-base.umd.js +71 -14
- package/bundles/lenne.tech-ng-base-src-lib-base.umd.js.map +1 -1
- package/bundles/lenne.tech-ng-base.umd.js +71 -14
- package/bundles/lenne.tech-ng-base.umd.js.map +1 -1
- package/esm2015/lib/base/factories/apollo-options.factory.js +3 -2
- package/esm2015/lib/base/services/seo.service.js +70 -14
- package/esm2015/src/lib/base/factories/apollo-options.factory.js +3 -2
- package/esm2015/src/lib/base/services/seo.service.js +70 -14
- package/fesm2015/lenne.tech-ng-base-src-lib-base.js +71 -14
- package/fesm2015/lenne.tech-ng-base-src-lib-base.js.map +1 -1
- package/fesm2015/lenne.tech-ng-base.js +71 -14
- package/fesm2015/lenne.tech-ng-base.js.map +1 -1
- package/lib/base/services/seo.service.d.ts +36 -3
- package/package.json +1 -1
- package/src/lib/base/lenne.tech-ng-base-src-lib-base.metadata.json +1 -1
- package/src/lib/base/services/seo.service.d.ts +36 -3
|
@@ -572,8 +572,9 @@
|
|
|
572
572
|
*/
|
|
573
573
|
function apolloOptionsFactory(baseModuleConfig, httpLink, authService) {
|
|
574
574
|
var links = [];
|
|
575
|
+
var defaultUrl = 'api.' + window.location.href + '/graphql';
|
|
575
576
|
var http = httpLink.create({
|
|
576
|
-
uri: baseModuleConfig.apiUrl,
|
|
577
|
+
uri: baseModuleConfig.apiUrl ? baseModuleConfig.apiUrl : 'https://' + defaultUrl,
|
|
577
578
|
});
|
|
578
579
|
var authMiddleware = new core.ApolloLink(function (operation, forward) {
|
|
579
580
|
var headers = {};
|
|
@@ -3010,23 +3011,79 @@
|
|
|
3010
3011
|
this.titleService = titleService;
|
|
3011
3012
|
this.metaTagService = metaTagService;
|
|
3012
3013
|
}
|
|
3013
|
-
SEOService.prototype.initPageForSEO = function (
|
|
3014
|
-
this.
|
|
3015
|
-
this.
|
|
3016
|
-
|
|
3017
|
-
|
|
3014
|
+
SEOService.prototype.initPageForSEO = function (input) {
|
|
3015
|
+
this.setGeneralData(input);
|
|
3016
|
+
this.setTwitterData(input);
|
|
3017
|
+
this.setTwitterData(input);
|
|
3018
|
+
this.setFacebookData(input);
|
|
3019
|
+
if (input.keywords) {
|
|
3020
|
+
this.setPageKeywords(input.keywords);
|
|
3018
3021
|
}
|
|
3019
3022
|
};
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3023
|
+
/**
|
|
3024
|
+
* Set general metadata
|
|
3025
|
+
*
|
|
3026
|
+
* @param data
|
|
3027
|
+
* @private
|
|
3028
|
+
*/
|
|
3029
|
+
SEOService.prototype.setGeneralData = function (data) {
|
|
3030
|
+
this.titleService.setTitle(data.title);
|
|
3031
|
+
this.metaTagService.updateTag({ name: 'description', content: data.description });
|
|
3024
3032
|
};
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3033
|
+
/**
|
|
3034
|
+
* Set metadata for twitter
|
|
3035
|
+
*
|
|
3036
|
+
* @param data
|
|
3037
|
+
* @private
|
|
3038
|
+
*/
|
|
3039
|
+
SEOService.prototype.setTwitterData = function (data) {
|
|
3040
|
+
this.metaTagService.updateTag({ name: 'twitter:title', content: data.title });
|
|
3041
|
+
this.metaTagService.updateTag({ name: 'twitter:description', content: data.description });
|
|
3042
|
+
this.metaTagService.updateTag({
|
|
3043
|
+
property: 'twitter:url',
|
|
3044
|
+
content: data.url ? data.url : window.location.href,
|
|
3045
|
+
});
|
|
3046
|
+
if (data.image) {
|
|
3047
|
+
this.metaTagService.updateTag({
|
|
3048
|
+
property: 'twitter:image',
|
|
3049
|
+
content: data.image,
|
|
3050
|
+
});
|
|
3051
|
+
this.metaTagService.updateTag({
|
|
3052
|
+
property: 'twitter:card',
|
|
3053
|
+
content: 'summary_large_image',
|
|
3054
|
+
});
|
|
3055
|
+
}
|
|
3029
3056
|
};
|
|
3057
|
+
/**
|
|
3058
|
+
* Set metadata for facebook
|
|
3059
|
+
*
|
|
3060
|
+
* @param data
|
|
3061
|
+
* @private
|
|
3062
|
+
*/
|
|
3063
|
+
SEOService.prototype.setFacebookData = function (data) {
|
|
3064
|
+
this.metaTagService.updateTag({ property: 'og:title', content: data.title });
|
|
3065
|
+
this.metaTagService.updateTag({ property: 'og:description', content: data.description });
|
|
3066
|
+
this.metaTagService.updateTag({
|
|
3067
|
+
property: 'og:type',
|
|
3068
|
+
content: 'website',
|
|
3069
|
+
});
|
|
3070
|
+
this.metaTagService.updateTag({
|
|
3071
|
+
property: 'og:url',
|
|
3072
|
+
content: data.url ? data.url : window.location.href,
|
|
3073
|
+
});
|
|
3074
|
+
if (data.image) {
|
|
3075
|
+
this.metaTagService.updateTag({
|
|
3076
|
+
property: 'og:image',
|
|
3077
|
+
content: data.image,
|
|
3078
|
+
});
|
|
3079
|
+
}
|
|
3080
|
+
};
|
|
3081
|
+
/**
|
|
3082
|
+
* Set page keywords
|
|
3083
|
+
*
|
|
3084
|
+
* @param keywords
|
|
3085
|
+
* @private
|
|
3086
|
+
*/
|
|
3030
3087
|
SEOService.prototype.setPageKeywords = function (keywords) {
|
|
3031
3088
|
this.metaTagService.updateTag({ name: 'keywords', content: keywords });
|
|
3032
3089
|
};
|