{{ define "styles" }}
    {{ $.Scratch.Set "style_opts" (dict "src" "scss/pages/post.scss" "dest" "css/post.css") }}
{{ end }}

{{ define "main" }}
    {{ $dateFormat := .Site.Params.dateFormat | default "Jan 2 2006" }}

    <div class="post">
      <header class="post__header">
        <h1 class="post__title">{{.Title}}</h1>
        <time datetime="{{ .Date }}" class="post__date"
        >{{ .Date.Format $dateFormat }}</time>
      </header>
      <article class="post__content">
          {{ partial "anchored-headings.html" .Content }}
          {{ if or .Params.math .Site.Params.math }}
              {{ partial "math.html" . }}
          {{ end }}
      </article>
        {{ partial "tags.html" .}} {{ partial "post-pagination.html" .}}
    </div>

    {{ template "_internal/disqus.html" . }}
    
{{ end }} 

{{ define "footer" }}
  <footer>
      {{ partial "social-icons.html" .}}
    <p>{{ replace .Site.Copyright "{year}" now.Year }}</p>
  </footer>
{{ end }} 

{{ define "scripts" }}
  <script src="https://unpkg.com/prismjs@^1.2"></script>
{{ end }}

{{ define "styles" }}
    {{ $.Scratch.Set "style_opts" (dict "src" "scss/pages/post.scss" "dest" "css/post.css") }}
{{ end }}

{{ define "main" }}
    {{ $dateFormat := .Site.Params.dateFormat | default "Jan 2 2006" }}

    <div class="post">
      <header class="post__header">
        <h1 class="post__title">{{.Title}}</h1>
        <time datetime="{{ .Date }}" class="post__date"
        >{{ .Date.Format $dateFormat }}</time>
      </header>
      <article class="post__content">
          {{ partial "anchored-headings.html" .Content }}
          {{ if or .Params.math .Site.Params.math }}
              {{ partial "math.html" . }}
          {{ end }}
      </article>
        {{ partial "tags.html" .}} {{ partial "post-pagination.html" .}}
    </div>

    {{ template "_internal/disqus.html" . }}
    
{{ end }} 

{{ define "footer" }}
  <footer>
      {{ partial "social-icons.html" .}}
    <p>{{ replace .Site.Copyright "{year}" now.Year }}</p>
  </footer>
{{ end }} 

{{ define "scripts" }}
  {{/* Hardcode a specific prismjs version to avoid a redirect on every page load. */}}
  <script src="https://unpkg.com/prismjs@1.20.0/components/prism-core.min.js"></script>
  <script src="https://unpkg.com/prismjs@1.20.0/plugins/autoloader/prism-autoloader.min.js"
    data-autoloader-path="https://unpkg.com/prismjs@1.20.0/components/"></script>
{{ end }}

Change how prismjs is loaded.
Change how prismjs is loaded.

 - Load minified code (3kB vs 30kB)
 - Add prism autoloader so that we get highlighting for languages we
   use.
 - Hardcode exact prism version.  Perhaps this is controversial, but it
   saves a redirect for each request, shaving off 30ms on a fast
   connection.
