Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AngularJS - SEO - S3 Static Pages

My application uses AngularJS for frontend and .NET for the backend.

In my application I have a list view. On clicking each list item, It will fetch a pre rendered HTML page from S3.

I am using angular state.

app.js

...
state('staticpage', {
    url: "/staticpage",
    templateUrl: function (){
        return 'http://xxxxxxx.cloudfront.net/staticpage/staticpage1.html';
    },
    controller: 'StaticPageCtrl',
    title: 'Static Page'
})

StaticPage1.html

<div>
Hello static world 1!
<div>

How do I do SEO here?

Do I really need to do HTML snapshot using PanthomJS or so.

like image 930
Gugan Avatar asked Jul 01 '16 09:07

Gugan


Video Answer


1 Answers

Yes PhantomJS would do the trick or you can use prerender.io with that service you can just use their open source renderer and have your own server.

Another way is to use _escaped_fragment_ meta tag

I hope this helps, if you have any questions add comments and I will update my answer.

like image 52
Tim Avatar answered Oct 01 '22 23:10

Tim