From a01a053328ef149e72a0a4f0b339ac49f463a875 Mon Sep 17 00:00:00 2001 From: Ryan Watters Date: Thu, 2 Feb 2017 17:46:45 -0600 Subject: [PATCH] Add more content and styling --- config.toml | 2 +- content/_index.md | 2 + content/about-hugo/introduction-to-hugo.md | 58 ++---------------- content/about-hugo/why-i-built-hugo.md | 4 +- .../why-use-a-static-site-generator.md | 53 ++++++++++++++++ content/developer-tools/_index.md | 13 ++++ content/functions/_index.md | 2 +- content/getting-started/_index.md | 2 +- content/hosting-and-deployment/_index.md | 2 +- content/migrating-to-hugo/_index.md | 18 ++++++ content/news-and-articles/_index.md | 26 ++++---- content/site-showcase/_index.md | 26 ++++---- content/templates/_index.md | 4 +- content/themes/_index.md | 26 ++++---- content/troubleshooting/_index.md | 2 +- .../frequently-asked-questions.md | 14 +++++ content/variables-and-params/_index.md | 16 +++++ .../file-variables.md | 0 .../page-variables.md | 0 .../site-variables.md | 0 .../taxonomy-variables.md | 0 doc-concept-roadmap.md | 5 ++ themes/hugodocs/layouts/_default/section.html | 12 ++-- themes/hugodocs/layouts/_default/single.html | 1 + themes/hugodocs/layouts/index.html | 22 +++++++ .../layouts/partials/head/site-style.html | 4 +- .../layouts/partials/site-header.html | 9 ++- .../layouts/partials/site-navigation.html | 1 + .../layouts/partials/site-scripts.html | 2 + .../pipeline/js/scripts/toggle-navigation.js | 3 + themes/hugodocs/pipeline/scss/_variables.scss | 11 +++- themes/hugodocs/pipeline/scss/base/_base.scss | 6 ++ .../pipeline/scss/components/_buttons.scss | 23 +++++++ .../pipeline/scss/components/_lists.scss | 35 ++++++++--- .../pipeline/scss/layout/_site-content.scss | 30 ++++++--- .../pipeline/scss/layout/_site-header.scss | 12 +++- .../scss/layout/_site-navigation.scss | 19 +++++- .../pipeline/scss/pages/_homepage.scss | 50 +++++++++++++++ themes/hugodocs/pipeline/scss/style.scss | 3 +- themes/hugodocs/static/css/style.min.css | 2 +- .../oreilly-static-site-generators.pdf | Bin 0 -> 2890100 bytes .../images/{hugo.png => hugo-h-only.png} | Bin .../{hugo-logo.png => hugo-logo-wide.png} | Bin themes/hugodocs/static/js/script.min.js | 6 +- 44 files changed, 388 insertions(+), 138 deletions(-) create mode 100644 content/about-hugo/why-use-a-static-site-generator.md create mode 100644 content/developer-tools/_index.md create mode 100644 content/troubleshooting/frequently-asked-questions.md create mode 100644 content/variables-and-params/_index.md rename content/{variables => variables-and-params}/file-variables.md (100%) rename content/{variables => variables-and-params}/page-variables.md (100%) rename content/{variables => variables-and-params}/site-variables.md (100%) rename content/{variables => variables-and-params}/taxonomy-variables.md (100%) create mode 100644 doc-concept-roadmap.md create mode 100644 themes/hugodocs/pipeline/js/scripts/toggle-navigation.js create mode 100644 themes/hugodocs/pipeline/scss/pages/_homepage.scss create mode 100644 themes/hugodocs/static/documents/oreilly-static-site-generators.pdf rename themes/hugodocs/static/images/{hugo.png => hugo-h-only.png} (100%) rename themes/hugodocs/static/images/{hugo-logo.png => hugo-logo-wide.png} (100%) diff --git a/config.toml b/config.toml index 8cb29fa64..de835247f 100644 --- a/config.toml +++ b/config.toml @@ -81,7 +81,7 @@ watch = true # Set to true to include a CDN call to FontAwesome usefontawesome = true # Sets the order of site sections in the sidebar navigation - sitemenuitems = ["About Hugo", "Getting Started", "Using the Docs", "Community Discussion", "Managing Content", "Templates", "Functions", "Themes", "Hosting and Deployment", "Migrating to Hugo", "News and Articles", "Site Showcase", "Developer Tools", "Themes", "Troubleshooting"] + sitemenuitems = ["About Hugo", "Getting Started", "Managing Content", "Templates", "Functions", "Variables and Params", "Themes", "Hosting and Deployment", "Migrating to Hugo", "News and Articles", "Site Showcase", "Developer Tools", "Troubleshooting"] # MARKDOWN ## Configuration for BlackFriday markdown parser: https://github.com/russross/blackfriday [blackfriday] diff --git a/content/_index.md b/content/_index.md index 17513936f..69884252d 100644 --- a/content/_index.md +++ b/content/_index.md @@ -12,3 +12,5 @@ aliases: [] notes: --- +Here is some content for the homepage. + diff --git a/content/about-hugo/introduction-to-hugo.md b/content/about-hugo/introduction-to-hugo.md index a3181bb67..72b4e6bda 100644 --- a/content/about-hugo/introduction-to-hugo.md +++ b/content/about-hugo/introduction-to-hugo.md @@ -23,7 +23,7 @@ edited, Hugo is optimized for website viewing for the end users of your site and Sites built with Hugo are extremely fast and secure. Hugo sites can be hosted anywhere, including [Heroku][], [GoDaddy][], [DreamHost][], [GitHub Pages][], [Surge][], [Aerobatic][], [Firebase Hosting][], -[Google Cloud Storage][], [Amazon S3][], and [CloudFront][], and work well +[Google Cloud Storage][], [Amazon S3][], and [CloudFront][] and work well with CDNs. Hugo sites run without the need for a database or dependencies on expensive runtimes like Ruby, Python, or PHP. We think of Hugo as the ideal website creation tool. With nearly instant @@ -31,45 +31,15 @@ build times and the ability to rebuild whenever a change is made, Hugo provides a very fast feedback loop. This is essential when you are designing websites, but also very useful when creating content. -## Why a Static Site Generator? - -Website generators render content into HTML files. Most are "dynamic site generators." That means the HTTP server (ie, the program that communicates with your end user's browser) runs the generator to create a new HTML file every time an end user requests a page. - -Creating the page dynamically requires the HTTP server have enough memory and CPU to effectively run the generator around the clock. If not, your end user will wait in a queue for the page to be generated. - -To prevent unnecessary delays in delivering pages to end users, dynamic site generators programmed their systems to cache the HTML files. A cached page is a copy that is temporarily stored on the computer. Sending a cached copy is faster than generating a new page at the time of request because the majority of the work is already done. - -Hugo takes caching a step further. All HTML files are rendered on your -computer. You can review the files before you copy them to the computer -hosting the HTTP server. Since the HTML files aren't generated dynamically, -we say that Hugo is a "static site generator." - -Not running a web site generator on your HTTP server has many benefits. -The most noticeable is performance - HTTP servers are very good at -sending files. So good that you can effectively serve the same number -of pages with a fraction of the memory and CPU needed for a dynamic site. - -Hugo has two components to help you build and test your web site. The -one that you'll probably use most often is the built-in HTTP server. -When you run `hugo server`, Hugo renders all of your content into -HTML files and then runs an HTTP server on your computer so that you -can see what the pages look like. - -The second component is used when you're ready to publish your web -site to the computer running your website. Running Hugo without any -actions will rebuild your entire web site using the `baseURL` setting -from your site's configuration file. That's required to have your page -links work properly with most hosting companies. - -## How fast is Hugo? +## How Fast is Hugo? -## What does Hugo do? +## What Does Hugo Do? In technical terms, Hugo takes a source directory of files and templates and uses these as input to create a complete website. -## Who should use Hugo? +## Who Should Use Hugo? Hugo is for people that prefer writing in a text editor over a browser. @@ -79,28 +49,10 @@ worrying about setting up complicated runtimes, dependencies and databases. Hugo is for people building a blog, company site, portfolio, tumblog, -documentation, single page site or a site with thousands of +documentation, single-page website, or a website with thousands of pages. -## Why did you write Hugo? -I wrote Hugo ultimately for a few reasons. First, I was disappointed with -WordPress, my then website solution. With it, I couldn't create -content as efficiently as I wanted to. - -It rendered slowly and required me to be online to write posts. Plus, its constant security updates and the horror stories of people's hacked blogs! I hated how content was only written in HTML instead of the much simpler Markdown. Overall, I felt like WordPress hindered more than helped. It kept me from writing great content. - -I looked at existing static site generators like [Jekyll][], [Middleman][] and [Nanoc][]. All had complicated installation dependencies and an unacceptably long time to render my blog with hundreds of posts. I wanted a framework that would give me rapid feedback while making changes to the templates, and the 5-minute-plus render times were just too slow. In general, the static site generators were very blog-minded and didn't provide for other content types and flexible URLs. - -I wanted to develop a fast and full-featured website framework without any -dependencies. The [Go language][] seemed to have all the features I needed -in a language. I began developing Hugo in Go and fell in love with the -language. I hope you will enjoy using Hugo (and contributing to it) as much -as I have writing it. - -—Steve Francia ([@spf13][]) - -[@spf13]: https://twitter.com/spf13 [Aerobatic]: https://www.aerobatic.com/ [Amazon S3]: http://aws.amazon.com/s3/ [CloudFront]: http://aws.amazon.com/cloudfront/ "Amazon CloudFront" diff --git a/content/about-hugo/why-i-built-hugo.md b/content/about-hugo/why-i-built-hugo.md index 1aadd9390..44e0d677d 100644 --- a/content/about-hugo/why-i-built-hugo.md +++ b/content/about-hugo/why-i-built-hugo.md @@ -23,11 +23,13 @@ I looked at existing static site generators like [Jekyll][], [Middleman][], and I wanted to develop a fast and full-featured website framework without any dependencies. The [Go language][] seemed to have all the features I needed in a language. I began developing Hugo in Go and fell in love with the -language. I hope you will enjoy using Hugo (and contributing to it) as much +language. I hope you will enjoy using Hugo (and [contributing to it][]) as much as I have writing it. —Steve Francia ([@spf13][]) +[contributing to it]: https://github.com/spf13/hugo +[Go language]: https://golang.org/ [Jekyll]: https://jekyllrb.com/ [Middleman]: https://middlemanapp.com/ [Nanoc]: https://nanoc.ws/ diff --git a/content/about-hugo/why-use-a-static-site-generator.md b/content/about-hugo/why-use-a-static-site-generator.md new file mode 100644 index 000000000..b9733d022 --- /dev/null +++ b/content/about-hugo/why-use-a-static-site-generator.md @@ -0,0 +1,53 @@ +--- +title: Why Use a Static Site Generator? +linktitle: +description: +date: 2016-02-01 +publishdate: 2016-02-01 +lastmod: 2016-02-01 +weight: +draft: false +slug: +aliases: [] +notes: +--- + +Website generators render content into HTML files. Most are "dynamic site generators." That means the HTTP server (ie, the program that communicates with your end user's browser) runs the generator to create a new HTML file every time an end user requests a page. + +Creating the page dynamically requires the HTTP server have enough memory and CPU to effectively run the generator around the clock. If not, your end user will wait in a queue for the page to be generated. + +To prevent unnecessary delays in delivering pages to end users, dynamic site generators programmed their systems to cache the HTML files. A cached page is a copy that is temporarily stored on the computer. Sending a cached copy is faster than generating a new page at the time of request because the majority of the work is already done. + +Hugo takes caching a step further. All HTML files are rendered on your +computer. You can review the files before you copy them to the computer +hosting the HTTP server. Since the HTML files aren't generated dynamically, +we say that Hugo is a "static site generator." + +Not running a web site generator on your HTTP server has many benefits. +The most noticeable is performance - HTTP servers are very good at +sending files. So good that you can effectively serve the same number +of pages with a fraction of the memory and CPU needed for a dynamic site. + +Hugo has two components to help you build and test your web site. The +one that you'll probably use most often is the built-in HTTP server. +When you run `hugo server`, Hugo renders all of your content into +HTML files and then runs an HTTP server on your computer so that you +can see what the pages look like. + +The second component is used when you're ready to publish your web +site to the computer running your website. Running Hugo without any +actions will rebuild your entire web site using the `baseURL` setting +from your site's configuration file. That's required to have your page +links work properly with most hosting companies. + +## Further Reading + +* ["Static Site Generators", O-Reilly][] +* [StaticGen: Top Open-Source Static Site Generators][] +* ["Top 10 Static Website Generators," Netlify blog][] + + + +["Static Site Generators", O-Reilly]: /documents/oreilly-static-site-generators.pdf +["Top 10 Static Website Generators," Netlify blog]: https://www.netlify.com/blog/2016/05/02/top-ten-static-website-generators/ +[StaticGen: Top Open-Source Static Site Generators]: https://www.staticgen.com/ diff --git a/content/developer-tools/_index.md b/content/developer-tools/_index.md new file mode 100644 index 000000000..bbcd27efb --- /dev/null +++ b/content/developer-tools/_index.md @@ -0,0 +1,13 @@ +--- +title: Developer Tools +linktitle: +description: Description for the developer tools section. +date: 2016-11-01 +publishdate: 2016-11-01 +lastmod: 2016-11-01 +weight: 40 +draft: false +slug: +aliases: +notes: +--- \ No newline at end of file diff --git a/content/functions/_index.md b/content/functions/_index.md index dcea08453..72da78f27 100644 --- a/content/functions/_index.md +++ b/content/functions/_index.md @@ -1,7 +1,7 @@ --- title: Functions Quick Reference linktitle: Functions Quick Reference -description: Description for this page +description: Description for templating functions. date: 2017-01-09 publishdate: 2017-01-09 lastmod: 2017-01-09 diff --git a/content/getting-started/_index.md b/content/getting-started/_index.md index f96d19999..c96abbc00 100644 --- a/content/getting-started/_index.md +++ b/content/getting-started/_index.md @@ -1,7 +1,7 @@ --- title: Getting Started with Hugo linktitle: -description: +description: Description for the Getting Started section. date: 2017-02-01 publishdate: 2017-02-01 lastmod: 2017-02-01 diff --git a/content/hosting-and-deployment/_index.md b/content/hosting-and-deployment/_index.md index bef9f9f0b..a4c6f366a 100644 --- a/content/hosting-and-deployment/_index.md +++ b/content/hosting-and-deployment/_index.md @@ -1,7 +1,7 @@ --- title: Hosting and Deployment linktitle: -description: +description: Description for the Hosting and Deployment Section date: 2016-11-01 publishdate: 2016-11-01 lastmod: 2016-11-01 diff --git a/content/migrating-to-hugo/_index.md b/content/migrating-to-hugo/_index.md index e69de29bb..a9e197fd0 100644 --- a/content/migrating-to-hugo/_index.md +++ b/content/migrating-to-hugo/_index.md @@ -0,0 +1,18 @@ +--- +title: Migrating to Hugo +linktitle: +description: Tools and tutorials for migrating to Hugo from other platforms or generators (eg, Wordpress, Jekyll). +date: 2017-02-01 +publishdate: 2017-02-01 +lastmod: 2017-02-01 +tags: [] +categories: [] +weight: +draft: false +slug: +aliases: [] +notes: +--- + + + diff --git a/content/news-and-articles/_index.md b/content/news-and-articles/_index.md index c349e1874..1ea764b58 100644 --- a/content/news-and-articles/_index.md +++ b/content/news-and-articles/_index.md @@ -1,16 +1,18 @@ --- -aliases: [] -date: 2016-12-26T06:43:58-06:00 -description: null +title: News and Articles +linktitle: +description: Articles where Hugo is featured, as well as news and updates on the project itself. +date: 2017-02-01 +publishdate: 2017-02-01 +lastmod: 2017-02-01 +tags: [] +categories: [] +weight: draft: false -lastmod: 2017-01-01 -linktitle: null -notes: null -publishdate: 2017-01-01 -qr_description: null -qr_returns: null -slug: null -title: _index -weight: 1 +slug: +aliases: [] +notes: --- + + diff --git a/content/site-showcase/_index.md b/content/site-showcase/_index.md index 8ef2e7279..dfb02d872 100644 --- a/content/site-showcase/_index.md +++ b/content/site-showcase/_index.md @@ -1,16 +1,18 @@ --- -aliases: [] -date: 2016-12-26T06:45:18-06:00 -description: null -draft: false -lastmod: 2017-01-01 -linktitle: All Sites -notes: null -publishdate: 2017-01-01 -qr_description: null -qr_returns: null -slug: null title: Site Showcase -weight: 1 +linktitle: +description: A collection of sites built using Hugo. +date: 2017-02-01 +publishdate: 2017-02-01 +lastmod: 2017-02-01 +tags: [] +categories: [] +weight: +draft: false +slug: +aliases: [] +notes: --- + + diff --git a/content/templates/_index.md b/content/templates/_index.md index ce3b43c64..bb1e47a01 100644 --- a/content/templates/_index.md +++ b/content/templates/_index.md @@ -1,7 +1,7 @@ --- -title: Templating Introduction +title: Introduction to Hugo Templating linktitle: -description: +description: Description of the template section and its contents. date: 2017-02-01 publishdate: 2017-02-01 lastmod: 2017-02-01 diff --git a/content/themes/_index.md b/content/themes/_index.md index b3c548a58..bc1d5c0d4 100644 --- a/content/themes/_index.md +++ b/content/themes/_index.md @@ -1,16 +1,14 @@ --- -aliases: [] -date: 2016-12-26T06:46:10-06:00 -description: null +title: Introduction to Themes +linktitle: +description: Description of the theming section and its contents. +date: 2017-02-01 +publishdate: 2017-02-01 +lastmod: 2017-02-01 +weight: +tags: [] draft: false -lastmod: 2017-01-01 -linktitle: null -notes: null -publishdate: 2017-01-01 -qr_description: null -qr_returns: null -slug: null -title: _index -weight: 1 ---- - +slug: +aliases: +notes: +--- \ No newline at end of file diff --git a/content/troubleshooting/_index.md b/content/troubleshooting/_index.md index 4758306df..8e7c9c9d6 100644 --- a/content/troubleshooting/_index.md +++ b/content/troubleshooting/_index.md @@ -1,7 +1,7 @@ --- title: Troubleshooting linktitle: -description: +description: Description for *troubleshooting* section. date: 2016-11-01 publishdate: 2016-11-01 lastmod: 2016-11-01 diff --git a/content/troubleshooting/frequently-asked-questions.md b/content/troubleshooting/frequently-asked-questions.md new file mode 100644 index 000000000..efa12cdff --- /dev/null +++ b/content/troubleshooting/frequently-asked-questions.md @@ -0,0 +1,14 @@ +--- +title: Frequently Asked Questions +linktitle: +description: Description for *troubleshooting* section. +date: 2017-02-01 +publishdate: 2017-02-01 +lastmod: 2017-02-01 +weight: +draft: false +slug: +aliases: [/troubleshooting/faqs] +notes: +--- + diff --git a/content/variables-and-params/_index.md b/content/variables-and-params/_index.md new file mode 100644 index 000000000..4f91a2a9b --- /dev/null +++ b/content/variables-and-params/_index.md @@ -0,0 +1,16 @@ +--- +title: Introduction +linktitle: +description: Description for the variables and parameters section of the site. +date: 2017-02-01 +publishdate: 2017-02-01 +lastmod: 2017-02-01 +weight: +draft: false +slug: +aliases: [] +notes: +--- + +Here is some content for the homepage. + diff --git a/content/variables/file-variables.md b/content/variables-and-params/file-variables.md similarity index 100% rename from content/variables/file-variables.md rename to content/variables-and-params/file-variables.md diff --git a/content/variables/page-variables.md b/content/variables-and-params/page-variables.md similarity index 100% rename from content/variables/page-variables.md rename to content/variables-and-params/page-variables.md diff --git a/content/variables/site-variables.md b/content/variables-and-params/site-variables.md similarity index 100% rename from content/variables/site-variables.md rename to content/variables-and-params/site-variables.md diff --git a/content/variables/taxonomy-variables.md b/content/variables-and-params/taxonomy-variables.md similarity index 100% rename from content/variables/taxonomy-variables.md rename to content/variables-and-params/taxonomy-variables.md diff --git a/doc-concept-roadmap.md b/doc-concept-roadmap.md new file mode 100644 index 000000000..e9ccf0add --- /dev/null +++ b/doc-concept-roadmap.md @@ -0,0 +1,5 @@ +## Hugo Docs Concept Roadmap + +- [ ] Addition of Algolia search +- [ ] "Documentation" channel on Hugo discourse +- [ ] GH Wiki for more extensive contribution guidelines \ No newline at end of file diff --git a/themes/hugodocs/layouts/_default/section.html b/themes/hugodocs/layouts/_default/section.html index a7275a662..12cd821f0 100644 --- a/themes/hugodocs/layouts/_default/section.html +++ b/themes/hugodocs/layouts/_default/section.html @@ -1,9 +1,11 @@ {{ define "main" }}
- +
+

{{with .LinkTitle}}{{ . |markdownify}}{{else}}{{ .Title }}{{end}}

+
+
+ {{.Content}} + Updated {{with .Lastmod}}{{.Format "January 2, 2006"}}{{else}}{{.PublishDate.Format "January 2, 2006"}}{{end}} +
{{ end }} \ No newline at end of file diff --git a/themes/hugodocs/layouts/_default/single.html b/themes/hugodocs/layouts/_default/single.html index f10a53397..ca69d8221 100644 --- a/themes/hugodocs/layouts/_default/single.html +++ b/themes/hugodocs/layouts/_default/single.html @@ -5,6 +5,7 @@
{{.Content}} + Last Updated: {{with .Lastmod}}{{.Format "January 2, 2006"}}{{else}}{{.PublishDate.Format "January 2, 2006"}}{{end}}
{{ end }} \ No newline at end of file diff --git a/themes/hugodocs/layouts/index.html b/themes/hugodocs/layouts/index.html index b114c160e..21a4b8f64 100644 --- a/themes/hugodocs/layouts/index.html +++ b/themes/hugodocs/layouts/index.html @@ -1,5 +1,27 @@ {{ define "main" }}
+
+ +
+
+ {{range $section,$content := .Site.Sections}} + {{end}} +
+
+ {{range .Site.Params.sitemenuitems }} + {{$sectionurl := . | urlize}} + +
+
+

{{.}}

+
+
+

{{ with $.Site.GetPage "section" $sectionurl }}{{ .Description | markdownify }}{{ end }}

+
+
+
+ {{end}} +
{{ end }} \ No newline at end of file diff --git a/themes/hugodocs/layouts/partials/head/site-style.html b/themes/hugodocs/layouts/partials/head/site-style.html index 9a0513b0c..50e0a8571 100644 --- a/themes/hugodocs/layouts/partials/head/site-style.html +++ b/themes/hugodocs/layouts/partials/head/site-style.html @@ -1,4 +1,2 @@ -{{if .Site.Params.usefontawesome}} - -{{end}} \ No newline at end of file + \ No newline at end of file diff --git a/themes/hugodocs/layouts/partials/site-header.html b/themes/hugodocs/layouts/partials/site-header.html index ff2aca688..bf0c200da 100644 --- a/themes/hugodocs/layouts/partials/site-header.html +++ b/themes/hugodocs/layouts/partials/site-header.html @@ -1,10 +1,13 @@ \ No newline at end of file diff --git a/themes/hugodocs/layouts/partials/site-navigation.html b/themes/hugodocs/layouts/partials/site-navigation.html index 8d03ba4ea..b0a7ae51f 100644 --- a/themes/hugodocs/layouts/partials/site-navigation.html +++ b/themes/hugodocs/layouts/partials/site-navigation.html @@ -1,3 +1,4 @@ + Menu