gobuffalo / tags

HTML tags in Go
MIT License
53 stars 72 forks source link

SEO tags #67

Open stanislas-m opened 6 years ago

stanislas-m commented 6 years ago

Optimizing projects for search engines and social medias is a great way to improve a website audience. How about providing some SEO-related tags to help developers to manage this part?

It can be some shortcut tags for meta tags. See https://moz.com/blog/meta-data-templates-123 for some examples.

paganotoni commented 6 years ago

I love this one, I've been thinking to add a few more tags to the default Buffalo template and this one could be a good start for it, I'll keep you posted @stanislas-m.

hubyhuby commented 6 years ago

Yes it would be very usefull ;) To share on linkedin you need those ones for each page : https://www.linkedin.com/help/linkedin/answer/46687/making-your-website-shareable-on-linkedin?lang=en http://ogp.me/

Those days my code goes like this :
` <%= if (product) { %>

<%= product.Title %>|<%= product.Country %> -
            <meta name="description" content="<%= product.Description %>" />
            <meta property="og:title" content="<%= product.Title %>|<%= product.Country %> - " />
            <meta property="og:image" content="/<%= product.Photo1 %>"/>
            <meta property="og:description" content="<%= product.Description %>"/>
            <meta property="og:url" content="/products/<%= product.ID %>" />
<% } else { %>
        <%=  if (user)  { %>
            <title> <%= user.FirstName %> <%= user.Name %>|<%= user.City %> Profile- </title>
        <% } else { %>
            <title>  :A freelancer that fits your project | Project portfolios</title>
            <meta name="description" content=" " />
            <meta property="og:title" content=" :A freelancer that fits your project | Project portfolios" />
            <meta property="og:image" content="http://.me/blog/media/website/-square-400.png"/>
            <meta property="og:description" content=" "/>
            <meta property="og:url" content="www..me" />
            <% } %>
<% } `%>``
hubyhuby commented 6 years ago

Food for thoughts, to some extend we might generate the "Structured Data ". Question , as often : is it worth since we would need to customize heavily the tags each time...

https://developers.google.com/search/docs/guides/intro-structured-data?authuser=1&visit_id=1-636597213680370985-915175522&hl=fr&rd=1