How to fine tune Page Titles, Meta Titles and Meta Descriptions

@natefinch provided some code on Google Groups for “term-specific content”, which goes like so…

<ul>
{{ $base := .Site.BaseUrl }}
{{ $data := .Data}}

{{ $desc := printf "%s-desc" .Data.Singular}}
{{ $tax := index .Site.Taxonomies $desc }}

{{ range $key, $value := .Data.Terms }}
<a href="{{$base}}/{{$data.Plural}}/{{ $key | urlize }}"> {{ $key }} </a>
  {{ $pages := index $tax $key }}
  {{ if len $pages }}
    {{ $page := index $pages 0 }}
    <p>{{ $page.Page.Content }}</p>
  {{end}}
{{ end }}

I have around 150 pages in my site and I need to find-tune my Page titles, Meta Titles and Meta Descriptions, so I’m am wondering if this approach is how I should attempt it, or if some others have another solution for this?

On some pages I need [sitename] [pagetitle] for the meta/page title.
On other pages I need [pagetitle] [sitename].
And on others again I need [sitename] [pagetitle(plural)].

So, the best way to do this is to use different templates for specific content… so like, I presume there’s some logic that says “this page needs [sitename][pagetitle] and this page needs [pagetitle][sitname]” If you can quantify that down to some simple logic, you can put it either in a single template, or have the template different based on type/section.

More specifics might make it easier.