You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**A Hugo boilerplate for creating truly epic websites**
3
+
This repository powers the <https://goc-spending.github.io/> website.
4
4
5
-
This is a boilerplate for using [Hugo](https://gohugo.io/) as a static site generator and [Webpack](https://webpack.js.org/) as your asset pipeline.
6
-
7
-
Victor Hugo setup to use [PostCSS](http://postcss.org/) and [Babel](https://babeljs.io/) for CSS and JavaScript compiling/transpiling.
8
-
9
-
This project is released under the [MIT license](LICENSE). Please make sure you understand its implications and guarantees.
5
+
It's based on Netlify's [Victor Hugo](https://github.com/netlify-templates/victor-hugo) package, a boilerplate for using [Hugo](https://gohugo.io/) as a static site generator and [Webpack](https://webpack.js.org/) as an asset pipeline.
10
6
11
7
## Usage
12
8
13
-
### :exclamation:Prerequisites
9
+
### Prerequisites
14
10
15
11
You need to have the latest/LTS [node](https://nodejs.org/en/download/) and [npm](https://www.npmjs.com/get-npm) versions installed in order to use Victor Hugo.
16
12
@@ -22,7 +18,7 @@ npm install
22
18
23
19
This will take some time and will install all packages necessary to run Victor Hugo and its tasks.
24
20
25
-
### :construction_worker:Development
21
+
### Development
26
22
27
23
While developing your website, use:
28
24
@@ -38,7 +34,7 @@ npm run preview
38
34
39
35
Then visit http://localhost:3000/_- or a new browser windows popped-up already -_ to preview your new website. Webpack Dev Server will automatically reload the CSS or refresh the whole page, when stylesheets or content changes.
40
36
41
-
### :package:Static build
37
+
### Static build
42
38
43
39
To build a static version of the website inside the `/dist` folder, run:
44
40
@@ -54,63 +50,20 @@ npm run build:preview
54
50
55
51
See [package.json](package.json#L8) for all tasks.
56
52
57
-
## Structure
58
-
59
-
```
60
-
|--site // Everything in here will be built with hugo
61
-
| |--content // Pages and collections - ask if you need extra pages
62
-
| |--data // YAML data files with any data for use in examples
63
-
| |--layouts // This is where all templates go
64
-
| | |--partials // This is where includes live
65
-
| | |--index.html // The index page
66
-
| |--static // Files in here ends up in the public folder
67
-
|--src // Files that will pass through the asset pipeline
68
-
| |--css // Webpack will bundle imported css seperately
69
-
| |--index.js // index.js is the webpack entry for your css & js assets
70
-
```
71
-
72
-
## Basic Concepts
73
-
74
-
You can read more about Hugo's template language in their documentation here:
75
-
76
-
https://gohugo.io/templates/overview/
77
-
78
-
The most useful page there is the one about the available functions:
79
-
80
-
https://gohugo.io/templates/functions/
81
-
82
-
For assets that are completely static and don't need to go through the asset pipeline,
83
-
use the `site/static` folder. Images, font-files, etc, all go there.
53
+
### Deploying
84
54
85
-
Files in the static folder end up in the web root. So a file called `site/static/favicon.ico`
86
-
will end up being available as `/favicon.ico` and so on...
55
+
This version has been customized to deploy to a separate repo, using GitHub Pages.
87
56
88
-
The `src/index.js` file is the entrypoint for webpack and will be built to `/dist/main.js`
57
+
To deploy an updated version of the website, run:
89
58
90
-
You can use **ES6** and use both relative imports or import libraries from npm.
91
-
92
-
Any CSS file imported into the `index.js` will be run through Webpack, compiled with [PostCSS Next](http://cssnext.io/), and
93
-
minified to `/dist/[name].[hash:5].css`. Import statements will be resolved as part of the build.
94
-
95
-
## Environment variables
96
-
97
-
To separate the development and production _- aka build -_ stages, all gulp tasks run with a node environment variable named either `development` or `production`.
98
-
99
-
You can access the environment variable inside the theme files with `getenv "NODE_ENV"`. See the following example for a conditional statement:
100
-
101
-
{{ if eq (getenv "NODE_ENV") "development" }}You're in development!{{ end }}
102
-
103
-
All tasks starting with _build_ set the environment variable to `production` - the other will set it to `development`.
104
-
105
-
## Deploying to Netlify
106
-
107
-
- Push your clone to your own GitHub repository.
108
-
-[Create a new site on Netlify](https://app.netlify.com/start) and link the repository.
59
+
```bash
60
+
npm run deploy
61
+
```
109
62
110
-
Now Netlify will build and deploy your site whenever you push to git.
63
+
## About
111
64
112
-
You can also click this button:
65
+
This repository is part of a larger collection of tools to analyze and visualize Government of Canada contract spending.
113
66
114
-
[](https://app.netlify.com/start/deploy?repository=https://github.com/netlify/victor-hugo)
67
+
For more information, see the [main goc-spending repository](https://github.com/GoC-Spending/goc-spending).
115
68
116
-
## Enjoy!! 😸
69
+
This is a volunteer project and is not affiliated with the Government of Canada.
0 commit comments