Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@ baseURL = "https://pulumi.io/"
languageCode = "en-us"
title = "Pulumi"

disableKinds = ["category", "RSS"]

disableKinds = ["category", "taxonomyTerm"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing taxonomyTerm as well here just to silence a build warning:

WARN 2019/06/14 10:48:59 found no layout file for "HTML" for "taxonomyTerm"

I don't think we need this, but I'm not yet an expert on Hugo taxonomies, so given our author and tag pages are rendering properly, it seems fine to suppress it. @justinvp may know better, though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with the taxonomy stuff in Hugo, so can't comment definitively here. If it removes the warnings, sounds good to me.

sectionPagesMenu = "main"
pygmentsCodeFences = true
pygmentsUseClasses = true

sectionPagesMenu = "main"
[outputFormats.RSS]
baseName = "rss"

[taxonomies]
author = "authors"
tag = "tags"
author = "authors"
tag = "tags"

[permalinks]
authors = "/blog/author/:slug/"
tags = "/blog/tag/:slug/"
authors = "/blog/author/:slug/"
tags = "/blog/tag/:slug/"

[blackfriday]
fractions = false
Expand Down
30 changes: 30 additions & 0 deletions layouts/blog/rss.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
<rss version="2.0">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding the following as the first line:

{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}

Per https://gohugo.io/templates/rss/

<channel>
<title>Pulumi Blog</title>
<link>{{ .Permalink }}</link>
<description>Infrastructure as Code for AWS, Azure, Google Cloud, including Kubernetes, Serverless, Containers, for Developers and DevOps.</description>
<language>{{ .Site.LanguageCode }}</language>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ range where .Data.Pages "Type" "in" "blog" }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
<guid>{{ .Permalink }}</guid>
<description>{{ .Summary | html }}</description>
{{ range $id := .Params.authors }}
{{ $author := index $.Site.Data.team.team $id }}
{{ if $author }}
<author>{{ $author.name }}</author>
{{ end }}
{{ end }}
{{ range $tag := .Params.tags }}
{{ if $tag }}
<category>{{ $tag }}</category>
{{ end }}
{{ end }}
</item>
{{ end }}
</channel>
</rss>
36 changes: 19 additions & 17 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="google-site-verification" content="j-Opn93zR4YQcV5bbYN99BmNc48BT5mzd2VpzKaW9YY" />

{{ if isset .Params "redirect_to" }}
<meta http-equiv="refresh" content="0; url={{ .Params.redirect_to }}" />
<meta http-equiv="refresh" content="0; url={{ .Params.redirect_to }}" />
{{ end }}

<!--
Expand All @@ -13,20 +14,19 @@
<meta property="og:type" content="article">
<meta property="og:url" content="{{ .Permalink }}">
<meta property="og:site_name" content="pulumi">

<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@PulumiCorp">

{{ if isset .Params "meta_twitter_creator" }}
<meta name="twitter:creator" content="{{ .Params.meta_twitter_creator }}">
{{ else if isset .Params "authors" }}
{{ range $idx, $authorName := .Param "authors" }}
{{ $authorData := index $.Site.Data.team.team $authorName }}
{{ with $authorData.social }}
{{ with .twitter }}
<meta name="twitter:creator" content="@{{ . }}">
{{ end }}
{{ end }}
{{ $authorData := index $.Site.Data.team.team $authorName }}
{{ with $authorData.social }}
{{ with .twitter }}
<meta name="twitter:creator" content="@{{ . }}">
{{ end }}
{{ end }}
{{ end }}
{{ end }}

Expand Down Expand Up @@ -58,13 +58,15 @@
<meta property="og:image" content="{{ .Site.BaseURL }}{{ .Params.meta_image }}">
{{ end }}
{{ else }}
<meta property="og:image" content="{{ .Site.BaseURL }}/social/pulumi.png">
<meta property="og:image" content="{{ .Site.BaseURL }}/social/pulumi.png">
{{ end }}

<title>{{ .Title }}{{if not .IsHome}} - {{ end }}{{ .Site.Title }}</title>

<link rel="icon" type="image/x-icon" href="/images/favicon.ico" />

<!-- RSS link for the blog. -->
<link rel="alternate" type="application/rss+xml" href="{{ .Site.BaseURL }}blog/rss.xml" title="Pulumi Blog" />

<!--
Build Sass. Generated file will contain content hash in filename,
so no need to add query param to cache bust.
Expand All @@ -78,16 +80,16 @@
<script> !function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t,e){var n=document.createElement("script");n.type="text/javascript";n.async=!0;n.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(n,o);analytics._loadOptions=e};analytics.SNIPPET_VERSION="4.1.0"; analytics.load("mNROzbfcr6gi80tV37QuBcL0tK1DWvte"); analytics.page(); }}();</script>
<script src="//cdnjs.cloudflare.com/ajax/libs/anchor-js/4.1.0/anchor.min.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function(event) {
anchors.add("h1:not(.no-anchor), h2:not(.no-anchor), h3:not(.no-anchor), h4:not(.no-anchor), h5:not(.no-anchor), h6:not(.no-anchor)");
});
document.addEventListener("DOMContentLoaded", function(event) {
anchors.add("h1:not(.no-anchor), h2:not(.no-anchor), h3:not(.no-anchor), h4:not(.no-anchor), h5:not(.no-anchor), h6:not(.no-anchor)");
});
</script>

{{/* Tests to enforce required frontmatter for certain content types. */}}
{{ if eq .Type "blog" }}
{{ if not (isset .Params "authors") }}{{ errorf "Blog posts require authors: %s" .File.Path }}{{ end }}
{{ if not (or (isset .Params "description") (isset .Params "summary")) }}
{{ errorf "Blog posts require a description: %s" .File.Path }}
{{ end }}
{{ if not (isset .Params "authors") }}{{ errorf "Blog posts require authors: %s" .File.Path }}{{ end }}
{{ if not (or (isset .Params "description") (isset .Params "summary")) }}
{{ errorf "Blog posts require a description: %s" .File.Path }}
{{ end }}
{{ end }}
</head>