From: Bjørn Erik Pedersen Date: Wed, 21 Feb 2018 09:00:31 +0000 (+0100) Subject: Squashed 'docs/' changes from f97826a17..1dc05a16b X-Git-Tag: v0.37~4^2~1 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=374d184e6747678364fd61f5faf328ec9205eb6b;p=brevno-suite%2Fhugo Squashed 'docs/' changes from f97826a17..1dc05a16b 1dc05a16b Update index.md d73a9b3b4 Added StackImpact showcase b0e82b3a5 Fix uglyURLs example cf8a93728 GA track outgoing sponsor clikcs aca59ac66 Move the sponsor banners up a little 5571673f0 Migrate from analytics.js to gtag.js 64a29b6cb Update faq.md 84704aa84 Use GOPATH variable if defined in installation from source 5f70e6ee2 Remove disableRSS etc. from the documentation 4945e7937 Remove superflous asterisks 39f6c9c28 showcase: Add 1password.com fe0f82610 Add GitLab warning 9f26f21d2 Fix URL typo 83a91fc99 Remove duplicate release notes 133cdd313 Release 0.36.1 fbe2a2dc7 Clean images 1b02f9193 Merge branch 'temp361' c430d2d58 Merge branch 'release-0.36.1' dd7370fc4 releaser: Prepare repository for 0.37-DEV 72534f9ec releaser: Add release notes to /docs for release of 0.36.1 845b2cacb releaser: Bump versions for release of 0.36.1 78790fcb1 Add fluid type to showcase details box 4ef59e008 Adjust column widths to handle a wider variety of copy width 6d2e68521 Always show the latest showcase item on front page 665b1eb5e showcase: Shuffle the news items 5fef1f9b7 Escape quote d680f0c16 Add some quotes 1722f0d5a showcase: Make the description more about Hugo a9d43db0a Add Quiply Employee Communications App 7aaa464ec Add Quiply Employee Communications App fad6a25dd maintenance: Show last 30 7afcfdced showcase: Set Linode date to today 0c31f481a New showcase for Linode 6c7687c2d Minor edits to the `apply` documentation 04bbff8b3 Update apply.md f543032e3 Fix clunky sentence 218ba2a65 Some more Netlify improvements 0bd512125 Improve the Netlify versioning docs 7a708d60e Clarify Netlify's Hugo versions handling 8f86342cd Add some space d68d4ff37 Remove now superflous warning bf93a46ea maintenance: Add TODO list 3b5f27835 maintenance: Remove a superflous prefix 8f29ba2fb maintenance: Adjust order 105d53610 maintenance: Add TOC 29e86396b maintenance: Fix page list selection ba51fe66d Finish the Maintenance section e9b0c710c Add latest changes in new spotlight section 8ccd79f61 Fix broken sentence c77643c37 Spelling 919f2faef Remove some old troubleshooting articles 09e467f06 Add a new FAQ ac2b25bb5 Hartwell showcase typos 5bf766993 Trim "www." from shocase URLs in title a180cd5cb Make the inline showcase template names unique 6886982fd Merge commit '9cc9bab46288d8d5f9fda7009c5f746258cec1b4' 09728efbf Add "target" and "rel" parameters to figure shortcode git-subtree-dir: docs git-subtree-split: 1dc05a16bd6b99809d97daeda743d914297f908c --- diff --git a/config.toml b/config.toml index db39a277..9772045f 100644 --- a/config.toml +++ b/config.toml @@ -71,7 +71,7 @@ twitter = "GoHugoIO" [params] description = "The world’s fastest framework for building websites" ## Used for views in rendered HTML (i.e., rather than using the .Hugo variable) - release = "0.36" + release = "0.36.1" ## Setting this to true will add a "noindex" to *EVERY* page on the site removefromexternalsearch = false ## Gh repo for site footer (include trailing slash) diff --git a/content/content-management/cross-references.md b/content/content-management/cross-references.md index 8c3155c0..a2c0de26 100644 --- a/content/content-management/cross-references.md +++ b/content/content-management/cross-references.md @@ -61,13 +61,6 @@ To be sure to get the correct reference in this case, use the full path: {{}} => /events/my-birthday/ {{< /code >}} -{{< todo >}}Remove this warning when https://github.com/gohugoio/hugo/issues/3703 is released.{{< /todo >}} - -A relative document name must *not* begin with a slash (`/`). -``` -{{}} => "" -``` - ### With Multiple Output Formats If the page exists in multiple [output formats][], `ref` or `relref` can be used with a output format name: diff --git a/content/content-management/shortcodes.md b/content/content-management/shortcodes.md index b6428f5a..e5bc8526 100644 --- a/content/content-management/shortcodes.md +++ b/content/content-management/shortcodes.md @@ -80,15 +80,41 @@ Hugo ships with a set of predefined shortcodes that represent very common usage. The `figure` shortcode can use the following named parameters: -* `src` -* `link` -* `title` -* `caption` -* `class` -* `attr` (i.e., attribution) -* `attrlink` -* `alt` -* `width` +src +: URL of the image to be displayed. + +link +: If the image needs to be hyperlinked, URL of the destination. + +target +: Optional `target` attribute for the URL if `link` parameter is set. + +rel +: Optional `rel` attribute for the URL if `link` parameter is set. + +alt +: Alternate text for the image if the image cannot be displayed. + +title +: Image title. + +caption +: Image caption. + +class +: `class` attribute of the HTML `figure` tag. + +height +: `height` attribute of the image. + +width +: `width` attribute of the image. + +attr +: Image attribution text. + +attrlink +: If the attribution text needs to be hyperlinked, URL of the destination. #### Example `figure` Input diff --git a/content/content-management/urls.md b/content/content-management/urls.md index c2c08a4d..54ce81ee 100644 --- a/content/content-management/urls.md +++ b/content/content-management/urls.md @@ -118,7 +118,7 @@ aliases: --- {{< /code >}} -Now when you visit any of the locations specified in aliases---i.e., *assuming the same site domain*---you'll be redirected to the page they are specified on. For example, a visitor to `example.com/posts/my-original-url/` will be immediately redirected to `example.com/posts/my-awesome-blog-post/`. +Now when you visit any of the locations specified in aliases---i.e., *assuming the same site domain*---you'll be redirected to the page they are specified on. For example, a visitor to `example.com/posts/my-original-url/` will be immediately redirected to `example.com/posts/my-awesome-post/`. ### Example: Aliases in Multilingual @@ -222,7 +222,7 @@ Here's the same organization run with `hugo --uglyURLs`: . └── content └── about - | └── _index.md // <- https://example.com/about/index.html + | └── _index.md // <- https://example.com/about.html ├── post | ├── firstpost.md // <- https://example.com/post/firstpost.html | ├── happy diff --git a/content/documentation.md b/content/documentation.md index b9db486a..9371dbdf 100644 --- a/content/documentation.md +++ b/content/documentation.md @@ -4,7 +4,6 @@ linktitle: Hugo description: Hugo is the world's fastest static website engine. It's written in Go (aka Golang) and developed by bep, spf13 and friends. date: 2017-02-01 publishdate: 2017-02-01 -lastmod: 2017-02-01 menu: main: parent: "section name" @@ -16,4 +15,6 @@ aliases: [] toc: false layout: documentation-home --- -Hugo is the **world's fastest static website engine.** It's written in Go (aka Golang) and developed by [bep](https://github.com/bep), [spf13](https://github.com/spf13) and [friends](https://github.com/gohugoio/hugo/graphs/contributors). Below you will find some of the most common and helpful pages from our documentation. +Hugo is the **world's fastest static website engine.** It's written in Go (aka Golang) and developed by [bep](https://github.com/bep), [spf13](https://github.com/spf13) and [friends](https://github.com/gohugoio/hugo/graphs/contributors). + +Below you will find some of the most common and helpful pages from our documentation. diff --git a/content/functions/apply.md b/content/functions/apply.md index 72066273..9690837d 100644 --- a/content/functions/apply.md +++ b/content/functions/apply.md @@ -10,7 +10,7 @@ menu: docs: parent: "functions" keywords: [advanced] -signature: ["apply COLLETION FUNCTION [PARAM...]"] +signature: ["apply COLLECTION FUNCTION [PARAM...]"] workson: [] hugoversion: relatedfuncs: [] @@ -20,16 +20,16 @@ aliases: [] --- {{< todo >}} - +POTENTIAL NEW CONTENT: see apply/sequence discussion: https://discourse.gohugo.io/t/apply-printf-on-a-sequence/5722; {{< /todo >}} `apply` expects at least three parameters, depending on the function being applied. -1. The first parameter is the sequence to operate on +1. The first parameter is the sequence to operate on. 2. The second parameter is the name of the function as a string, which must be the name of a valid [Hugo function][functions]. 3. After that, the parameters to the applied function are provided, with the string `"."` standing in for each element of the sequence the function is to be applied against. -Here is an example of a content file with `name:` as a front matter field: +Here is an example of a content file with `names:` as a front matter field: ``` +++ @@ -43,19 +43,19 @@ You can then use `apply` as follows: {{ apply .Params.names "urlize" "." }} ``` -Which will result as follows: +Which will result in the following: ``` "derek-perkins", "joe-bergevin", "tanner-linsley" ``` -This is *roughly* equivalent to using the following with [range][] +This is *roughly* equivalent to using the following with [range][]: ``` {{ range .Params.names }}{{ . | urlize }}{{ end }} ``` -However, it isn’t possible to provide the output of a range to the [`delimit` function][delimit], so you need to `apply` it. +However, it is not possible to provide the output of a range to the [`delimit` function][delimit], so you need to `apply` it. If you have `post-tag-list.html` and `post-tag-link.html` as [partials][], you *could* use the following snippets, respectively: diff --git a/content/getting-started/configuration.md b/content/getting-started/configuration.md index 7b31931e..5249e4fa 100644 --- a/content/getting-started/configuration.md +++ b/content/getting-started/configuration.md @@ -79,16 +79,10 @@ defaultContentLanguage: "en" # Renders the default content language in subdir, e.g. /en/. The root directory / will redirect to /en/ defaultContentLanguageInSubdir: false disableLiveReload: false -# Do not build RSS files -disableRSS: false -# Do not build Sitemap file -disableSitemap: false # Enable GitInfo feature enableGitInfo: false # Build robots.txt file enableRobotsTXT: false -# Do not render 404 page -disable404: false # Do not inject generator meta tag on homepage disableHugoGeneratorInject: false # Allows you to disable all page types and will render nothing related to 'kind'; @@ -221,16 +215,10 @@ defaultContentLanguage = "en" # Renders the default content language in subdir, e.g. /en/. The root directory / will redirect to /en/ defaultContentLanguageInSubdir = false disableLiveReload = false -# Do not build RSS files -disableRSS = false -# Do not build Sitemap file -disableSitemap = false # Enable GitInfo feature enableGitInfo = false # Build robots.txt file enableRobotsTXT = false -# Do not render 404 page -disable404 = false # Do not inject generator meta tag on homepage disableHugoGeneratorInject = false # Allows you to disable all page types and will render nothing related to 'kind'; diff --git a/content/getting-started/installing.md b/content/getting-started/installing.md index eb605c2a..bf0bde50 100644 --- a/content/getting-started/installing.md +++ b/content/getting-started/installing.md @@ -70,7 +70,7 @@ choco install hugo -confirm #### Vendored Dependencies -Hugo uses [dep][] to vendor dependencies, but we don't commit the vendored packages themselves to the Hugo git repository. Therefore, a simple `go get` is *not* supported because the command is not vendor aware. +Hugo uses [dep][] to vendor dependencies, but we don't commit the vendored packages themselves to the Hugo git repository. Therefore, a simple `go get` is *not* supported because the command is not vendor aware. The simplest way is to use [mage][] (a Make alternative for Go projects.) @@ -79,7 +79,7 @@ The simplest way is to use [mage][] (a Make alternative for Go projects.) {{< code file="from-gh.sh" >}} go get github.com/magefile/mage go get -d github.com/gohugoio/hugo -cd $HOME/go/src/github.com/gohugoio/hugo +cd ${GOPATH:-$HOME/go}/src/github.com/gohugoio/hugo mage vendor mage install {{< /code >}} diff --git a/content/getting-started/usage.md b/content/getting-started/usage.md index bc988d27..2ad2910f 100644 --- a/content/getting-started/usage.md +++ b/content/getting-started/usage.md @@ -44,6 +44,7 @@ Usage: Available Commands: benchmark Benchmark Hugo by building a site a number of times. + check Contains some verification checks config Print the site configuration convert Convert your content to different formats env Print Hugo version and environment info @@ -61,18 +62,16 @@ Flags: -E, --buildExpired include expired content -F, --buildFuture include content with publishdate in the future --cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/ - --canonifyURLs if true, all relative URLs will be canonicalized using baseURL + --canonifyURLs (deprecated) if true, all relative URLs will be canonicalized using baseURL --cleanDestinationDir remove files from destination not found in static directories --config string config file (default is path/config.yaml|json|toml) -c, --contentDir string filesystem path to content directory --debug debug output -d, --destination string filesystem path to write files to - --disable404 do not render 404 page --disableKinds stringSlice disable different kind of pages (home, RSS etc.) - --disableRSS do not build RSS files - --disableSitemap do not build Sitemap file --enableGitInfo add Git revision, date and author info to the pages --forceSyncStatic copy all files when static is changed. + --gc enable to run some cleanup tasks (remove unused cache files) after the build -h, --help help for hugo --i18n-warnings print missing translations --ignoreCache ignores the cache directory @@ -81,23 +80,21 @@ Flags: --logFile string log File path (if set, logging enabled automatically) --noChmod don't sync permission mode of files --noTimes don't sync modification time of files - --pluralizeListTitles pluralize titles in lists using inflect (default true) - --preserveTaxonomyNames preserve taxonomy names as written ("Gérard Depardieu" vs "gerard-depardieu") + --pluralizeListTitles (deprecated) pluralize titles in lists using inflect (default true) + --preserveTaxonomyNames (deprecated) preserve taxonomy names as written ("Gérard Depardieu" vs "gerard-depardieu") --quiet build in quiet mode --renderToMemory render to memory (only useful for benchmark testing) -s, --source string filesystem path to read files relative from --stepAnalysis display memory and timing of different steps of the program --templateMetrics display metrics about template executions + --templateMetricsHints calculate some improvement hints when combined with --templateMetrics -t, --theme string theme to use (located in /themes/THEMENAME/) --themesDir string filesystem path to themes directory - --uglyURLs if true, use /filename.html instead of /filename/ + --uglyURLs (deprecated) if true, use /filename.html instead of /filename/ -v, --verbose verbose output --verboseLog verbose logging -w, --watch watch filesystem for changes and recreate as needed -Additional help topics: - hugo check Contains some verification checks - Use "hugo [command] --help" for more information about a command. ``` diff --git a/content/hosting-and-deployment/hosting-on-gitlab.md b/content/hosting-and-deployment/hosting-on-gitlab.md index c38908ca..9c4a8978 100644 --- a/content/hosting-and-deployment/hosting-on-gitlab.md +++ b/content/hosting-and-deployment/hosting-on-gitlab.md @@ -20,6 +20,14 @@ wip: false aliases: [/tutorials/hosting-on-gitlab/] --- +{{% warning %}} +GitLab has temporarily turned off custom domains support because of a security issue. The plan is to re-enable it after the 20th of February. +For more information: +https://about.gitlab.com/2018/02/05/gitlab-pages-custom-domain-validation/ +{{% /warning %}} + +{{< todo >}}Remove the above when fixed.{{< /todo >}} + [GitLab](https://gitlab.com/) makes it incredibly easy to build, deploy, and host your Hugo website via their free GitLab Pages service, which provides [native support for Hugo, as well as numerous other static site generators](https://gitlab.com/pages/hugo). ## Assumptions diff --git a/content/hosting-and-deployment/hosting-on-netlify.md b/content/hosting-and-deployment/hosting-on-netlify.md index def152b3..fca639fa 100644 --- a/content/hosting-and-deployment/hosting-on-netlify.md +++ b/content/hosting-and-deployment/hosting-on-netlify.md @@ -59,37 +59,33 @@ Select the repo you want to use for continuous deployment. If you have a large n Once selected, you'll be brought to a screen for basic setup. Here you can select the branch you wanted published, your [build command][], and your publish (i.e. deploy) directory. The publish directory should mirror that of what you've set in your [site configuration][config], the default of which is `public`. The following steps assume you are publishing from the `master` branch. -### Build with a Specific Hugo Version +## Configure Hugo Version in Netlify -Setting the build command to `hugo` will build your site according to the current default Hugo version used by Netlify. You can see the full list of [available Hugo versions in Netlify's Docker file][hugoversions]. - -If you want to tell Netlify to build with a specific version (hugo <= 0.20), you can append an underscore followed by the version number to the build command: - -``` -hugo_0.19 -``` - -Your simple configuration should now look similar to the following: - -![Screenshot of 3-step, basic continuous deployment setup with a new Hugo site on Netlify](/images/hosting-and-deployment/hosting-on-netlify/netlify-create-new-site-step-3.jpg) - -For version hugo > 0.20 you have to [specify version hugo for testing and production](https://www.netlify.com/blog/2017/04/11/netlify-plus-hugo-0.20-and-beyond/) in `netlify.toml` file or set `HUGO_VERSION` as a build environment variable in the Netlify console. +You can [set Hugo version](https://www.netlify.com/blog/2017/04/11/netlify-plus-hugo-0.20-and-beyond/) for your environments in `netlify.toml` file or set `HUGO_VERSION` as a build environment variable in the Netlify console. For production: ``` [context.production.environment] - HUGO_VERSION = "0.26" + HUGO_VERSION = "0.36" ``` For testing: ``` [context.deploy-preview.environment] - HUGO_VERSION = "0.26" -``` + HUGO_VERSION = "0.36" +``` + +The Netlify configuration file can be a little hard to understand and get right for the different environment, and you may get some inspiration and tips from this site's `netlify.toml`: -Selecting "Deploy site" will immediately take you to a terminal for your build:. +{{< code file="netlify.toml" nocode="true" >}} +{{< readfile file="netlify.toml" highlight="toml" >}} +{{< /code >}} + +## Build and Deploy Site + +In the Netlify console, selecting "Deploy site" will immediately take you to a terminal for your build:. ![Animated gif of deploying a site to Netlify, including the terminal read out for the build.](/images/hosting-and-deployment/hosting-on-netlify/netlify-deploying-site.gif) @@ -103,6 +99,8 @@ Once the build is finished---this should only take a few seconds--you should now Now every time you push changes to your hosted git repository, Netlify will rebuild and redeploy your site. +See [this blog post](https://www.netlify.com/blog/2017/04/11/netlify-plus-hugo-0.20-and-beyond/) for more details about how Netlify handles Hugo versions. + ## Use Hugo Themes with Netlify The [`git clone` method for installing themes][installthemes] is not supported by Netlify. If you were to use `git clone`, it would require you to recursively remove the `.git` subdirectory from the theme folder and would therefore prevent compatibility with future versions of the theme. diff --git a/content/maintenance/_index.md b/content/maintenance/_index.md new file mode 100644 index 00000000..691a5d47 --- /dev/null +++ b/content/maintenance/_index.md @@ -0,0 +1,14 @@ +--- +title: Maintenance +description: Some lists useful for the maintenance of the Hugo docs site. +date: 2018-02-09 +categories: [maintenance] +keywords: [maintenance] +menu: + docs: + weight: 200 +slug: +aliases: [] +toc: true +--- + diff --git a/content/news/0.36.1-relnotes-ready.md b/content/news/0.36.1-relnotes-ready.md new file mode 100644 index 00000000..0e94f20e --- /dev/null +++ b/content/news/0.36.1-relnotes-ready.md @@ -0,0 +1,44 @@ + +--- +date: 2018-02-15 +title: "Hugo 0.36.1: One Bugfix" +description: "Fixes a multi-thread image processing issue." +slug: "0.36.1-relnotes" +categories: ["Releases"] +images: +- images/blog/hugo-bug-poster.png + +--- + This release fixes a multi-thread issue when reprocessing and reusing images across pages. When doing something like this with the same image from a partial used in, say, both the home page and the single page: + +```bash +{{ with $img }} +{{ $big := .Fill "1024x512 top" }} +{{ $small := $big.Resize "512x" }} +{{ end }} +``` + +There would be timing issues making Hugo in some cases trying to process the same image twice at the same time. + +You would experience errors of type: + +```bash +png: invalid format: not enough pixel data +``` + +This commit fixes that by adding a mutex per image. This should also improve the performance, sligthly, as it avoids duplicate work. + +The current workaround before this fix is to always operate on the original: + +```bash +{{ with $img }} +{{ $big := .Fill "1024x512 top" }} +{{ $small := .Fill "512x256 top" }} +{{ end }} +``` +This error was rare (no reports on GitHub or the discussion forum), but very hard to debug for the end user. + +* Fix multi-threaded image processing issue [d8fdffb5](https://github.com/gohugoio/hugo/commit/d8fdffb55268464d54558d6f9cd3874b612dc7c7) [@bep](https://github.com/bep) [#4404](https://github.com/gohugoio/hugo/issues/4404) +* Improve error message in .Render [08521dac](https://github.com/gohugoio/hugo/commit/08521dac8323403933a8fd11acfd16930af5f17d) [@bep](https://github.com/bep) +* Bump Travis/Snapcraft to Go 1.9.4 [fc23a80f](https://github.com/gohugoio/hugo/commit/fc23a80ffd3878b9ba9a160ce37e0e1d8703faf3) [@bep](https://github.com/bep) +* Improve error processing error message [2851af02](https://github.com/gohugoio/hugo/commit/2851af0225cdf6c4e47058979cd22949ed6d1fc0) [@bep](https://github.com/bep) diff --git a/content/readfiles/index.md b/content/readfiles/index.md new file mode 100644 index 00000000..3d65eaa0 --- /dev/null +++ b/content/readfiles/index.md @@ -0,0 +1,3 @@ +--- +headless: true +--- \ No newline at end of file diff --git a/content/showcase/1password/bio.md b/content/showcase/1password/bio.md new file mode 100644 index 00000000..196b0c52 --- /dev/null +++ b/content/showcase/1password/bio.md @@ -0,0 +1,4 @@ + +**1Password** is a popular password manager. + +Their website is built with **Hugo**. \ No newline at end of file diff --git a/content/showcase/1password/featured.png b/content/showcase/1password/featured.png new file mode 100644 index 00000000..32d3c5fd Binary files /dev/null and b/content/showcase/1password/featured.png differ diff --git a/content/showcase/1password/index.md b/content/showcase/1password/index.md new file mode 100644 index 00000000..ba4c135f --- /dev/null +++ b/content/showcase/1password/index.md @@ -0,0 +1,15 @@ +--- + +title: 1password.com + +date: 2018-02-16 + +description: "Showcase: \"1Password is my favourite piece of boring software, and I was happy to see that they built their website with Hugo\"" + +siteURL: https://1password.com/ + +byline: "[bep](https://github.com/bep), Hugo Lead" + +--- + +**1Password** is my favourite piece of boring software. It just works. I was pleased to read that they use [Go](https://golang.org/) (aka Golang) extensively to build their software. This is also Hugo's platform. And I was also happy to see that they have **built their website with Hugo**. \ No newline at end of file diff --git a/content/showcase/hartwell-insurance/index.md b/content/showcase/hartwell-insurance/index.md index b291a640..3e9c224c 100644 --- a/content/showcase/hartwell-insurance/index.md +++ b/content/showcase/hartwell-insurance/index.md @@ -12,15 +12,15 @@ byline: "[Trys Mudford](http://www.trysmudford.com), Lead Developer, Tomango" --- -We’ve just launched a shiny new website for [Hartwell Insurance](https://www.hartwell-insurance.com/) – I’m really proud of it. It was tackled it in a different way to most previous Tomango site builds, using some fancy new tools and some vintage web standards. +We’ve just launched a shiny new website for [Hartwell Insurance](https://www.hartwell-insurance.com/) – I’m really proud of it. It was tackled in a different way to most previous Tomango site builds, using some fancy new tools and some vintage web standards. -It’s multi-page, single-page (!) website written in Hugo, a static site generator built with performance as a first-class feature. _I’ve outlined a load of benefits to Hugo & static sites [here](https://why-static.netlify.com/), in case you’re interested._ +It’s a multi-page, single-page (!) website written in Hugo, a static site generator built with performance as a first-class feature. _I’ve outlined a load of benefits to Hugo & static sites [here](https://why-static.netlify.com/), in case you’re interested._ > **In essence, a static site generator pre-renders the whole site into HTML files and serves them like it’s 1995.** There’s no Apache or Node backend that does compilation at runtime, it’s all done at the build step. This means the server; Netlify in this case, only has to do one thing – serve files. Unsurprisingly, serving simple files is VERY quick. -The starter point was the [victor-hugo](https://github.com/netlify/victor-hugo) repository that Netlify have created. It let me dive in with Hugo, PostCSS, BrowserSync and ES6 without setting up any tooling myself – always a win! +The starter point was the [Victor Hugo](https://github.com/netlify/victor-hugo) repository that Netlify have created. It let me dive in with Hugo, PostCSS, BrowserSync and ES6 without setting up any tooling myself – always a win! I then took all the content from the design file and moved it into Markdown, putting shortcodes in where necessary. This site did need a number of custom shortcodes for the presentational elements like the expanding circles and full width backgrounds. But mostly it was just clean, semantic HTML with some CSS and JS enhancement thrown in. diff --git a/content/showcase/linode/bio.md b/content/showcase/linode/bio.md new file mode 100644 index 00000000..42fa9222 --- /dev/null +++ b/content/showcase/linode/bio.md @@ -0,0 +1,4 @@ + +**Linode** is a cloud hosting provider that offers high performance SSD Linux servers for your infrastructure needs. + +**Hugo** offers the documentation team incredible performance as we scale and continue providing quality Linux tutorials. diff --git a/content/showcase/linode/featured.png b/content/showcase/linode/featured.png new file mode 100644 index 00000000..5d4c3e36 Binary files /dev/null and b/content/showcase/linode/featured.png differ diff --git a/content/showcase/linode/index.md b/content/showcase/linode/index.md new file mode 100644 index 00000000..b0590a8c --- /dev/null +++ b/content/showcase/linode/index.md @@ -0,0 +1,21 @@ +--- + +title: Linode Docs + +date: 2018-02-12 + +description: "Showcase: \"Hugo allows us to build thousands of pages in seconds.\"" + +siteURL: https://linode.com/docs/ + +siteSource: https://github.com/linode/docs + +--- + +The documentation team at Linode has been writing guides since 2009, with the goal of helping new and experienced Linux users find the best tools and get the most out of their systems. + +As our library grew into thousands of guides, we needed a fast static site generator with intuitive templating and the flexibility to extend Markdown without constantly writing HTML and CSS. + +Hugo solved a lot of our growing pains with features like shortcodes, customizable URLs, LiveReload, and more. We have already brought our site build time down from minutes to just a few seconds, and we are excited to see what future developments in Hugo will bring. + +Thank you to all the [Hugo contributors](https://github.com/gohugoio/hugo/graphs/contributors) and especially [@bep](https://github.com/bep) for helping us with the adoption of Hugo. diff --git a/content/showcase/quiply-employee-communications-app/bio.md b/content/showcase/quiply-employee-communications-app/bio.md new file mode 100644 index 00000000..f72a6255 --- /dev/null +++ b/content/showcase/quiply-employee-communications-app/bio.md @@ -0,0 +1,4 @@ +**Quiply** is an employee communications app enabling mobile collaboration across an entire organization. +Our customers get their own branded app enabling them to communicate fast and effectively with all employees, also non-desk and shift workers. + +As the Quiply app's build process is based on **Gulp**, we have started to build our company and product website using **Gulp + Hugo** which is super-fast and gives us exactly the flexibility we need. diff --git a/content/showcase/quiply-employee-communications-app/featured.png b/content/showcase/quiply-employee-communications-app/featured.png new file mode 100644 index 00000000..a4e9f046 Binary files /dev/null and b/content/showcase/quiply-employee-communications-app/featured.png differ diff --git a/content/showcase/quiply-employee-communications-app/index.md b/content/showcase/quiply-employee-communications-app/index.md new file mode 100644 index 00000000..9f80850e --- /dev/null +++ b/content/showcase/quiply-employee-communications-app/index.md @@ -0,0 +1,29 @@ +--- + +# A suitable title for this article. +title: Quiply Employee Communications App + +# Set this to the current date. +date: 2018-02-13 + +description: "\"It became immediately clear that we'd use Hugo going forward as it compiles super-fast, is intuitive to use and offers all the features we need.\"" + +# The URL to the site on the internet. +siteURL: https://www.quiply.com + +# Link to the site's Hugo source code if public and you can/want to share. +# Remove or leave blank if not needed/wanted. +# siteSource: https://github.com/gohugoio/hugoDocs + +# Add credit to the article author. Leave blank or remove if not needed/wanted. +byline: "[Sebastian Schirmer](mailto:sebastian.schirmer@quiply.com), Quiply Co-Founder" + +--- + +With the launch of our Employee Communications app Quiply we created a very simple and static one-page website to showcase our product. + +As our customer base and demand for marketing and communication started to grow, we needed a solution to easily grow and extend the contents of our web presence. As we do not have the need to serve dynamic content, we decided to use a static site generator. Amongst a couple of others, we tried Hugo and it became immediately clear that we'd use Hugo going forward as it compiles super-fast, is intuitive to use and offers all the features we need. + +Our website which we launched a couple of weeks ago is still growing and new content is being added constantly. By using Hugo, this can be easily done by content authors writing markdown files without always having to touch HTML or CSS code. It is available in German only for the time being, an English version is in the works. + +Huge thanks to everyone involved in making Hugo a success. diff --git a/content/showcase/stackimpact/bio.md b/content/showcase/stackimpact/bio.md new file mode 100644 index 00000000..e6206dd0 --- /dev/null +++ b/content/showcase/stackimpact/bio.md @@ -0,0 +1,4 @@ + +**StackImpact** is a production-grade performance profiler for production and development environments. + +The [stackimpact.com](https://stackimpact.com/) website is built with awesome Hugo. Grunt is used for CSS minification and bundling. \ No newline at end of file diff --git a/content/showcase/stackimpact/featured.png b/content/showcase/stackimpact/featured.png new file mode 100644 index 00000000..49a3bc50 Binary files /dev/null and b/content/showcase/stackimpact/featured.png differ diff --git a/content/showcase/stackimpact/index.md b/content/showcase/stackimpact/index.md new file mode 100644 index 00000000..bc3d3fd2 --- /dev/null +++ b/content/showcase/stackimpact/index.md @@ -0,0 +1,21 @@ +--- + +title: StackImpact + +date: 2018-02-20 + +description: "\"Hugo is a perfect choice for a product website.\"" + +siteURL: https://stackimpact.com/ + +--- + +After gradually handing over the control of our website to WordPress plugins, we realized that we needed to act. + +Static web sites have natural advantages such as security, performance and content versioning (e.g. with Git). Static site generators such as Hugo made static websites cool again. Importantly, the best practices of software development (e.g. peer reviews, multi-stage deployments, rollbacks) can now be easily applied to websites. + +Besides the blog and documentation sections, our website needed custom sections with own templates. Hugo supported it beautifully. + +Hugo is written in Go language and uses Go templates. StackImpact is a performance profiler that has an advanced support for Go applications. Being aware of the advantages of Go in terms of speed and productivity, this was another strong reason for choosing Hugo. + +Thanks to all Hugo contributors for making such a beautiful and fast site generator! diff --git a/content/templates/shortcode-templates.md b/content/templates/shortcode-templates.md index de159428..08f1b4c8 100644 --- a/content/templates/shortcode-templates.md +++ b/content/templates/shortcode-templates.md @@ -218,7 +218,7 @@ You have created the shortcode at `/layouts/shortcodes/img.html`, which loads th Would be rendered as: {{< code file="img-output.html" copy="false" >}} -
+

Steve Francia

diff --git a/content/troubleshooting/_index.md b/content/troubleshooting/_index.md index 8900d78e..3b0e9372 100644 --- a/content/troubleshooting/_index.md +++ b/content/troubleshooting/_index.md @@ -8,8 +8,8 @@ lastmod: 2017-02-01 menu: docs: parent: "troubleshooting" - weight: 01 -weight: 01 #rem + weight: 1 +weight: 1 draft: false hidesectioncontents: false slug: diff --git a/content/troubleshooting/accented-characters-in-urls.md b/content/troubleshooting/accented-characters-in-urls.md deleted file mode 100644 index 4fd6841f..00000000 --- a/content/troubleshooting/accented-characters-in-urls.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: Accented Characters in URLs -linktitle: Accented Characters in URLs -description: If you're having trouble with special characters in your taxonomies or titles adding odd characters to your URLs. -date: 2017-02-01 -publishdate: 2017-02-01 -lastmod: 2017-02-01 -keywords: [urls,multilingual,special characters] -categories: [troubleshooting] -menu: - docs: - parent: "troubleshooting" -weight: -draft: false -slug: -aliases: [/troubleshooting/categories-with-accented-characters/] -toc: true ---- - -## Trouble: Categories with accented characters - -> One of my categories is named "Le-carré," but the link ends up being generated like this: -> -> ``` -> categories/le-carr%C3%A9 -> ``` -> -> And not working. Is there an easy fix for this that I'm overlooking? - -## Solution - -Are you a macOS user? If so, you are likely a victim of HFS Plus file system's insistence to store the "é" (U+00E9) character in Normal Form Decomposed (NFD) mode, i.e. as "e" + " ́" (U+0065 U+0301). - -`le-carr%C3%A9` is actually correct, `%C3%A9` being the UTF-8 version of U+00E9 as expected by the web server. The problem is that OS X turns [U+00E9] into [U+0065 U+0301], and thus `le-carr%C3%A9` no longer works. Instead, only `le-carre%CC%81` ending with `e%CC%81` would match that [U+0065 U+0301] at the end. - -This is unique to OS X. The rest of the world does not do this, and most certainly not your web server which is most likely running Linux. This is not a Hugo-specific problem either. Other people have been bitten by this when they have accented characters in their HTML files. - -Note that this problem is not specific to Latin scripts. Japanese Mac users often run into the same issue; e.g., with `だ` decomposing into `た` and `゙`. (Read the [Japanese Perl users article][]). - -Rsync 3.x to the rescue! From [an answer posted on Server Fault][]: - -> You can use rsync's `--iconv` option to convert between UTF-8 NFC & NFD, at least if you're on a Mac. There is a special `utf-8-mac` character set that stands for UTF-8 NFD. So to copy files from your Mac to your web server, you'd need to run something like: -> -> `rsync -a --iconv=utf-8-mac,utf-8 localdir/ mywebserver:remotedir/` -> -> This will convert all the local filenames from UTF-8 NFD to UTF-8 NFC on the remote server. The files' contents won't be affected. - [Server Fault][] - -Please make sure you have the latest version of rsync 3.x installed. The rsync that ships with OS X is outdated. Even the version that comes packaged with 10.10 (Yosemite) is version 2.6.9 protocol version 29. The `--iconv` flag is new in rsync 3.x. - -### Discussion Forum References - -* http://discourse.gohugo.io/t/categories-with-accented-characters/505 -* http://wiki.apache.org/subversion/NonNormalizingUnicodeCompositionAwareness -* https://en.wikipedia.org/wiki/Unicode_equivalence#Example -* http://zaiste.net/2012/07/brand_new_rsync_for_osx/ -* https://gogo244.wordpress.com/2014/09/17/drived-me-crazy-convert-utf-8-mac-to-utf-8/ - -[an Answer posted on Server Fault]: http://serverfault.com/questions/397420/converting-utf-8-nfd-filenames-to-utf-8-nfc-in-either-rsync-or-afpd "Converting UTF-8 NFD filenames to UTF-8 NFC in either rsync or afpd, Server Fault Discussion" -[Japanese Perl users article]: http://perl-users.jp/articles/advent-calendar/2010/english/24 "Encode::UTF8Mac makes you happy while handling file names on MacOSX" -[Server Fault]: http://serverfault.com/questions/397420/converting-utf-8-nfd-filenames-to-utf-8-nfc-in-either-rsync-or-afpd "Converting UTF-8 NFD filenames to UTF-8 NFC in either rsync or afpd, Server Fault Discussion" diff --git a/content/troubleshooting/build-performance.md b/content/troubleshooting/build-performance.md index e4790d70..fa8929c7 100644 --- a/content/troubleshooting/build-performance.md +++ b/content/troubleshooting/build-performance.md @@ -10,7 +10,7 @@ categories: [troubleshooting] menu: docs: parent: "troubleshooting" -weight: +weight: 3 slug: aliases: [] toc: true diff --git a/content/troubleshooting/eof-error.md b/content/troubleshooting/eof-error.md deleted file mode 100644 index 12b7aada..00000000 --- a/content/troubleshooting/eof-error.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: EOF Error -linktitle: EOF Error -description: If you find yourself seeing an EOF error in the console whenever you create a new content file from Hugo's archetype feature. -date: 2017-02-01 -publishdate: 2017-02-01 -lastmod: 2017-02-01 -categories: [troubleshooting] -menu: - docs: - parent: "troubleshooting" -keywords: [eof, end of file, error, faqs] -draft: false -weight: -aliases: [/troubleshooting/strange-eof-error/] -toc: true ---- - -## Trouble: `hugo new` Aborts with EOF error - -> I'm running into an issue where I cannot get archetypes working, when running `hugo new showcase/test.md`, for example, I see an `EOF` error thrown by Hugo. -> -> When I run Hugo with v0.12 via `hugo new -v showcase/test.md`, I see the following output: -> -> ``` -> INFO: 2015/01/04 Using config file: /private/tmp/test/config.toml -> INFO: 2015/01/04 attempting to create showcase/test.md of showcase -> INFO: 2015/01/04 curpath: /private/tmp/test/archetypes/showcase.md -> ERROR: 2015/01/04 EOF -> ``` -> -> Is there something that I am blatantly missing? - -## Solution: Carriage Returns - -The solution is to add a final newline (i.e., `EOL`) to the end of your default.md archetype file of your theme. You can do this by adding a carriage return after the closing `+++` or `---` of your TOML or YAML front matter, respectively. - -{{% note "Final EOL Unnecessary in v0.13+" %}} -As of v0.13, Hugo's parser has been enhanced to accommodate archetype files without final EOL thanks to the great work by [@tatsushid](https://github.com/tatsushid). -{{% /note %}} - -## Discussion Forum References - -* http://discourse.gohugo.io/t/archetypes-not-properly-working-in-0-12/544 -* http://discourse.gohugo.io/t/eol-f-in-archetype-files/554 - -## Related Hugo Issues - -* https://github.com/gohugoio/hugo/issues/776 diff --git a/content/troubleshooting/faq.md b/content/troubleshooting/faq.md new file mode 100644 index 00000000..a66493cf --- /dev/null +++ b/content/troubleshooting/faq.md @@ -0,0 +1,37 @@ +--- +title: Frequently Asked Questions +linktitle: FAQ +description: Solutions to some common Hugo problems. +date: 2018-02-10 +categories: [troubleshooting] +menu: + docs: + parent: "troubleshooting" +keywords: [faqs] +weight: 2 +toc: true +aliases: [/faq/] +--- + +{{% note %}} +**Note:** The answers/solutions presented below are short, and may not be note be enough to solve your problem. Visit [Hugo Discourse](https://discourse.gohugo.io/) and use the search. It that does not help, start a new topic and ask your questions. +{{% /note %}} + +## How do I schedule posts? + +1. Set `publishDate` in the page [Front Matter](/content-management/front-matter/) to a date in the future. +2. Build and publish at intervals. + +How to automate the "publish at intervals" part depends on your situation: + +* If you deploy from your own PC/server, you can automate with [Cron](https://en.wikipedia.org/wiki/Cron) or similar. +* If your site is hosted on a service similar to [Netlify](https://www.netlify.com/) you can use a service such as [ifttt](https://ifttt.com/date_and_time) to schedule the updates. + +Also see this Twitter thread: + +{{< tweet 962380712027590657 >}} + +## Can I use the latest Hugo version on Netlify? + +Yes you can! Read [this](/hosting-and-deployment/hosting-on-netlify/#configure-hugo-version-in-netlify). + diff --git a/layouts/maintenance/list.html b/layouts/maintenance/list.html new file mode 100644 index 00000000..50059ad9 --- /dev/null +++ b/layouts/maintenance/list.html @@ -0,0 +1,36 @@ +{{ define "main" }} +
+
+
+ +
+
+ {{ $byLastMod := .Site.RegularPages.ByLastmod }} + {{ $recent := ($byLastMod | last 30).Reverse }} + {{ $leastRecent := $byLastMod | first 10 }} +

Last Updated

+ {{ partial "maintenance-pages-table" $recent }} +

Least Recently Updated

+ {{ partial "maintenance-pages-table" $leastRecent }} + + {{/* Don't think this is possible with where directly. Should investigate. */}} + {{ .Scratch.Set "todos" slice }} + {{ range .Site.RegularPages }} + {{ if .HasShortcode "todo" }} + {{ $.Scratch.Add "todos" . }} + {{ end }} + {{ end }} +

Pages marked with TODO

+ {{ partial "maintenance-pages-table" (.Scratch.Get "todos") }} + +
+
+
+{{ end }} \ No newline at end of file diff --git a/layouts/partials/maintenance-pages-table.html b/layouts/partials/maintenance-pages-table.html new file mode 100644 index 00000000..a29f0405 --- /dev/null +++ b/layouts/partials/maintenance-pages-table.html @@ -0,0 +1,24 @@ + + + + + + + + + + {{ range . }} + + + + + + {{ end }} + +
LastModLinkGitHub
{{ .Lastmod.Format "2006-01-02" }} + {{ .Title }} + + + {{ with .GitInfo }}{{ .Subject }}{{ else }}Source{{ end }} + +
\ No newline at end of file diff --git a/layouts/shortcodes/code.html b/layouts/shortcodes/code.html index f40cf071..4c12b0f2 100644 --- a/layouts/shortcodes/code.html +++ b/layouts/shortcodes/code.html @@ -11,7 +11,7 @@ {{/* Functionality located within filesaver.js The copy here is located in the css with .copy class so it can be replaced with JS on success */}} {{end}}
- {{ if $isHTML }}{{- highlight .Inner "html" "" | -}}{{ else }}
{{- .Inner | string -}}
{{ end }} + {{ if .Get "nocode" }}{{ .Inner }}{{ else }}{{ if $isHTML }}{{- highlight .Inner "html" "" | -}}{{ else }}
{{- .Inner | string -}}
{{ end }}{{ end }}
diff --git a/layouts/shortcodes/readfile.html b/layouts/shortcodes/readfile.html index f777abe2..36400ac5 100644 --- a/layouts/shortcodes/readfile.html +++ b/layouts/shortcodes/readfile.html @@ -1,6 +1,8 @@ {{$file := .Get "file"}} {{- if eq (.Get "markdown") "true" -}} {{- $file | readFile | markdownify -}} +{{- else if (.Get "highlight") -}} +{{- highlight ($file | readFile) (.Get "highlight") "" -}} {{- else -}} {{ $file | readFile | safeHTML }} {{- end -}} \ No newline at end of file diff --git a/netlify.toml b/netlify.toml index 7ecd9ebc..9badd702 100644 --- a/netlify.toml +++ b/netlify.toml @@ -3,7 +3,7 @@ publish = "public" command = "hugo" [context.production.environment] -HUGO_VERSION = "0.36" +HUGO_VERSION = "0.36.1" HUGO_ENV = "production" HUGO_ENABLEGITINFO = "true" @@ -11,13 +11,13 @@ HUGO_ENABLEGITINFO = "true" command = "hugo -b $DEPLOY_PRIME_URL" [context.deploy-preview.environment] -HUGO_VERSION = "0.36" +HUGO_VERSION = "0.36.1" [context.branch-deploy] command = "hugo -b $DEPLOY_PRIME_URL" [context.branch-deploy.environment] -HUGO_VERSION = "0.36" +HUGO_VERSION = "0.36.1" [context.next.environment] HUGO_ENABLEGITINFO = "true" diff --git a/resources/_gen/images/showcase/1password/featured_hu6362523fb09abcc0ff53ad78917489db_87218_1024x512_fill_catmullrom_top.png b/resources/_gen/images/showcase/1password/featured_hu6362523fb09abcc0ff53ad78917489db_87218_1024x512_fill_catmullrom_top.png new file mode 100644 index 00000000..18e58f75 Binary files /dev/null and b/resources/_gen/images/showcase/1password/featured_hu6362523fb09abcc0ff53ad78917489db_87218_1024x512_fill_catmullrom_top.png differ diff --git a/resources/_gen/images/showcase/1password/featured_hu6362523fb09abcc0ff53ad78917489db_87218_640x0_resize_catmullrom.png b/resources/_gen/images/showcase/1password/featured_hu6362523fb09abcc0ff53ad78917489db_87218_640x0_resize_catmullrom.png new file mode 100644 index 00000000..8a129e5e Binary files /dev/null and b/resources/_gen/images/showcase/1password/featured_hu6362523fb09abcc0ff53ad78917489db_87218_640x0_resize_catmullrom.png differ diff --git a/resources/_gen/images/showcase/1password/featured_hu6362523fb09abcc0ff53ad78917489db_87218_de2d346406f05cc9747f62253550350f.png b/resources/_gen/images/showcase/1password/featured_hu6362523fb09abcc0ff53ad78917489db_87218_de2d346406f05cc9747f62253550350f.png new file mode 100644 index 00000000..27c31cc9 Binary files /dev/null and b/resources/_gen/images/showcase/1password/featured_hu6362523fb09abcc0ff53ad78917489db_87218_de2d346406f05cc9747f62253550350f.png differ diff --git a/resources/_gen/images/showcase/linode/featured_hu6acc14b2375e47c4c764fef09fdb54c0_126664_1024x512_fill_catmullrom_top.png b/resources/_gen/images/showcase/linode/featured_hu6acc14b2375e47c4c764fef09fdb54c0_126664_1024x512_fill_catmullrom_top.png new file mode 100644 index 00000000..3f5b9440 Binary files /dev/null and b/resources/_gen/images/showcase/linode/featured_hu6acc14b2375e47c4c764fef09fdb54c0_126664_1024x512_fill_catmullrom_top.png differ diff --git a/resources/_gen/images/showcase/linode/featured_hu6acc14b2375e47c4c764fef09fdb54c0_126664_640x0_resize_catmullrom.png b/resources/_gen/images/showcase/linode/featured_hu6acc14b2375e47c4c764fef09fdb54c0_126664_640x0_resize_catmullrom.png new file mode 100644 index 00000000..b2d501ef Binary files /dev/null and b/resources/_gen/images/showcase/linode/featured_hu6acc14b2375e47c4c764fef09fdb54c0_126664_640x0_resize_catmullrom.png differ diff --git a/resources/_gen/images/showcase/linode/featured_hu6acc14b2375e47c4c764fef09fdb54c0_126664_7af7b624b13f6554ad54ee33f84bf08e.png b/resources/_gen/images/showcase/linode/featured_hu6acc14b2375e47c4c764fef09fdb54c0_126664_7af7b624b13f6554ad54ee33f84bf08e.png new file mode 100644 index 00000000..9f8b5a91 Binary files /dev/null and b/resources/_gen/images/showcase/linode/featured_hu6acc14b2375e47c4c764fef09fdb54c0_126664_7af7b624b13f6554ad54ee33f84bf08e.png differ diff --git a/resources/_gen/images/showcase/quiply-employee-communications-app/featured_hua0e0d1ed0f0bc15921e78476b0c86c95_631206_1024x512_fill_catmullrom_top.png b/resources/_gen/images/showcase/quiply-employee-communications-app/featured_hua0e0d1ed0f0bc15921e78476b0c86c95_631206_1024x512_fill_catmullrom_top.png new file mode 100644 index 00000000..4afe5049 Binary files /dev/null and b/resources/_gen/images/showcase/quiply-employee-communications-app/featured_hua0e0d1ed0f0bc15921e78476b0c86c95_631206_1024x512_fill_catmullrom_top.png differ diff --git a/resources/_gen/images/showcase/quiply-employee-communications-app/featured_hua0e0d1ed0f0bc15921e78476b0c86c95_631206_640x0_resize_catmullrom.png b/resources/_gen/images/showcase/quiply-employee-communications-app/featured_hua0e0d1ed0f0bc15921e78476b0c86c95_631206_640x0_resize_catmullrom.png new file mode 100644 index 00000000..d8c6222d Binary files /dev/null and b/resources/_gen/images/showcase/quiply-employee-communications-app/featured_hua0e0d1ed0f0bc15921e78476b0c86c95_631206_640x0_resize_catmullrom.png differ diff --git a/resources/_gen/images/showcase/quiply-employee-communications-app/featured_hua0e0d1ed0f0bc15921e78476b0c86c95_631206_9a216d034e8628dd139a6a7fa62712b4.png b/resources/_gen/images/showcase/quiply-employee-communications-app/featured_hua0e0d1ed0f0bc15921e78476b0c86c95_631206_9a216d034e8628dd139a6a7fa62712b4.png new file mode 100644 index 00000000..39b1ff1d Binary files /dev/null and b/resources/_gen/images/showcase/quiply-employee-communications-app/featured_hua0e0d1ed0f0bc15921e78476b0c86c95_631206_9a216d034e8628dd139a6a7fa62712b4.png differ diff --git a/themes/gohugoioTheme/layouts/_default/baseof.html b/themes/gohugoioTheme/layouts/_default/baseof.html index b7ad4f10..3a0a9f7f 100755 --- a/themes/gohugoioTheme/layouts/_default/baseof.html +++ b/themes/gohugoioTheme/layouts/_default/baseof.html @@ -34,7 +34,7 @@ {{- template "_internal/twitter_cards.html" . -}} {{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }} - {{ template "_internal/google_analytics_async.html" . }} + {{ partial "gtag" . }} {{ end }} diff --git a/themes/gohugoioTheme/layouts/index.html b/themes/gohugoioTheme/layouts/index.html index 9dcee424..2f9364c8 100644 --- a/themes/gohugoioTheme/layouts/index.html +++ b/themes/gohugoioTheme/layouts/index.html @@ -9,16 +9,16 @@ {{- partial "home-page-sections/features-icons" . -}} - {{- partial "home-page-sections/showcase.html" . -}} + {{ partial "home-page-sections/sponsors.html" (dict "cx" . "gtag" "home" ) }} {{- partial "home-page-sections/features-single" . -}} + {{- partial "home-page-sections/showcase.html" . -}} +
{{- partial "home-page-sections/installation" . -}}
- {{ partial "home-page-sections/sponsors.html" (dict "cx" . ) }} -
{{- partial "home-page-sections/tweets" . -}}
diff --git a/themes/gohugoioTheme/layouts/partials/gtag.html b/themes/gohugoioTheme/layouts/partials/gtag.html new file mode 100644 index 00000000..b89f2feb --- /dev/null +++ b/themes/gohugoioTheme/layouts/partials/gtag.html @@ -0,0 +1,26 @@ +{{ with .Site.GoogleAnalytics }} + + +{{ end }} \ No newline at end of file diff --git a/themes/gohugoioTheme/layouts/partials/home-page-sections/showcase.html b/themes/gohugoioTheme/layouts/partials/home-page-sections/showcase.html index 337fd2fc..774c10e0 100644 --- a/themes/gohugoioTheme/layouts/partials/home-page-sections/showcase.html +++ b/themes/gohugoioTheme/layouts/partials/home-page-sections/showcase.html @@ -4,18 +4,33 @@
- {{ range $p := first 10 (where .Site.RegularPages "Section" "showcase") }} - {{ $img := (.Resources.ByType "image").GetMatch "*featured*" }} + {{ $showcasePages := where .Site.RegularPages "Section" "showcase" }} + {{ template "home_showcase_item" (index $showcasePages 0) }} + {{ range $p := first 10 ($showcasePages | after 1 | shuffle) }} + {{template "home_showcase_item" $p }} + {{end}} +
+
+
+ {{/* END */}} +
{{/* using Flex to make the button show up on the right side */}} + See All +
+ + + +{{ define "home_showcase_item" }} + {{ $img := (.Resources.ByType "image").GetMatch "*featured*" }} {{ with $img }} {{ $big := .Fill "1024x512 top" }} {{ $small := $big.Resize "512x" }} - - {{with $p.Title}} + {{with $.Title}} - - {{/* END */}} -
{{/* using Flex to make the button show up on the right side */}} - See All -
- \ No newline at end of file +{{ end }} \ No newline at end of file diff --git a/themes/gohugoioTheme/layouts/partials/home-page-sections/sponsors.html b/themes/gohugoioTheme/layouts/partials/home-page-sections/sponsors.html index 4d32fc5d..95f7ecfd 100644 --- a/themes/gohugoioTheme/layouts/partials/home-page-sections/sponsors.html +++ b/themes/gohugoioTheme/layouts/partials/home-page-sections/sponsors.html @@ -1,14 +1,22 @@ {{$classes_box := "ba b--light-gray bg-light-gray br3 flex flex-column flex-wrap items-center justify-center ph3 pv4 mb4 w-100 w-30-l "}} +{{$gtag := .gtag | default "unknown" }} {{ with .cx.Site.Data.sponsors }} -
+
  Hugo Sponsors
{{ range .banners }} + {{ $banner := . }} {{if .logo}}
{{with .link -}} - + {{ $url := printf "%s?%s" . (querify "utm_source" "homepage" "utm_medium" "banner" "utm_campaign" "hugosponsor") | safeURL }} + {{ if eq (getenv "HUGO_ENV") "production" | or (eq $.cx.Site.Params.env "production") }} + {{ $gtagID := printf "Sponsor %s %s" $banner.name $gtag | title }} + + {{ else }} + + {{ end }} {{- end}} Logo for {{ .name }} {{with .link}}{{end}} diff --git a/themes/gohugoioTheme/layouts/partials/site-footer.html b/themes/gohugoioTheme/layouts/partials/site-footer.html index ef32025e..771ec348 100755 --- a/themes/gohugoioTheme/layouts/partials/site-footer.html +++ b/themes/gohugoioTheme/layouts/partials/site-footer.html @@ -29,7 +29,7 @@
  - {{ partial "home-page-sections/sponsors.html" (dict "cx" . "classes_section" "pb3 w-100" "classes_copy" "f7 w-90-ns") }} + {{ partial "home-page-sections/sponsors.html" (dict "cx" . "gtag" "footer" "classes_section" "pb3 w-100" "classes_copy" "f7 w-90-ns") }}
diff --git a/themes/gohugoioTheme/layouts/showcase/list.html b/themes/gohugoioTheme/layouts/showcase/list.html index 89565f34..b0083fc0 100644 --- a/themes/gohugoioTheme/layouts/showcase/list.html +++ b/themes/gohugoioTheme/layouts/showcase/list.html @@ -9,7 +9,7 @@
- {{ range (.Paginator 20).Pages }} + {{ range (.Paginate (.Pages | shuffle ) 20).Pages }} {{template "showcase_items" .}} {{ end }}
diff --git a/themes/gohugoioTheme/layouts/showcase/single.html b/themes/gohugoioTheme/layouts/showcase/single.html index c396f7b0..0d92c4cd 100644 --- a/themes/gohugoioTheme/layouts/showcase/single.html +++ b/themes/gohugoioTheme/layouts/showcase/single.html @@ -9,15 +9,15 @@ Showcase: {{ .Title }}
- {{template "details" .}} + {{template "sc-details" .}}
-
- {{template "main-column" .}} +
+ {{template "sc-main-column" .}}
@@ -32,7 +32,7 @@ Showcase: {{ .Title }} -{{define "main-column"}} +{{define "sc-main-column"}} {{ $img := (.Resources.ByType "image").GetMatch "*featured*" }} {{ with $img }} {{ $big := .Fill "1024x512 top" }} @@ -50,12 +50,12 @@ Showcase: {{ .Title }} {{end}} -{{define "details"}} -