Skip to content

Commit

Permalink
Merge commit 'c2037f0c9a3a35b9db9c404f6b5f94ec8b690a53'
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Mar 26, 2019
2 parents 9bc6187 + c2037f0 commit 876e5f6
Show file tree
Hide file tree
Showing 45 changed files with 2,943 additions and 142 deletions.
19 changes: 17 additions & 2 deletions docs/config/_default/config.toml
@@ -1,5 +1,5 @@
baseURL = "https://gohugo.io/"
paginate = 100
paginate = 100
defaultContentLanguage = "en"
enableEmoji = true
# Set the unicode character used for the "return" link in page footnotes.
Expand Down Expand Up @@ -48,6 +48,21 @@ baseName = "_headers"
isPlainText = true
notAlternative = true

[caches]
[caches.getjson]
dir = ":cacheDir/:project"
maxAge = -1
[caches.getcsv]
dir = ":cacheDir/:project"
maxAge = -1
[caches.images]
dir = ":resourceDir/_gen"
maxAge = -1
[caches.assets]
dir = ":resourceDir/_gen"
maxAge = -1


[related]

threshold = 80
Expand All @@ -58,7 +73,7 @@ toLower = false
name = "keywords"
weight = 100
[[related.indices]]
name = "date"
name = "date"
weight = 10
pattern = "2006"

Expand Down
4 changes: 0 additions & 4 deletions docs/config/production/params.toml
@@ -1,6 +1,2 @@
# Params for production

# This is turned off in development as it is relatively slow.
# This is needed to get accurate lastMod and Git commit info
# on the docs pages.
enableGitInfo = true
2 changes: 1 addition & 1 deletion docs/content/en/_index.md
Expand Up @@ -32,7 +32,7 @@ features:
tagline: HTML not enough?
copy: Hugo allows you to output your content in multiple formats, including JSON or AMP, and makes it easy to create your own.
sections:
- heading: "100s of Themes"
- heading: "300+ Themes"
cta: Check out the Hugo themes.
link: http://themes.gohugo.io/
color_classes: bg-accent-color white
Expand Down
4 changes: 3 additions & 1 deletion docs/content/en/commands/hugo_convert.md
Expand Up @@ -10,10 +10,12 @@ Convert your content to different formats

### Synopsis

Convert your content (e.g. front matter) to different formats.
Convert your content files (front matter) to different formats.

See convert's subcommands toJSON, toTOML and toYAML for more information.

**Please Note:** This will convert front matter only. It does not convert theme and configuration files (e.g. config.toml, theme.toml). Those files will need to be manually changed to your preference.

### Options

```
Expand Down
2 changes: 1 addition & 1 deletion docs/content/en/content-management/cross-references.md
Expand Up @@ -76,7 +76,7 @@ More information about document unique identifiers and headings can be found [be
The behaviour can, since Hugo 0.45, be configured in `config.toml`:

refLinksErrorLevel ("ERROR")
: When using `ref` or `relref` to resolve page links and a link cannot resolved, it will be logged with this logg level. Valid values are `ERROR` (default) or `WARNING`. Any `ERROR` will fail the build (`exit -1`).
: When using `ref` or `relref` to resolve page links and a link cannot resolved, it will be logged with this log level. Valid values are `ERROR` (default) or `WARNING`. Any `ERROR` will fail the build (`exit -1`).

refLinksNotFoundURL
: URL to be used as a placeholder when a page reference cannot be found in `ref` or `relref`. Is used as-is.
Expand Down
2 changes: 1 addition & 1 deletion docs/content/en/content-management/multilingual.md
Expand Up @@ -49,7 +49,7 @@ linkedin = "https://linkedin.com/fr/whoever"
help = "Aide"
{{< /code-toggle >}}

Anything not defined in a `[languages]` block will fall back to the global value for that key (e.g., `copyright` for the English [`en`] language). This also works for `params`, as demonstrated witgh `help` above: You will get the value `Aide` in French and `Help` in all the languages without this parameter set.
Anything not defined in a `[languages]` block will fall back to the global value for that key (e.g., `copyright` for the English [`en`] language). This also works for `params`, as demonstrated with `help` above: you will get the value `Aide` in French and `Help` in all the languages without this parameter set.

With the configuration above, all content, sitemap, RSS feeds, paginations,
and taxonomy pages will be rendered below `/` in English (your default content language) and then below `/fr` in French.
Expand Down
4 changes: 2 additions & 2 deletions docs/content/en/content-management/shortcodes.md
Expand Up @@ -243,7 +243,7 @@ Using the preceding `instagram` with `hidecaption` example above, the following

### `param`

Gets a value from the current `Page's` params set in front matter, with a fall back to the site param value. If will log an `ERROR` if the param with the given key could not be found in either.
Gets a value from the current `Page's` params set in front matter, with a fall back to the site param value. It will log an `ERROR` if the param with the given key could not be found in either.

```bash
{{</* param testparam */>}}
Expand Down Expand Up @@ -372,7 +372,7 @@ Copy the YouTube video ID that follows `v=` in the video's URL and pass it to th
{{</* youtube w7Ft2ymGmfc */>}}
{{< /code >}}

Furthermore, you can automatically start playback of the embedded video by setting the `autoplay` parameter to `true`. Remember that you can't mix named an unnamed parameters, so you'll need to assign the yet unnamed video id to the parameter `id`:
Furthermore, you can automatically start playback of the embedded video by setting the `autoplay` parameter to `true`. Remember that you can't mix named and unnamed parameters, so you'll need to assign the yet unnamed video id to the parameter `id`:


{{< code file="example-youtube-input-with-autoplay.md" >}}
Expand Down
2 changes: 1 addition & 1 deletion docs/content/en/content-management/toc.md
Expand Up @@ -89,7 +89,7 @@ With the preceding example, even pages with > 400 words *and* `toc` not set to `
{{% /note %}}

[conditionals]: /templates/introduction/#conditionals
[front matter]: /content-management/table-of-contents/
[front matter]: /content-management/front-matter/
[pagevars]: /variables/page/
[partials]: /templates/partials/
[single page template]: /templates/single-page-templates/
49 changes: 38 additions & 11 deletions docs/content/en/contribute/development.md
Expand Up @@ -52,7 +52,7 @@ go version
You should see something similar to the following written to the console. Note that the version here reflects the most recent version of Go as of the last update for this page:

```
go version go1.8 darwin/amd64
go version go1.12 darwin/amd64
```

Next, make sure that you set up your `GOPATH` [as described in the installation guide][setupgopath].
Expand Down Expand Up @@ -116,8 +116,8 @@ echo "alias git='hub'" >> ~/.bash_profile
Confirm the installation:

```
git version 2.6.3
hub version 2.2.2
git version 2.21.0
hub version 2.10.0
```

## Set up your working copy
Expand All @@ -132,16 +132,29 @@ We assume that you've set up your `GOPATH` (see the section above if you're unsu
We're going to clone the [master Hugo repository](https://github.com/gohugoio/hugo). That seems counter-intuitive, since you won't have commit rights on it. But it's required for the Go workflow. You'll work on a copy of the master and push your changes to your own repository on GitHub.

So, let's clone that master repository:
So, let's make a new directory and clone that master repository:

```
go get -v -u github.com/gohugoio/hugo
mkdir $HOME/src
cd $HOME/src
git clone https://github.com/gohugoio/hugo.git
```

Hugo relies on [Testify](https://github.com/stretchr/testify) for testing Go code. If you don't already have it, get the Testify testing tools:
> Since Hugo 0.48, Hugo uses the Go Modules support built into Go 1.11 to build.
> The easiest is to clone Hugo in a directory outside of GOPATH
And then, install dependencies of Hugo by running the following in the cloned directory:

```
cd $HOME/src/hugo
go install
```


Hugo relies on [mage](github.com/magefile/mage) for some convenient build and test targets. If you don't already have it, get it:

```
go get github.com/stretchr/testify
go get github.com/magefile/mage
```

### Fork the repository
Expand All @@ -163,7 +176,7 @@ Now open your fork repository on GitHub and copy the remote url of your fork. Yo
Switch back to the terminal and move into the directory of the cloned master repository from the last step.

```
cd $GOPATH/src/github.com/gohugoio/hugo
cd $HOME/src/hugo
```

Now Git needs to know that our fork exists by adding the copied remote url:
Expand Down Expand Up @@ -233,19 +246,33 @@ We have developed a [separate Hugo documentation contribution guide][docscontrib
While making changes in the codebase it's a good idea to build the binary to test them:

```
go build -o hugo main.go
mage hugo
```

This command generates the binary file at the root of the repository.

If you want to install the binary in `$GOPATH/bin`, run

```
mage install
```

### Test
Sometimes changes on the codebase can cause unintended side effects. Or they don't work as expected. Most functions have their own test cases. You can find them in files ending with `_test.go`.

Make sure the commands `go test ./...` passes, and `go build` completes.
Make sure the commands

```
mage -v check
```

passes.

### Formatting
The Go code styleguide maybe is opinionated but it ensures that the codebase looks the same, regardless who wrote the code. Go comes with its own formatting tool. Let's apply the styleguide to our additions:

```
go fmt ./...
mage fmt
```

Once you made your additions commit your changes. Make sure that you follow our [code contribution guidelines](https://github.com/gohugoio/hugo/blob/master/CONTRIBUTING.md):
Expand Down
19 changes: 2 additions & 17 deletions docs/content/en/contribute/themes.md
Expand Up @@ -30,7 +30,7 @@ A collection of all themes created by the Hugo community, including screenshots
4. Add a descriptive `README.md` to the root of the theme source
5. Add `/images/screenshot.png` and `/images/tn.png`

\* If your theme doesn't fit into the `Hugo Basic Example` site, we encourage theme authors to supply a self-contained Hugo site in `/exampleSite`.
\* If your theme doesn't fit into the `Hugo Basic Example` site, we encourage theme authors to supply a self-contained Hugo site in `/exampleSite/`, but note that for security reasons the content directory on the Hugo showcase will still be published from the [`Hugo Basic Example`](https://github.com/gohugoio/hugoBasicExample/tree/master/content) repository.

{{% note %}}
The folder name here---`exampleSite`---is important, as this folder will be picked up and used by the script that generates the Hugo Theme Site. It mirrors the root directory of a Hugo website and allows you to add custom content, assets, and a `config` file with preset values.
Expand Down Expand Up @@ -125,22 +125,7 @@ Additional media may be provided in the same directory.
Your theme's README file should be written in markdown and saved at the root of your theme's directory structure. Your `README.md` serves as

1. Content for your theme's details page at <https://themes.gohugo.io>
2. General information about the theme in your GitHub repository (i.e., it's usual purpose)

#### Example `README.md`

You can download the following `README.md` as an outline:

{{< code file="README.md" download="README.md" >}}

# Theme Title

**Need input from @digitalcraftsman on what could be added to this file.**




{{< /code >}}
2. General information about the theme in your GitHub repository (i.e., it's usual purpose, features and instructions)

{{% note "Screenshots in your `README.md`"%}}
If you add screenshots to the README, please make use of absolute file paths instead of relative ones like `/images/screenshot.png`. Relative paths work great on GitHub but they don't correspond to the directory structure of [themes.gohugo.io](http://themes.gohugo.io/). Therefore, browsers will not be able to display screenshots on the theme site under the given (relative) path.
Expand Down
5 changes: 4 additions & 1 deletion docs/content/en/getting-started/configuration.md
Expand Up @@ -114,6 +114,9 @@ defaultContentLanguage ("en")
defaultContentLanguageInSubdir (false)
: Render the default content language in subdir, e.g. `content/en/`. The site root `/` will then redirect to `/en/`.

disableAliases (false)
: Will disable generation of alias redirects. Note that even if `disableAliases` is set, the aliases themselves are preserved on the page. The motivation with this is to be able to generate 301 redirects in an `.htacess`, a Netlify `_redirects` file or similar using a custom output format.

disableHugoGeneratorInject (false)
: Hugo will, by default, inject a generator meta tag in the HTML head on the _home page only_. You can turn it off, but we would really appreciate if you don't, as this is a good way to watch Hugo's popularity on the rise.

Expand Down Expand Up @@ -251,7 +254,7 @@ stepAnalysis (false)
: Display memory and timing of different steps of the program.

summaryLength (70)
: The length of text to show in a [`.Summary`](/content-management/summaries/#hugo-defined-automatic-summary-splitting).
: The length of text in words to show in a [`.Summary`](/content-management/summaries/#hugo-defined-automatic-summary-splitting).

taxonomies
: See [Configure Taxonomies](/content-management/taxonomies#configure-taxonomies).
Expand Down
44 changes: 25 additions & 19 deletions docs/content/en/getting-started/quick-start.md
Expand Up @@ -43,7 +43,7 @@ hugo version
```


{{< asciicast HDlKrUrbfT7yiWsbd6QoxzRTN >}}
{{< asciicast ItACREbFgvJ0HjnSNeTknxWy9 >}}


## Step 2: Create a New Site
Expand All @@ -54,7 +54,7 @@ hugo new site quickstart

The above will create a new Hugo site in a folder named `quickstart`.

{{< asciicast 1PH9A2fs14Dnyarx5v8OMYQer >}}
{{< asciicast 3mf1JGaN0AX0Z7j5kLGl3hSh8 >}}


## Step 3: Add a Theme
Expand All @@ -81,14 +81,16 @@ echo 'theme = "ananke"' >> config.toml
```


{{< asciicast WJM2LEZQs8VRhNeuZ5NiGPp9I >}}
{{< asciicast 7naKerRYUGVPj8kiDmdh5k5h9 >}}

## Step 4: Add Some Content

```
hugo new posts/my-first-post.md
```

{{< asciicast eUojYCfRTZvkEiqc52fUsJRBR >}}


Edit the newly created content file if you want.

Expand All @@ -97,23 +99,30 @@ Edit the newly created content file if you want.

Now, start the Hugo server with [drafts](/getting-started/usage/#draft-future-and-expired-content) enabled:

{{< asciicast BvJBsF6egk9c163bMsObhuNXj >}}



```
▶ hugo server -D
Started building sites ...
Built site for language en:
1 of 1 draft rendered
0 future content
0 expired content
1 regular pages created
8 other pages created
0 non-page files copied
1 paginator pages created
0 categories created
0 tags created
total in 18 ms
Watching for changes in /Users/bep/sites/quickstart/{data,content,layouts,static,themes}
| EN
+------------------+----+
Pages | 10
Paginator pages | 0
Non-page files | 0
Static files | 3
Processed images | 0
Aliases | 1
Sitemaps | 1
Cleaned | 0
Total in 11 ms
Watching for changes in /Users/bep/quickstart/{content,data,layouts,static,themes}
Watching for config changes in /Users/bep/quickstart/config.toml
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop
```
Expand Down Expand Up @@ -148,6 +157,3 @@ For theme specific configuration options, see the [theme site](https://github.co

**For further theme customization, see [Customize a Theme](/themes/customizing/).**

## Recapitulation

{{< asciicast pWp4uvyAkdWgQllD9RCfeBL5k >}}
43 changes: 43 additions & 0 deletions docs/content/en/hosting-and-deployment/hosting-on-aws-amplify.md
@@ -0,0 +1,43 @@
---
title: Host on AWS Amplify
linktitle: Host on AWS Amplify
description: Develop and deploy a cloud-powered web app with AWS Amplify.
date: 2018-01-31
publishdate: 2018-01-31
lastmod: 2018-01-31
categories: [hosting and deployment]
keywords: [amplify,hosting,deployment]
authors: [Nikhil Swaminathan]
menu:
docs:
parent: "hosting-and-deployment"
weight: 10
weight: 10
sections_weight: 10
draft: false
aliases: []
toc: true
---

In this guide we'll walk through how to deploy and host your Hugo site using the [AWS Amplify Console](https://console.amplify.aws).

AWS Amplify is a combination of client library, CLI toolchain, and a Console for continuous deployment and hosting. The Amplify CLI and library allow developers to get up & running with full-stack cloud-powered applications with features like authentication, storage, serverless GraphQL or REST APIs, analytics, Lambda functions, & more. The Amplify Console provides continuous deployment and hosting for modern web apps (single page apps and static site generators). Continuous deployment allows developers to deploy updates to their web app on every code commit to their Git repository. Hosting includes features such as globally available CDNs, easy custom domain setup + HTTPS, feature branch deployments, and password protection.

## Pre-requisites

* [Sign up for an AWS Account](https://portal.aws.amazon.com/billing/signup?redirect_url=https%3A%2F%2Faws.amazon.com%2Fregistration-confirmation). There are no upfront charges or any term commitments to create an AWS account and signing up gives you immediate access to the AWS Free Tier.
* You have an account with GitHub, GitLab, or Bitbucket.
* You have completed the [Quick Start][] or have a Hugo website you are ready to deploy and share with the world.

## Hosting

1. Log in to the [AWS Amplify Console](https://console.aws.amazon.com/amplify/home) and choose Get Started under Deploy.
![Hugo Amplify](/images/hosting-and-deployment/hosting-on-aws-amplify/amplify-gettingstarted.png)

1. Connect a branch from your GitHub, Bitbucket, GitLab, or AWS CodeCommit repository. Connecting your repository allows Amplify to deploy updates on every code commit to a branch.
![Hugo Amplify](/images/hosting-and-deployment/hosting-on-aws-amplify/amplify-connect-repo.gif)

1. Accept the default build settings. The Amplify Console automatically detects your Hugo build settings and output directory.
![Hugo Amplify](/images/hosting-and-deployment/hosting-on-aws-amplify/amplify-build-settings.png)

1. Review your changes and then choose **Save and deploy**. The Amplify Console will pull code from your repository, build changes to the backend and frontend, and deploy your build artifacts at `https://master.unique-id.amplifyapp.com`. Bonus: Screenshots of your app on different devices to find layout issues.

0 comments on commit 876e5f6

Please sign in to comment.