O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.
re al
                                v
SEO For Developers
SELECT	
  *	
  WHERE	
  clue	
  >	
  0;

Date: February 29, 201...
$	
  whoami
     {	
  name:	
  	
  	
  	
  	
  	
  	
  	
  “Chris	
  Le”,
     	
  	
  twitter:	
  	
  	
  	
  	
  “@DjChr...
If you build it, they will come is a lie   3
re al
                                v
SEO For Developers
How SEO changed the way I develop


Date: February 29, 2012
Aut...
5
@djchrisle   6
#	
  header.html.erb
<h1>&nbsp;</h1>
....

#	
  acme.css
h1	
  {	
  
	
  	
  background-­‐image:	
  ‘/img/acme_logo.png’;	...
#	
  investments.html.erb
<a	
  href=”#watchlist”>
<div	
  id=”container”></div>
<script>
	
  	
  $(“#watchlist”).click	
 ...
http://www.acme.com/investments#positions
http://www.acme.com/investments#watchlist
http://www.acme.com/investments#menu1
...
Best Practices

• Modularize & reuse code
 – DRY principals (Don’t Repeat Yourself)

• Abstract template and view from log...
http://www.domain.com/about-­‐us/blog/post
http://www.domain.com/blog/post



                 @djchrisle                 ...
Q: What is SEO?
 A: Help the RIGHT
customers find YOU.
                      12
About us




           13
@djchrisle   14
@djchrisle   15
@djchrisle   16
require	
  'anemone'

Anemone.crawl("http://www.example.com/")	
  do	
  |anemone|
	
  	
  anemone.on_every_page	
  do	
  |...
@djchrisle   18
nsfw   19
Title tags


   @djchrisle   20
????




       21
#	
  header.html.erb
<title><%=	
  @company.name	
  %></title>




                               @djchrisle   22
#	
  header.html.erb
<title><%=	
  @company.name	
  %>	
  <%=	
  @page.title_tag	
  %></title>




                       ...
#	
  header.html.erb
<title><%=	
  @company.name	
  %>	
  <%=	
  @page.title_tag	
  %></title>

#	
  schema.rb
create_tabl...
puts	
  Page.find(1).inspect

{
	
  	
  title_tag:	
  “Experienced	
  Ruby	
  Programmers	
  in	
  Philladelphia”,
	
  	
 ...
Title matches
                                                 keyword
                                                 + ...
<h1> tags


   @djchrisle   27
#	
  post/index.html.erb
<h1><%=	
  @post.title	
  %></h1>




              @djchrisle            28
@djchrisle   29
@djchrisle   30
#	
  my_page.html.erb
<h1>&nbsp;</h1>
....

#	
  acme.css
h1	
  {	
  
	
  	
  background-­‐image:	
  ‘/img/acme_logo.png’;...
This page is about
                                       “Non-breaking space?”
#	
  my_page.html.erb
<h1>&nbsp;</h1>
.......
Better use of H1
#	
  my_page.html.erb
<div	
  class=”logo”></div>
<h1>	
  Sensible	
  Investment	
  Strategies	
  </h1>
....
URLs &
Hash fragments

      @djchrisle   34
http://www.acme.com/investments#positions
http://www.acme.com/investments#watchlist
http://www.acme.com/investments#menu1
...
http://www.acme.com/investments#positions
    http://www.acme.com/investments#watchlist
    http://www.acme.com/investment...
Uncrawlable URL
#	
  investments.html.erb

<a	
  href=”#watchlist”>

<div	
  id=”container”></div>

<script>
	
  	
  $(“#w...
Crawlable URL
#	
  investments.html.erb

<a	
  href=”/investments/watchlist”>

<div	
  id=”container”></div>

<script>
	
 ...
#	
  routes.rb
resources	
  :investments
match	
  “content/:section”	
  =>	
  “content#show”

#	
  content_controller.rb
c...
http://www.acme.com/investments/positions
    http://www.acme.com/investments/watchlist
    http://www.acme.com/investment...
301 / 302
 redirect

   @djchrisle   41
http://www.domain.com/about-­‐us/blog/post
http://www.domain.com/blog/post



                 @djchrisle                 ...
#	
  content_controller.rb
class	
  ContentController	
  <	
  ActionController::Base
	
  	
  respond_to	
  :html

	
  	
  ...
Defaults as 302 response

#	
  content_controller.rb
class	
  ContentController	
  <	
  ActionController::Base
	
  	
  res...
301 vs 302 redirect


• RFC 2616, Section 10.3.3
 – 302 Found: The requested resource resides
  temporarily under a differ...
46
302 =
nothing




          47
301 =
change




         48
404 = delist




          49
#	
  content_controller.rb
class	
  ContentController	
  <	
  ActionController::Base
	
  	
  respond_to	
  :html

	
  	
  ...
#	
  content_controller.rb
class	
  ContentController	
  <	
  ActionController::Base
	
  	
  respond_to	
  :html

	
  	
  ...
#	
  routes.rb

match	
  “/about-­‐us/blog/:post_title”	
  =>	
  
	
  	
  redirect(“/blog/#{params[:post_title]}”)




   ...
If you build it, they will come is a lie   53
Every great idea
   deserves the
chance to be found

       @djchrisle    54
re al
                                v
SEO For Developers
How SEO changed the way I develop


Date: February 29, 2012
Aut...
Q&A


@djchrisle   56
2006-2007




            57
58
Próximos SlideShares
Carregando em…5
×

de

SEO for Developers Slide 1 SEO for Developers Slide 2 SEO for Developers Slide 3 SEO for Developers Slide 4 SEO for Developers Slide 5 SEO for Developers Slide 6 SEO for Developers Slide 7 SEO for Developers Slide 8 SEO for Developers Slide 9 SEO for Developers Slide 10 SEO for Developers Slide 11 SEO for Developers Slide 12 SEO for Developers Slide 13 SEO for Developers Slide 14 SEO for Developers Slide 15 SEO for Developers Slide 16 SEO for Developers Slide 17 SEO for Developers Slide 18 SEO for Developers Slide 19 SEO for Developers Slide 20 SEO for Developers Slide 21 SEO for Developers Slide 22 SEO for Developers Slide 23 SEO for Developers Slide 24 SEO for Developers Slide 25 SEO for Developers Slide 26 SEO for Developers Slide 27 SEO for Developers Slide 28 SEO for Developers Slide 29 SEO for Developers Slide 30 SEO for Developers Slide 31 SEO for Developers Slide 32 SEO for Developers Slide 33 SEO for Developers Slide 34 SEO for Developers Slide 35 SEO for Developers Slide 36 SEO for Developers Slide 37 SEO for Developers Slide 38 SEO for Developers Slide 39 SEO for Developers Slide 40 SEO for Developers Slide 41 SEO for Developers Slide 42 SEO for Developers Slide 43 SEO for Developers Slide 44 SEO for Developers Slide 45 SEO for Developers Slide 46 SEO for Developers Slide 47 SEO for Developers Slide 48 SEO for Developers Slide 49 SEO for Developers Slide 50 SEO for Developers Slide 51 SEO for Developers Slide 52 SEO for Developers Slide 53 SEO for Developers Slide 54 SEO for Developers Slide 55 SEO for Developers Slide 56 SEO for Developers Slide 57 SEO for Developers Slide 58
Próximos SlideShares
What to Upload to SlideShare
Avançar
Transfira para ler offline e ver em ecrã inteiro.

0 gostaram

Compartilhar

Baixar para ler offline

SEO for Developers

Baixar para ler offline

Slides from my talk at

  • Seja a primeira pessoa a gostar disto

SEO for Developers

  1. 1. re al v SEO For Developers SELECT  *  WHERE  clue  >  0; Date: February 29, 2012 Author: Chris Le (@djchrisle) 1
  2. 2. $  whoami {  name:                “Chris  Le”,    twitter:          “@DjChrisLe”,    occupation:  [        “Internal  app  developer”,        “Project  management”,        “Technical  SEO  support”    ] }
  3. 3. If you build it, they will come is a lie 3
  4. 4. re al v SEO For Developers How SEO changed the way I develop Date: February 29, 2012 Author: Chris Le (@djchrisle) 4
  5. 5. 5
  6. 6. @djchrisle 6
  7. 7. #  header.html.erb <h1>&nbsp;</h1> .... #  acme.css h1  {      background-­‐image:  ‘/img/acme_logo.png’;      background-­‐repeat:  no-­‐repeat; } @djchrisle 7
  8. 8. #  investments.html.erb <a  href=”#watchlist”> <div  id=”container”></div> <script>    $(“#watchlist”).click  (function()  { //  =>  sets  loadThis  to  “watchlist”        var  loadThis  =  $.param.fragment($.param.querystring);        $(“#container”).load(“/content?get=”  +  loadThis);    } </script> #  content_controller.rb class  ContentController  <  ActionController::Base    respond_to  :html    def  index        @content  =  Content.find_by_name(params[:get]        respond_with(@content)    end end @djchrisle 8
  9. 9. http://www.acme.com/investments#positions http://www.acme.com/investments#watchlist http://www.acme.com/investments#menu1 http://www.acme.com/investments#menu2 @djchrisle 9
  10. 10. Best Practices • Modularize & reuse code – DRY principals (Don’t Repeat Yourself) • Abstract template and view from logic – Independently change stuff - no problems • Use async JS loading to reduce load – Lower server costs – Fast load time (aka: “site speed”) @djchrisle 10
  11. 11. http://www.domain.com/about-­‐us/blog/post http://www.domain.com/blog/post @djchrisle 11
  12. 12. Q: What is SEO? A: Help the RIGHT customers find YOU. 12
  13. 13. About us 13
  14. 14. @djchrisle 14
  15. 15. @djchrisle 15
  16. 16. @djchrisle 16
  17. 17. require  'anemone' Anemone.crawl("http://www.example.com/")  do  |anemone|    anemone.on_every_page  do  |page|            puts  page.url    end end Bank.account  <<  Profit! @djchrisle 17
  18. 18. @djchrisle 18
  19. 19. nsfw 19
  20. 20. Title tags @djchrisle 20
  21. 21. ???? 21
  22. 22. #  header.html.erb <title><%=  @company.name  %></title> @djchrisle 22
  23. 23. #  header.html.erb <title><%=  @company.name  %>  <%=  @page.title_tag  %></title> @djchrisle 23
  24. 24. #  header.html.erb <title><%=  @company.name  %>  <%=  @page.title_tag  %></title> #  schema.rb create_table  “Page”    t.string  “title_tag”    ... end #  page.rb Class  Page  <  ActiveRecord::Base    belongs_to  :category        def  title_tag        title_tag.defined?  ?  super()  :  self.category.name    end end @djchrisle 24
  25. 25. puts  Page.find(1).inspect {    title_tag:  “Experienced  Ruby  Programmers  in  Philladelphia”,    content:  “...” } @djchrisle 25
  26. 26. Title matches keyword + is what user is looking for My Company | Experienced Ruby Programmers in Philadelphia 26
  27. 27. <h1> tags @djchrisle 27
  28. 28. #  post/index.html.erb <h1><%=  @post.title  %></h1> @djchrisle 28
  29. 29. @djchrisle 29
  30. 30. @djchrisle 30
  31. 31. #  my_page.html.erb <h1>&nbsp;</h1> .... #  acme.css h1  {      background-­‐image:  ‘/img/acme_logo.png’;      background-­‐repeat:  no-­‐repeat; } @djchrisle 31
  32. 32. This page is about “Non-breaking space?” #  my_page.html.erb <h1>&nbsp;</h1> .... #  acme.css h1  {      background-­‐image:  ‘/img/acme_logo.png’;      background-­‐repeat:  no-­‐repeat; } @djchrisle 32
  33. 33. Better use of H1 #  my_page.html.erb <div  class=”logo”></div> <h1>  Sensible  Investment  Strategies  </h1> .... #  acme.css .logo  {      background-­‐image:  ‘/img/acme_logo.png’;      background-­‐repeat:  no-­‐repeat; } @djchrisle 33
  34. 34. URLs & Hash fragments @djchrisle 34
  35. 35. http://www.acme.com/investments#positions http://www.acme.com/investments#watchlist http://www.acme.com/investments#menu1 http://www.acme.com/investments#menu2 @djchrisle 35
  36. 36. http://www.acme.com/investments#positions http://www.acme.com/investments#watchlist http://www.acme.com/investments#menu1 http://www.acme.com/investments#menu2 4 pages .. 1 listing :( Acme Inc | Financial Portfolio Managers www.acme.com/investments @djchrisle 36
  37. 37. Uncrawlable URL #  investments.html.erb <a  href=”#watchlist”> <div  id=”container”></div> <script>    $(“#watchlist”).click  (function()  { //  =>  sets  loadThis  to  “watchlist”        var  loadThis  =  $.param.fragment($.param.querystring);        $(“#container”).load(“/content?get=”  +  loadThis);    } </script> 37
  38. 38. Crawlable URL #  investments.html.erb <a  href=”/investments/watchlist”> <div  id=”container”></div> <script>    $(“#watchlist”).click  (function()  {        $(“#container”).load($.param.querystring);    } </script> 38
  39. 39. #  routes.rb resources  :investments match  “content/:section”  =>  “content#show” #  content_controller.rb class  ContentController  <  ActionController::Base    respond_to  :html    def  show        @content  =  Content.find_by_name(params[:section])        respond_with(@content)    end end @djchrisle 39
  40. 40. http://www.acme.com/investments/positions http://www.acme.com/investments/watchlist http://www.acme.com/investments/menu1 http://www.acme.com/investments/menu2 4 pages .. 4 listings :) Acme Inc | Financial Portfolio Managers www.acme.com/investments/positions @djchrisle 40
  41. 41. 301 / 302 redirect @djchrisle 41
  42. 42. http://www.domain.com/about-­‐us/blog/post http://www.domain.com/blog/post @djchrisle 42
  43. 43. #  content_controller.rb class  ContentController  <  ActionController::Base    respond_to  :html    def  show        redirect_to  :post_path        #  @content  =  Content.find_by_id(params[:id])        #  respond_with(@content)    end end @djchrisle 43
  44. 44. Defaults as 302 response #  content_controller.rb class  ContentController  <  ActionController::Base    respond_to  :html    def  show        redirect_to  :post_path        #  @content  =  Content.find_by_id(params[:id])        #  respond_with(@content)    end end @djchrisle 44
  45. 45. 301 vs 302 redirect • RFC 2616, Section 10.3.3 – 302 Found: The requested resource resides temporarily under a different URI • RFC 2616, Section 10.3.2 –301 Moved Permanently: The requested resource has been assigned a new permanent URI and any future references to this resource SHOULD use one of the returned URIs @djchrisle 45
  46. 46. 46
  47. 47. 302 = nothing 47
  48. 48. 301 = change 48
  49. 49. 404 = delist 49
  50. 50. #  content_controller.rb class  ContentController  <  ActionController::Base    respond_to  :html    def  show        redirect_to  :post_path,  :status  =>  301        #  @content  =  Content.find_by_id(params[:id])        #  respond_with(@content)    end end @djchrisle 50
  51. 51. #  content_controller.rb class  ContentController  <  ActionController::Base    respond_to  :html    def  show        redirect_to  :post_path,  :status  =>  301        #  @content  =  Content.find_by_id(params[:id])        #  respond_with(@content)    end end @djchrisle 51
  52. 52. #  routes.rb match  “/about-­‐us/blog/:post_title”  =>      redirect(“/blog/#{params[:post_title]}”) 52
  53. 53. If you build it, they will come is a lie 53
  54. 54. Every great idea deserves the chance to be found @djchrisle 54
  55. 55. re al v SEO For Developers How SEO changed the way I develop Date: February 29, 2012 Author: Chris Le (@djchrisle) 55
  56. 56. Q&A @djchrisle 56
  57. 57. 2006-2007 57
  58. 58. 58

Slides from my talk at

Vistos

Vistos totais

663

No Slideshare

0

De incorporações

0

Número de incorporações

3

Ações

Baixados

5

Compartilhados

0

Comentários

0

Curtir

0

×