Skip to content

Commit

Permalink
Revert the "standardize author data"
Browse files Browse the repository at this point in the history
There were some breaking changes etc. that is too late to fix for 0.17.

Let us think this through and add proper author support for Hugo 0.18.

Fixes #2464

Revert "docs: Add documentation for author profiles"

This reverts commit b6673e5.

Revert "Add First Class Author Support"

This reverts commit cf978c0.
  • Loading branch information
bep committed Sep 18, 2016
1 parent 83533a8 commit 4a79fa0
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 395 deletions.
2 changes: 1 addition & 1 deletion docs/content/extras/analytics.md
Expand Up @@ -4,7 +4,7 @@ linktitle: Analytics
menu:
main:
parent: extras
next: /extras/authors
next: /extras/builders
prev: /extras/aliases
title: Analytics in Hugo
weight: 15
Expand Down
165 changes: 0 additions & 165 deletions docs/content/extras/authors.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/content/extras/builders.md
Expand Up @@ -6,7 +6,7 @@ menu:
main:
parent: extras
next: /extras/comments
prev: /extras/authors
prev: /extras/analytics
title: Hugo Builders
weight: 20
---
Expand Down
5 changes: 4 additions & 1 deletion docs/content/templates/rss.md
Expand Up @@ -69,7 +69,9 @@ This is the default RSS template that ships with Hugo. It adheres to the [RSS 2.
<link>{{ .Permalink }}</link>
<description>Recent content {{ with .Title }}in {{.}} {{ end }}on {{ .Site.Title }}</description>
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
<language>{{.}}</language>{{end}}{{ with .Site.Copyright }}
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
<atom:link href="{{.URL}}" rel="self" type="application/rss+xml" />
Expand All @@ -78,6 +80,7 @@ This is the default RSS template that ships with Hugo. It adheres to the [RSS 2.
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
<description>{{ .Content | html }}</description>
</item>
Expand Down
43 changes: 3 additions & 40 deletions docs/content/templates/variables.md
Expand Up @@ -2,7 +2,7 @@
aliases:
- /doc/variables/
- /layout/variables/
lastmod: 2016-08-22
lastmod: 2015-12-08
date: 2013-07-01
linktitle: Variables
menu:
Expand Down Expand Up @@ -61,8 +61,6 @@ matter, content or derived from file location.
**.Translations** A list of translated versions of the current page. See [Multilingual]({{< relref "content/multilingual.md" >}}) for more info. Note that the `Translation` variable is also available on node, e.g. home page etc. <br>
**.IsTranslated** Whether there are any translations to display.<br>
**.Lang** Language taken from the language extension notation. <br>
**.Author** Returns the first listed author for a page<br>
**.Authors** (**note the plural form**) Returns all listed authors for a page in the order they are defined in the front matter.<br>

## Page Params

Expand Down Expand Up @@ -126,12 +124,10 @@ includes taxonomies, lists and the homepage.
**.Translations** A list of translated versions of the current node. All nodes (except the pager nodes) can have translated counter parts. See [Multilingual]({{< relref "content/multilingual.md" >}}) for more info. <br>
**.IsTranslated** Whether there are any translations to display.<br>
**.Lang** The language code of this node.<br>
**.Author** Returns the first defined author, sorted by their weight attribute.<br>
**.Authors** (**note the plural form**) Returns all defined authors, sorted by their weight attribute.<br>

### Taxonomy Terms Node Variables

[Taxonomy Terms](/templates/terms/) pages are of the type "node" and have the following **additional** variables. These are available in `layouts/_defaults/terms.html` for example.
[Taxonomy Terms](/templates/terms/) pages are of the type "node" and have the following additional variables. These are available in `layouts/_defaults/terms.html` for example.

**.Data.Singular** The singular name of the taxonomy<br>
**.Data.Plural** The plural name of the taxonomy<br>
Expand Down Expand Up @@ -172,7 +168,7 @@ Also available is `.Site` which has the following:
**.Site.Files** All of the source files of the site.<br>
**.Site.Menus** All of the menus in the site.<br>
**.Site.Title** A string representing the title of the site.<br>
**.Site.Authors** An ordered list (ordered by defined weight) of the authors as defined in the site configuration. Have a look at [acessible attributes](#author-variables).<br>
**.Site.Author** A map of the authors as defined in the site configuration.<br>
**.Site.LanguageCode** A string representing the language as defined in the site configuration. This is mostly used to populate the RSS feeds with the right language code.<br>
**.Site.DisqusShortname** A string representing the shortname of the Disqus shortcode as defined in the site configuration.<br>
**.Site.GoogleAnalytics** A string representing your tracking code for Google Analytics as defined in the site configuration.<br>
Expand Down Expand Up @@ -203,39 +199,6 @@ Available are the following attributes:
**.File.Ext** or **.File.Extension** The file extension of the content file, e.g. `md`<br>
**.File.Dir** Given the path `content/posts/dir1/dir2/`, the relative directory path of the content file will be returned, e.g. `posts/dir1/dir2/`<br>

## Author variables

This variables are used for the author profiles feature. You can find a more in-depth explaination with examples [here]({{< relref "extras/authors.md" >}}).

The `authors` frontmatter variable represents a list of author identifiers. Those identifiers are used to match their corresponding profiles. `.Author` contains the profile associated with the first identifiers in the list.

**.Author.ID** The identifier of an author (a.k.a. the filename of his/her profile)<br>
**.Author.GivenName** or **.Author.FirstName** The author's first name, e.g. Charles<br>
**.Author.FamilyName** or **.Author.LastName** The author's last name, e.g. Dickens<br>
**.Author.DisplayName** The author's full name, e.g. Charles Dickens<br>
**.Author.Thumbnail** A link to a thumbnail of the author. Maybe the relative path to an image in the `static` folder<br>
**.Author.Image** A larger image of the author. Can be stored in the `static` folder as well.<br>
**.Author.Bio** A biography with background information about the author<br>
**.Author.ShortBio** A summarized version of the biography<br>
**.Author.Email** The email of the author<br>
**.Author.Weight** The associated weight of an author. Defines the order of authors in the `.Authors` list (except on pages due to the frontmatter)<br>
**.Author.Social** A container holding the values from the `social` section of the author's profile. For example, a TOML profile (excerpt) might look like this:

[social]
facebook = "charles.dickens"
twitter = "charlesdickens"
**.Author.Params** A container holding the values from the `params` section of the author's file. The values can be arbitrary and depend on the profile. For example, a TOML profile (excerpt) might look like this:

[params]
random = "whatever you want"
**.Author.Social.URL** Takes a social network as argument (as string) and generates the link the account automatically. A list of supported social networks and a template can be found [here]({{< relref "extras/authors.md#linking-social-network-accounts-automatically" >}}).

---

`.Authors` (**note the plural form**) is a list of all author profiles that are mentioned in the `authors` frontmatter variable.

**.Authors.Get** Takes the identifier of an author as argument (as string) and returns an `.Author` object.

## Hugo Variables

Also available is `.Hugo` which has the following:
Expand Down

0 comments on commit 4a79fa0

Please sign in to comment.