User Tools

Site Tools


hugo

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

hugo [2019/12/04 07:41]
210.18.207.205 created
hugo [2019/12/04 07:51] (current)
210.18.207.205
Line 25: Line 25:
 ===== Creating the website ===== ===== Creating the website =====
  
-Copy the ''​hugo.exe''​ file to some folder where you want to create a site. I'​m ​this example, I'll copy ''​hugo.exe''​ to my ''​C:​\Work''​ folder.+Copy the ''​hugo.exe''​ file to some folder where you want to create a site. In this example, I'll copy ''​hugo.exe''​ to my ''​C:​\Work''​ folder.
  
 Open a command windows and CD your way to ''​C:​\Work''​. Open a command windows and CD your way to ''​C:​\Work''​.
Line 107: Line 107:
  
 **theme.toml**:​ used to declare meta data about the theme, the author, license etc. **theme.toml**:​ used to declare meta data about the theme, the author, license etc.
 +
 **Archetypes**:​ not used in this tutorial. **Archetypes**:​ not used in this tutorial.
 +
 **Layouts**:​ very important. Contains the layout and look of your index page, other pages, lists, 404 pages. Both complete and partial pages are stored here like headers and footers. We'll make extensive of these. At the moment, these pages are blank and so our site is not yet ready to try. **Layouts**:​ very important. Contains the layout and look of your index page, other pages, lists, 404 pages. Both complete and partial pages are stored here like headers and footers. We'll make extensive of these. At the moment, these pages are blank and so our site is not yet ready to try.
 +
 **Static**: used to store your CSS, Javascript and images for your site. **Static**: used to store your CSS, Javascript and images for your site.
  
Line 164: Line 167:
 </​code>​ </​code>​
  
-Notice the ''​{{ .Content }}''​ tag? This is how Hugo knows to get the ''​_index.md''​ content and insert it into the body here.+Notice the ''​%%{{ .Content }}%%''​ tag? This is how Hugo knows to get the ''​_index.md''​ content and insert it into the body here.
  
 ===== First Test ===== ===== First Test =====
Line 306: Line 309:
 ===== Data Templates ===== ===== Data Templates =====
  
-A cool thing that Hugo can do is produce lists of data using [[Data Templates|https://​gohugo.io/​templates/​data-templates/​]]. There are many ways to provide data to Hugo, a local JSON, YAML or TOML file, or retrieving a file from the web.+A cool thing that Hugo can do is produce lists of data using [[https://​gohugo.io/​templates/​data-templates/​|Data Templates]]. There are many ways to provide data to Hugo, a local JSON, YAML or TOML file, or retrieving a file from the web.
  
 In this example, we'll create our own JSON data file, and use this to produce a list in a partial. And this partial will be placed in the index file. In this example, we'll create our own JSON data file, and use this to produce a list in a partial. And this partial will be placed in the index file.
Line 357: Line 360:
 If we place the partial into the ''​index.html''​ file, we are effectively placing a component into the page If we place the partial into the ''​index.html''​ file, we are effectively placing a component into the page
  
-Warning: Please note the "​."​ in ''​{{ partial "​echidna-list.html"​ . }}''​. This is important. Without passing the current scope "​."​ in, ''​echidna-list''​ has no knowledge of the data or variables. You'll get nothing. Nor will you get an error message. Ensure the dot (.) or troubleshooting will be very difficult.+Warning: Please note the "​."​ in ''​%%{{ partial "​echidna-list.html"​ . }}%%''​. This is important. Without passing the current scope "​."​ in, ''​echidna-list''​ has no knowledge of the data or variables. You'll get nothing. Nor will you get an error message. Ensure the dot (.) or troubleshooting will be very difficult.
  
 Note: Hugo is very fussy with the JSON formatting and thankfully if you make a mistake in your JSON file, Hugo will warn you. Note: Hugo is very fussy with the JSON formatting and thankfully if you make a mistake in your JSON file, Hugo will warn you.
hugo.txt ยท Last modified: 2019/12/04 07:51 by 210.18.207.205