angular-seo

Angular 6 | Server side rendering: issue 'window not defined'

对着背影说爱祢 提交于 2020-01-14 06:26:08
问题 I have updated my application from angular version 5 to latest. Here's detail: Angular CLI: 6.2.1 Node: 8.12.0 OS: win32 x64 Angular: 6.1.6 Also I am using this: ng-toolkit-universal to achieve server side rendering. I am able to build application using command " npm run build:prod " , but facing following issue while running command: "n pm run server ": Can anyone please help or suggest some soution for the same. Thanks in advance! 回答1: Assuming you are done SSR with angular universal. Put

Angular Meta Service not adding and updating dynamic tag values

不想你离开。 提交于 2019-12-11 04:21:01
问题 I'm working on SeoService for my Angular 6 project https://mypleaks.com. I'm trying to add and update Meta tag as my content URL changes dynamically. I'm able to console.log('18 ' + title); console.log('19 ' + description); but when I'm appending title and description in addTag and updateTag tag only static value('myPleaks | ') getting appended, and can be seen on inspecting page sources on this link https://mypleaks.com/#/content/16/Manikarnika-Teaser-Launch-Kangana-Ranaut-Celebrates-with

How implement SEO (Metatags) in Angular 2 (with Angular universal for rendering on server side)?

杀马特。学长 韩版系。学妹 提交于 2019-12-10 03:52:11
问题 I'm searching a fully working example about SEO or Metatags with Angular 2 using Angular universal to render on server side (to be recognize by facebook, twiter, and other metatags) but I had not success.. I found multiple articles, but there are incomplete (no all source code is available) or oldest (not compile with the latest versions): a) blog.devcross.net/2016/04/17/angular-2-universal-seo-friendly-website/ NOTE: Excelent post with source code, but It's not working. b) builtvisible.com

How implement SEO (Metatags) in Angular 2 (with Angular universal for rendering on server side)?

半腔热情 提交于 2019-12-05 05:04:25
I'm searching a fully working example about SEO or Metatags with Angular 2 using Angular universal to render on server side (to be recognize by facebook, twiter, and other metatags) but I had not success.. I found multiple articles, but there are incomplete (no all source code is available) or oldest (not compile with the latest versions): a) blog.devcross.net/2016/04/17/angular-2-universal-seo-friendly-website/ NOTE: Excelent post with source code, but It's not working. b) builtvisible.com/universal-angular-2-server-side-rendering-seo-crawl-friendliness/ NOTE: Very usefull but with no source

AngularJS SEO简易教程

与世无争的帅哥 提交于 2019-11-29 04:55:46
AngularJS SEO 我们知道Angular是MVC框架,页面内容是动态加载的,所以如果由搜索引擎的蜘蛛来爬的话,根本爬不出实际的东西,Prerender应运而生。你可以把它看成是一个能够读懂javascript的服务器端浏览器(Server-side browser),读懂js之后,它能够输出由js动态加载的页面内容,这给爬虫来看就正合适。业界最简单的方案是使用Prerender + nginx反向代理。这里以tomi.in为例介绍配置流程。 1. 搭建Prerender服务 Prerender官方说明 实际上就是搭建了一个Prerender服务器,给它传递参数,它帮你把JS动态页面静态化. git clone https://github.com/prerender/prerender.git 然后 cd Prerender 进入目录 npm install 安装模块依赖 node server.js 运行服务(可用 nohup node server.js & 使其运行于后台) 这里有一个坑,Prerender默认用3000端口,注意你的端口不要被占用了,否则它会给出很奇怪的错误提示. 2. 修改nginx.conf 要达到以下目的: 普通用户访问,会看到正常页面(交给localhost:4000去处理请求) 如果是爬虫访问,就交给Prerender服务去处理请求 因此