├── .babelrc ├── .dependabot └── config.yml ├── .eslintrc.yml ├── .github ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .nvmrc ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── netlify.toml ├── package-lock.json ├── package.json ├── postcss.config.js ├── renovate.json ├── site ├── .hugo_build.lock ├── config.toml ├── content │ ├── .keep │ └── tech.md ├── data │ └── .keep ├── layouts │ ├── 404.html │ ├── _default │ │ ├── baseof.html │ │ └── single.html │ ├── index.html │ └── partials │ │ ├── footer.html │ │ └── header.html └── static │ └── .keep ├── src ├── css │ ├── imports │ │ └── reset.css │ └── main.css ├── fonts │ └── .keep └── index.js ├── webpack.common.js ├── webpack.dev.js └── webpack.prod.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "@babel/preset-env" 4 | ], 5 | "plugins": [ 6 | "@babel/plugin-syntax-object-rest-spread", 7 | "@babel/plugin-proposal-object-rest-spread" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /.dependabot/config.yml: -------------------------------------------------------------------------------- 1 | version: 1 2 | 3 | update_configs: 4 | - package_manager: javascript 5 | directory: / 6 | update_schedule: live 7 | allowed_updates: 8 | - match: 9 | update_type: security 10 | automerged_updates: 11 | - match: 12 | dependency_type: all 13 | update_type: in_range 14 | version_requirement_updates: widen_ranges -------------------------------------------------------------------------------- /.eslintrc.yml: -------------------------------------------------------------------------------- 1 | env: 2 | browser: true 3 | 4 | parser: babel-eslint 5 | 6 | parserOptions: 7 | ecmaVersion: 6 8 | 9 | plugins: [ "import" ] 10 | 11 | rules: 12 | # Possible Errors 13 | # https://github.com/eslint/eslint/tree/master/docs/rules#possible-errors 14 | no-control-regex: 2 15 | no-console: 1 16 | no-debugger: 2 17 | no-dupe-args: 2 18 | no-dupe-keys: 2 19 | no-duplicate-case: 2 20 | no-empty-character-class: 2 21 | no-ex-assign: 2 22 | no-extra-boolean-cast : 2 23 | no-extra-semi: 2 24 | no-invalid-regexp: 2 25 | no-irregular-whitespace: 1 26 | no-proto: 2 27 | no-unexpected-multiline: 2 28 | no-unreachable: 2 29 | valid-typeof: 2 30 | 31 | # Best Practices 32 | # https://github.com/eslint/eslint/tree/master/docs/rules#best-practices 33 | no-fallthrough: 2 34 | no-redeclare: 2 35 | 36 | # Stylistic Issues 37 | # https://github.com/eslint/eslint/tree/master/docs/rules#stylistic-issues 38 | comma-spacing: 2 39 | eol-last: 2 40 | eqeqeq: ["error", "smart"] 41 | indent: [2, 2, {SwitchCase: 1}] 42 | keyword-spacing: 2 43 | max-len: [1, 160, 2] 44 | new-parens: 2 45 | no-mixed-spaces-and-tabs: 2 46 | no-multiple-empty-lines: [2, {max: 2}] 47 | no-trailing-spaces: 2 48 | object-curly-spacing: [2, "never"] 49 | quotes: [2, "double", "avoid-escape"] 50 | semi: 2 51 | space-before-blocks: [2, "always"] 52 | space-before-function-paren: [2, "never"] 53 | space-in-parens: [2, "never"] 54 | space-infix-ops: 2 55 | space-unary-ops: 2 56 | 57 | # ECMAScript 6 58 | # http://eslint.org/docs/rules/#ecmascript-6 59 | arrow-parens: [2, "always"] 60 | arrow-spacing: [2, {"before": true, "after": true}] 61 | no-confusing-arrow: 2 62 | prefer-const: 2 63 | 64 | # JSX 65 | jsx-quotes: [2, "prefer-double"] 66 | 67 | # Import 68 | import/no-unresolved: [1, {"commonjs": true, "amd": true}] 69 | import/export: 2 70 | 71 | # Strict Mode 72 | # https://github.com/eslint/eslint/tree/master/docs/rules#strict-mode 73 | strict: [2, "global"] 74 | 75 | # Variables 76 | # https://github.com/eslint/eslint/tree/master/docs/rules#variables 77 | no-undef: 2 78 | no-unused-vars: [2, {"args": "none"}] 79 | 80 | # Global scoped method and vars 81 | globals: 82 | __dirname: true 83 | require: true 84 | process: true 85 | ENV: true 86 | module: true 87 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 18 | 19 | **- Do you want to request a *feature* or report a *bug*?** 20 | 21 | **- What is the current behavior?** 22 | 23 | **- If the current behavior is a bug, please provide the steps to reproduce.** 24 | 25 | **- What is the expected behavior?** 26 | 27 | **- Please mention your node.js, NPM, Hugo and operating system version.** 28 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 13 | 14 | **- Summary** 15 | 16 | 20 | 21 | **- Test plan** 22 | 23 | 27 | 28 | **- Description for the changelog** 29 | 30 | 34 | 35 | **- A picture of a cute animal (not mandatory but encouraged)** 36 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | dist/ 3 | site/data/webpack.json 4 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 16.13.1 -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, gender identity and expression, level of experience, 9 | nationality, personal appearance, race, religion, or sexual identity and 10 | orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at david@netlify.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at [http://contributor-covenant.org/version/1/4][version] 72 | 73 | [homepage]: http://contributor-covenant.org 74 | [version]: http://contributor-covenant.org/version/1/4/ 75 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # CONTRIBUTING 2 | 3 | Contributions are always welcome, no matter how large or small. Before contributing, 4 | please read the [code of conduct](CODE_OF_CONDUCT.md). 5 | 6 | ## Setup 7 | 8 | ```sh 9 | $ git clone https://github.com/netlify/victor-hugo 10 | $ cd victor-hugo 11 | $ npm install 12 | ``` 13 | 14 | ## Building 15 | 16 | ```sh 17 | $ npm run build 18 | ``` 19 | 20 | ## Testing 21 | 22 | ```sh 23 | $ npm run test 24 | ``` 25 | 26 | ```sh 27 | $ npm run test:watch 28 | ``` 29 | 30 | ## Running the server 31 | 32 | ```sh 33 | $ npm run start 34 | ``` 35 | 36 | ## Pull Requests 37 | 38 | We actively welcome your pull requests. 39 | 40 | 1. Fork the repo and create your branch from `master`. 41 | 2. If you've added code that should be tested, add tests. 42 | 3. If you've changed APIs, update the documentation. 43 | 4. Ensure the test suite passes. 44 | 5. Make sure your code lints. 45 | 46 | ## License 47 | 48 | By contributing to Victor-Hugo, you agree that your contributions will be licensed 49 | under its [MIT license](LICENSE). 50 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Netlify 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Victor Hugo 2 | 3 | ⚠️ **Deprecation Notice** 🏳 4 | 5 | We are focusing our resources on building new templates that help you build a better web, because of that we're deprecating this template. We care about the community so we propose if anyone wants to maintain or take stewardship over the project please contact us at [devexperience@netlify.com](mailto:devexperience@netlify.com). If you want to share anything with the team about this template, you can also fill out [this form](https://template-feedback.netlify.app/). 6 | 7 | As an alternative to this repository, we're recommending to take a look at [Hyas](https://github.com/h-enk/hyas) as a project to make use of. It is focused on latest practices with Hugo and is already completely Netlify deploy ready. 8 | 9 | --- 10 | 11 | **A Hugo boilerplate for creating truly epic websites** 12 | 13 | This is a boilerplate for using [Hugo](https://gohugo.io/) as a static site generator and [Webpack 5](https://webpack.js.org/) as your asset pipeline. 14 | 15 | Victor Hugo setup to use [PostCSS v8](http://postcss.org/) and [Babel v7](https://babeljs.io/) for CSS and JavaScript compiling/transpiling. 16 | 17 | This project is released under the [MIT license](LICENSE). Please make sure you understand its implications and guarantees. 18 | 19 | ## Usage 20 | 21 | ### :exclamation: Prerequisites 22 | 23 | This template has been tested to work with [Node.js](https://nodejs.org/en/download/) v16 and [npm](https://www.npmjs.com/get-npm) v6. 24 | 25 | Next step, clone this repository and run: 26 | 27 | ```bash 28 | npm install 29 | ``` 30 | 31 | This will take some time and will install all packages necessary to run Victor Hugo and its tasks. 32 | 33 | ### :construction_worker: Development 34 | 35 | While developing your website, use: 36 | 37 | ```bash 38 | npm start 39 | ``` 40 | 41 | or for developing your website with `hugo server --buildDrafts --buildFuture`, use: 42 | 43 | ```bash 44 | npm run preview 45 | ``` 46 | 47 | 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. 48 | 49 | ### :package: Static build 50 | 51 | To build a static version of the website inside the `/dist` folder, run: 52 | 53 | ```bash 54 | npm run build 55 | ``` 56 | 57 | To get a preview of posts or articles not yet published, run: 58 | 59 | ```bash 60 | npm run build:preview 61 | ``` 62 | 63 | See [package.json](package.json#L8) for all tasks. 64 | 65 | ## Structure 66 | 67 | ``` 68 | |--site // Everything in here will be built with hugo 69 | | |--content // Pages and collections - ask if you need extra pages 70 | | |--data // YAML data files with any data for use in examples 71 | | |--layouts // This is where all templates go 72 | | | |--partials // This is where includes live 73 | | | |--index.html // The index page 74 | | |--resources // This is where all assets go 75 | | |--static // Files in here ends up in the public folder 76 | |--src // Files that will pass through the asset pipeline 77 | | |--css // Webpack will bundle imported css separately 78 | | |--index.js // index.js is the webpack entry for your css & js assets 79 | ``` 80 | 81 | ## Basic Concepts 82 | 83 | You can read more about Hugo's template language in their documentation here: 84 | 85 | https://gohugo.io/templates/overview/ 86 | 87 | The most useful page there is the one about the available functions: 88 | 89 | https://gohugo.io/templates/functions/ 90 | 91 | For assets that are completely static and don't need to go through the asset pipeline, 92 | use the `site/static` folder. Images, font-files, etc, all go there. 93 | 94 | Files in the static folder end up in the web root. So a file called `site/static/favicon.ico` 95 | will end up being available as `/favicon.ico` and so on... 96 | 97 | The `src/index.js` file is the entrypoint for webpack and will be built to `/dist/main.js` 98 | 99 | You can use **ES6** and use both relative imports or import libraries from npm. 100 | 101 | Any CSS file imported into the `index.js` will be run through Webpack, compiled with [PostCSS Next](http://cssnext.io/), and 102 | minified to `/dist/[name].[hash:5].css`. Import statements will be resolved as part of the build. 103 | 104 | ## Environment variables 105 | 106 | To separate the development and production _- aka build -_ stages, all tasks run with a node environment variable named either `development` or `production`. 107 | 108 | You can access the environment variable inside the theme files with `getenv "NODE_ENV"`. See the following example for a conditional statement: 109 | 110 | {{ if eq (getenv "NODE_ENV") "development" }}You're in development!{{ end }} 111 | 112 | All tasks starting with _build_ set the environment variable to `production` - the other will set it to `development`. 113 | 114 | ## Deploying to Netlify 115 | 116 | - Push your clone to your own GitHub repository. 117 | - [Create a new site on Netlify](https://app.netlify.com/start) and link the repository. 118 | 119 | Now Netlify will build and deploy your site whenever you push to git. 120 | 121 | You can also click this button: 122 | 123 | [![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/netlify/victor-hugo) 124 | 125 | ## Enjoy!! 😸 126 | -------------------------------------------------------------------------------- /netlify.toml: -------------------------------------------------------------------------------- 1 | [build.environment] 2 | NPM_VERSION = "6.13.4" 3 | 4 | [build] 5 | command = "npm run build" 6 | publish = "dist" 7 | 8 | [context.deploy-preview] 9 | command = "npm run build:preview" 10 | 11 | [dev] 12 | command = "npm run start" 13 | targetPort = 8888 14 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "victor-hugo", 3 | "version": "2.0.0", 4 | "description": "Victor Hugo is a Hugo boilerplate for creating truly epic websites!", 5 | "repository": "netlify/victor-hugo", 6 | "main": "index.js", 7 | "scripts": { 8 | "lint": "eslint src", 9 | "start": "run-p start:**", 10 | "start:hugo": "hugo -d ../dist -s site -vw", 11 | "start:webpack": "webpack-dev-server --config webpack.dev.js --hot", 12 | "preview": "run-p preview:**", 13 | "preview:hugo": "npm run start:hugo -- -D -F", 14 | "preview:webpack": "npm run start:webpack", 15 | "build": "npm run build:webpack && npm run build:hugo", 16 | "build:preview": "npm run build:webpack && npm run build:hugo:preview", 17 | "build:hugo": "hugo -d ../dist -s site -v", 18 | "build:hugo:preview": "npm run build:hugo -- -D -F", 19 | "build:webpack": "cross-env NODE_ENV=production webpack --config webpack.prod.js" 20 | }, 21 | "author": "", 22 | "license": "MIT", 23 | "devDependencies": { 24 | "@babel/core": "^7.16.0", 25 | "@babel/eslint-parser": "^7.16.3", 26 | "@babel/preset-env": "^7.16.0", 27 | "@babel/register": "^7.16.0", 28 | "assets-webpack-plugin": "^7.1.1", 29 | "babel-loader": "^8.2.3", 30 | "clean-webpack-plugin": "^4.0.0", 31 | "copy-webpack-plugin": "^9.1.0", 32 | "cross-env": "^7.0.3", 33 | "css-loader": "^6.5.1", 34 | "css-minimizer-webpack-plugin": "^3.1.3", 35 | "eslint": "^8.2.0", 36 | "exports-loader": "^3.1.0", 37 | "file-loader": "^6.2.0", 38 | "html-webpack-plugin": "^5.5.0", 39 | "hugo-bin": "^0.77.2", 40 | "imports-loader": "^3.1.1", 41 | "mini-css-extract-plugin": "^2.4.4", 42 | "node-sass": "^6.0.1", 43 | "npm-run-all": "^4.1.5", 44 | "postcss": "^8.3.11", 45 | "postcss-import": "^14.0.2", 46 | "postcss-loader": "^6.2.0", 47 | "postcss-preset-env": "^6.7.0", 48 | "sass-loader": "^12.3.0", 49 | "style-loader": "^3.3.1", 50 | "terser-webpack-plugin": "^5.2.5", 51 | "webpack": "^5.64.1", 52 | "webpack-cli": "^4.9.1", 53 | "webpack-dev-server": "^4.5.0", 54 | "webpack-merge": "^5.8.0" 55 | }, 56 | "resolutions": { 57 | "natives": "1.1.6" 58 | }, 59 | "engines": { 60 | "node": ">=16.13.0" 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | "postcss-import": {}, 4 | "postcss-preset-env": { 5 | browsers: "last 2 versions" 6 | }, 7 | autoprefixer: {} 8 | } 9 | }; 10 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["github>netlify/renovate-config:netlify-cms-starter"] 3 | } 4 | -------------------------------------------------------------------------------- /site/.hugo_build.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netlify-templates/victor-hugo/f192a17fa843dbda9ef0919dcb494b8a59f63f92/site/.hugo_build.lock -------------------------------------------------------------------------------- /site/config.toml: -------------------------------------------------------------------------------- 1 | baseurl = "/" 2 | languageCode = "en-us" 3 | languageLang = "en" 4 | title = "My new Victor-Hugo site" 5 | 6 | # RSS, categories and tags disabled for an easy start 7 | # See configuration options for more details: 8 | # https://gohugo.io/getting-started/configuration/#toml-configuration 9 | disableKinds = ["RSS", "taxonomy", "taxonomyTerm"] 10 | -------------------------------------------------------------------------------- /site/content/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netlify-templates/victor-hugo/f192a17fa843dbda9ef0919dcb494b8a59f63f92/site/content/.keep -------------------------------------------------------------------------------- /site/content/tech.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "tech" 3 | date: 2018-11-14T19:02:50-07:00 4 | draft: false 5 | --- 6 | 7 | # [Victor Hugo](https://github.com/netlify-templates/victor-hugo) 8 | 9 | ## A Hugo boilerplate for creating truly epic websites 10 | 11 | 12 | 13 | This is a boilerplate for using [Hugo](https://gohugo.io/) as a static site generator and [Webpack 5](https://webpack.js.org/) as your asset pipeline. Victor Hugo setup to use [PostCSS v8](http://postcss.org/) and [Babel v7](https://babeljs.io/) for CSS and JavaScript compiling/transpiling. This project is released under the [MIT license](LICENSE). Please make sure you understand its implications and guarantees. 14 | 15 | ## Enjoy!! 😸 16 | -------------------------------------------------------------------------------- /site/data/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netlify-templates/victor-hugo/f192a17fa843dbda9ef0919dcb494b8a59f63f92/site/data/.keep -------------------------------------------------------------------------------- /site/layouts/404.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 | 3 |

Nothing Here...

4 |

💩

5 |

Go Home

6 | 7 | {{ end }} 8 | -------------------------------------------------------------------------------- /site/layouts/_default/baseof.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {{ $.Site.Title }} 9 | 10 | {{ $stylesheet := .Site.Data.webpack.main }} 11 | {{ with $stylesheet.css }} 12 | 13 | {{ end }} 14 | 15 | 16 | 17 | 18 | {{ block "header" . }}{{ partial "header" . }}{{end}} 19 | 20 | {{ block "main" . }}{{end}} 21 | 22 | {{ block "footer" . }}{{ partial "footer" . }}{{end}} 23 | 24 | {{ $script := .Site.Data.webpack.main }} 25 | {{ with $script.js }} 26 | 27 | {{ end }} 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /site/layouts/_default/single.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} {{ $section := .Site.GetPage "section" .Section }} 2 |
3 |
{{- .Content -}}
4 |
5 | {{ end }} 6 | -------------------------------------------------------------------------------- /site/layouts/index.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 | 3 |

Hugo with Webpack, Sass, and PostCSS

4 | 5 |

Hooray 🎉 - you've built this with Victor-Hugo!

6 | 7 | Check out the tech 8 | 9 | {{ end }} 10 | -------------------------------------------------------------------------------- /site/layouts/partials/footer.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netlify-templates/victor-hugo/f192a17fa843dbda9ef0919dcb494b8a59f63f92/site/layouts/partials/footer.html -------------------------------------------------------------------------------- /site/layouts/partials/header.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netlify-templates/victor-hugo/f192a17fa843dbda9ef0919dcb494b8a59f63f92/site/layouts/partials/header.html -------------------------------------------------------------------------------- /site/static/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netlify-templates/victor-hugo/f192a17fa843dbda9ef0919dcb494b8a59f63f92/site/static/.keep -------------------------------------------------------------------------------- /src/css/imports/reset.css: -------------------------------------------------------------------------------- 1 | /* 2 | Define your resets here or use something like Normalize.css if you like 3 | */ 4 | 5 | html, 6 | body { 7 | margin: 0; 8 | padding: 0; 9 | height: 100%; 10 | } 11 | -------------------------------------------------------------------------------- /src/css/main.css: -------------------------------------------------------------------------------- 1 | /* 2 | You can use import statements to include partials: 3 | */ 4 | @import 'imports/reset.css'; 5 | 6 | /* 7 | Or add your statements here: 8 | */ 9 | body { 10 | font-size: calc(10px + 1vmin); 11 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 12 | 'Droid Sans', 'Helvetica Neue', sans-serif; 13 | -webkit-font-smoothing: antialiased; 14 | -moz-osx-font-smoothing: grayscale; 15 | 16 | display: flex; 17 | flex-direction: column; 18 | align-items: center; 19 | justify-content: center; 20 | text-align: center; 21 | background-color: #282c34; 22 | color: white; 23 | } 24 | 25 | a { 26 | color: pink; 27 | text-decoration: none; 28 | } 29 | 30 | .content { 31 | padding: 0 32px; 32 | } 33 | -------------------------------------------------------------------------------- /src/fonts/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netlify-templates/victor-hugo/f192a17fa843dbda9ef0919dcb494b8a59f63f92/src/fonts/.keep -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | // JS Goes here - ES6 supported 2 | 3 | import "./css/main.css"; 4 | 5 | // Say hello 6 | console.log("🦊 Hello! Edit me in src/index.js"); 7 | -------------------------------------------------------------------------------- /webpack.common.js: -------------------------------------------------------------------------------- 1 | const webpack = require("webpack"); 2 | const path = require("path"); 3 | const CopyWebpackPlugin = require("copy-webpack-plugin"); 4 | const MiniCssExtractPlugin = require("mini-css-extract-plugin"); 5 | const AssetsPlugin = require("assets-webpack-plugin"); 6 | 7 | module.exports = { 8 | entry: { 9 | main: path.join(__dirname, "src", "index.js"), 10 | }, 11 | 12 | output: { 13 | path: path.join(__dirname, "dist"), 14 | publicPath: "", 15 | }, 16 | 17 | module: { 18 | rules: [ 19 | { 20 | test: /\.((png)|(eot)|(woff)|(woff2)|(ttf)|(svg)|(gif))(\?v=\d+\.\d+\.\d+)?$/, 21 | loader: "file-loader", 22 | options: { 23 | name: "name=/[hash].[ext]", 24 | }, 25 | }, 26 | 27 | {test: /\.json$/, loader: "json-loader"}, 28 | 29 | { 30 | loader: "babel-loader", 31 | test: /\.js?$/, 32 | exclude: /node_modules/, 33 | options: {cacheDirectory: true}, 34 | }, 35 | 36 | { 37 | test: /\.(sa|sc|c)ss$/, 38 | exclude: /node_modules/, 39 | use: [ 40 | "style-loader", 41 | { 42 | loader: MiniCssExtractPlugin.loader, 43 | options: { 44 | esModule: false 45 | } 46 | }, 47 | "css-loader", 48 | "postcss-loader", 49 | "sass-loader", 50 | ], 51 | }, 52 | ], 53 | }, 54 | 55 | plugins: [ 56 | new webpack.ProvidePlugin({ 57 | fetch: 58 | "imports-loader?this=>global!exports-loader?global.fetch!whatwg-fetch", 59 | }), 60 | 61 | new AssetsPlugin({ 62 | filename: "webpack.json", 63 | path: path.join(process.cwd(), "site/data"), 64 | prettyPrint: true, 65 | }), 66 | 67 | new CopyWebpackPlugin({ 68 | patterns: [ 69 | { 70 | from: "./src/fonts/", 71 | to: "fonts/", 72 | }, 73 | ], 74 | }), 75 | ], 76 | }; 77 | -------------------------------------------------------------------------------- /webpack.dev.js: -------------------------------------------------------------------------------- 1 | const {merge} = require("webpack-merge"); 2 | const path = require("path"); 3 | const {CleanWebpackPlugin} = require("clean-webpack-plugin"); 4 | const MiniCssExtractPlugin = require("mini-css-extract-plugin"); 5 | 6 | const common = require("./webpack.common"); 7 | 8 | module.exports = merge(common, { 9 | mode: "development", 10 | 11 | output: { 12 | filename: "[name].js", 13 | chunkFilename: "[id].css", 14 | }, 15 | 16 | devServer: { 17 | port: process.env.PORT || 3000, 18 | static: { 19 | directory: path.join(process.cwd(), "./dist"), 20 | watch: true, 21 | }, 22 | open: true, 23 | historyApiFallback: { 24 | rewrites: [{from: /./, to: "404.html"}], 25 | }, 26 | }, 27 | 28 | plugins: [ 29 | new CleanWebpackPlugin({ 30 | cleanOnceBeforeBuildPatterns: [ 31 | "dist/**/*.js", 32 | "dist/**/*.css", 33 | "site/content/webpack.json", 34 | ], 35 | }), 36 | 37 | new MiniCssExtractPlugin({ 38 | filename: "[name].css", 39 | chunkFilename: "[id].css", 40 | }), 41 | ], 42 | }); 43 | -------------------------------------------------------------------------------- /webpack.prod.js: -------------------------------------------------------------------------------- 1 | const {merge} = require("webpack-merge"); 2 | const path = require("path"); 3 | const MiniCssExtractPlugin = require("mini-css-extract-plugin"); 4 | const TerserPlugin = require("terser-webpack-plugin"); 5 | const HtmlWebpackPlugin = require("html-webpack-plugin"); 6 | const CssMinimizerPlugin = require("css-minimizer-webpack-plugin"); 7 | 8 | const common = require("./webpack.common.js"); 9 | 10 | module.exports = merge(common, { 11 | mode: "production", 12 | 13 | output: { 14 | filename: "[name].[hash:5].js", 15 | chunkFilename: "[id].[hash:5].css", 16 | path: path.resolve(__dirname, "dist"), 17 | }, 18 | 19 | optimization: { 20 | minimize: true, 21 | minimizer: [ 22 | new MiniCssExtractPlugin({ 23 | filename: "[name].[hash:5].css", 24 | chunkFilename: "[id].[hash:5].css", 25 | }), 26 | new TerserPlugin(), 27 | new CssMinimizerPlugin(), 28 | ], 29 | }, 30 | plugins: [new HtmlWebpackPlugin()], 31 | }); 32 | --------------------------------------------------------------------------------