Skip to content

Commit

Permalink
Merge pull request #26 from h-enk/hyas-1.2.2
Browse files Browse the repository at this point in the history
Update for 1.2.2
  • Loading branch information
h-enk authored Apr 17, 2020
2 parents 8964274 + df7dd22 commit f563021
Show file tree
Hide file tree
Showing 46 changed files with 93 additions and 141 deletions.
2 changes: 1 addition & 1 deletion .stylelintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
assets/sass/vendor
assets/scss/vendor
node_modules
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ sudo: required
language: node_js
node_js:
- "lts/*"
- "13"

install:
- wget "https://github.com/gohugoio/hugo/releases/download/v${HUGO_RELEASE}/hugo_extended_${HUGO_RELEASE}_Linux-64bit.deb"
Expand All @@ -19,4 +20,4 @@ script:
env:
global:
- PRODUCTION=true
- HUGO_RELEASE=0.60.1
- HUGO_RELEASE=0.69.0
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.2.2] - 2020-04-17
### Added
- `[[module.mounts]]` to `config/_default/config.toml`

### Changed
- Bumped `[build.environment]` `netlify.toml`
- `.travis.yml`
- `README`
- `index.headers`

### Removed
- `copy:deps` from build command

## [1.2.1] - 2020-03-31
### Added
- version to package.json - [issue 23](https://github.com/h-enk/hyas/issues/23)
Expand Down Expand Up @@ -68,7 +81,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- lazysizes 5.2.0-beta1
- [Atlas](https://github.com/indigotree/atlas), Copyright (c) 2017 Indigo Tree, [MIT License](https://github.com/indigotree/atlas/blob/master/LICENSE)

[Unreleased]: https://github.com/h-enk/hyas/compare/v1.2.1...HEAD
[Unreleased]: https://github.com/h-enk/hyas/compare/v1.2.2...HEAD
[1.2.2]: https://github.com/h-enk/hyas/releases/tag/v1.2.2
[1.2.1]: https://github.com/h-enk/hyas/releases/tag/v1.2.1
[1.2.0]: https://github.com/h-enk/hyas/releases/tag/v1.2.0
[1.1.0]: https://github.com/h-enk/hyas/releases/tag/v1.1.0
Expand Down
109 changes: 16 additions & 93 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,32 @@
[![Build Status](https://img.shields.io/travis/h-enk/hyas.svg?style=flat-square)](https://travis-ci.org/h-enk/hyas)
[![Netlify](https://img.shields.io/netlify/895a161c-86be-48a2-8c57-a8c5d68cd1a4?style=flat-square)](https://hyas.netlify.com/)

Hugo boilerplate helping you build fast, robust, and adaptable websites.
Hyas is a Hugo starter helping you build modern websites.

## Features

- Bootstrap Sass (no JavaScript) and Autoprefixer
- Check Sass and JavaScript for errors
- Lightweight code base
- 100 scores Google Lighthouse
- A+ scores [Mozilla Observatory](https://observatory.mozilla.org/)
- Easily make it your own
- [Bootstrap](https://getbootstrap.com/docs/4.4/getting-started/download/#source-files) Sass (no JavaScript) and [Autoprefixer](https://github.com/postcss/autoprefixer)
- Check SCSS for errors with [stylelint](https://stylelint.io/)
- Check JavaScript for errors with [ESLint](https://eslint.org/)
- Environment specific configuration
- Image shortcode with [lazysizes](https://github.com/aFarkas/lazysizes) and [blur up](https://github.com/aFarkas/lazysizes/tree/master/plugins/blur-up) plugin
- Fingerprinting and [SRI](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) (production)
- Remove unused CSS (production)
- Remove unused CSS (production) with [PurgeCSS](https://github.com/FullHuman/purgecss)

See a working example at [hyas.netlify.app](https://hyas.netlify.app/)

## Requirements

Make sure all dependencies have been installed:

- Hugo >= 0.68.3/extended
- Node.js >= 13.11.0
- npm >= 6.13.7
- Yarn >= 1.22.0 (recommended)
- [Hugo](https://gohugo.io/) >= 0.69.0/extended
- [Node.js](https://nodejs.org/) >= 13.11.0
- [Yarn](https://yarnpkg.com/) >= 1.22.4 (recommended)

## Getting started
## Get started

Create a new Hyas project:

Expand Down Expand Up @@ -51,89 +56,7 @@ $ yarn start
- `yarn clean` - Delete temporary directories
- `yarn build` - Build production theme

## Theme structure

```shell
my-hyas-site/ # → Root of your Hyas based theme
├── archetypes/ # → Content template files
├── assets/ # → Asset files (fonts, images, js, lambda, and sass)
├── config/ # → Configuration directives
│ ├── _default/ # → Development and defaults
│ ├── production/ # → Production specific
│ ├── staging/ # → Staging specific
│ ├── postcss.config.js # → PostCSS configuration file
├── content/ # → Content using page bundles
├── data/ # → Custom data files
├── functions/ # → Netlify lambda functions directory (production)
├── layouts/ # → Template files
│ ├── _default/ # → Base templates for list & singular pages
│ ├── partials/ # → Partials (footer, head, header, and sidebar)
│ ├── shortcodes/ # → Shortcodes (img)
│ │── 404.html # → 404 Template
│ │── index.headers # → Custom Netlify HTTP headers
│ │── index.html # → Homepage template
│ │── index.redirects # → Custom Netlify redirect rules
│ │── robots.txt # → Template for robots.txt
│ │── sitemap.xml # → Custom sitemap template
├── node_modules/ # → Node.js packages (never edit)
├── public/ # → Publish directory (temporary)
├── resources/ # → Resource cache directory (temporary)
├── static/ # → Static content (favicons et cetera)
├── .eslintrc.json # → ESLint configuration
├── .stylelintrc.json # → stylelint configuration
├── netlify.toml # → Netlify configuration
├── package.json # → Node.js dependencies and scripts
└── yarn.lock # → Yarn lock file (never edit)
```

## Theme setup
Edit files in `config/` directory.


## Theme development
### Sass

Don't like Bootstrap? Remove it:
```bash
# @ my-hyas-site/
$ yarn remove bootstrap
```
Also make sure to update your sass files, like `app.scss`.

### Images

Use the image shortcode:
```
{{< img src="image-in-page-bundle.jpg" alt="Text description image" caption="Caption, optional" class="wide" >}}
```

Configuration in `config/_default/params.toml`:

```toml
quality = 85
bgColor = "#fff"
landscapePhotoWidths = [900, 700, 500]
portraitPhotoWidths = [1500, 1000, 750]
lqipWidth = "20x"
```

### Sitemap
Exclude a page by adding the following front matter variable:
```yaml
sitemap_exclude: true
```
### Robots
Add a custom [robots meta tag](https://developers.google.com/search/reference/robots_meta_tag) by adding the following front matter variable:
```yaml
robots: "noindex, noarchive"
```
This will output:
```html
<meta name=robots content="noindex, noarchive">
```

## Documentation
- [Hugo](https://gohugo.io/documentation/)
- [Goldmark](https://github.com/yuin/goldmark/)
- [Hyas](https://gethyas.com/)
2 changes: 1 addition & 1 deletion archetypes/default.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ title: "{{ replace .Name "-" " " | title }}"
description: ""
date: {{ .Date }}
draft: true
images: [""]
images: {{ .Site.Params.images }}
---
2 changes: 1 addition & 1 deletion archetypes/news.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "{{ replace .Name "-" " " | title }}"
description: ""
date: {{ .Date }}
draft: true
images: [""]
images: {{ .Site.Params.images }}
---

{{< img src="" alt="" caption="" class="wide" >}}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions config/_default/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,17 @@ notAlternative = true
changefreq = "monthly"
filename = "sitemap.xml"
priority = 0.5

[module]
[[module.mounts]]
source = "assets"
target = "assets"
[[module.mounts]]
source = "static"
target = "static"
[[module.mounts]]
source = "node_modules/lazysizes"
target = "assets/js/vendor/lazysizes"
[[module.mounts]]
source = "node_modules/ga-lite/dist"
target = "static/js/vendor/ga-lite"
6 changes: 3 additions & 3 deletions config/_default/params.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
title = "Hyas"
titleSeparator = "-"
titleAddition = "Hugo Boilerplate"
description = "Hugo boilerplate helping you build fast, robust, and adaptable websites."
images = ["image-hyas.jpg"]
titleAddition = "Modern Hugo Starter"
description = "Hugo starter helping you build modern websites."
images = ["image-hyas.png"]
twitterSite = "@henkverlinde"
twitterCreator = "@henkverlinde"
ogLocale = "en_US"
Expand Down
4 changes: 2 additions & 2 deletions config/postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ module.exports = {
whitelist: [
'lazyloaded',
...whitelister([
'./assets/sass/common/_syntax.scss',
'./assets/sass/components/_code.scss',
'./assets/scss/common/_syntax.scss',
'./assets/scss/components/_code.scss',
]),
],
}),
Expand Down
2 changes: 1 addition & 1 deletion config/production/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
baseurl = "https://hyas.netlify.com/"
baseurl = "https://hyas.netlify.app/"
canonifyURLs = false
2 changes: 1 addition & 1 deletion config/staging/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
baseurl = "https://hyas-staging.netlify.com/"
baseurl = "https://hyas-staging.netlify.app/"
canonifyURLs = false
8 changes: 4 additions & 4 deletions content/_index.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title : "Hyas"
description: "Hugo boilerplate helping you build fast, robust, and adaptable websites."
date: 2019-12-02T13:47:16+01:00
description: "Hugo starter helping you build modern websites."
date: 2020-04-17T12:18:10+00:00
draft: false
images: ["image-hyas.jpg"]
lead: "Hugo boilerplate helping you build fast, robust, and adaptable websites."
images: ["image-hyas.png"]
lead: "Hugo starter helping you build modern websites."
---
6 changes: 3 additions & 3 deletions content/news/_index.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: "News"
description: ""
date: 2019-12-02T13:47:16+01:00
description: "News Hyas"
date: 2020-04-17T12:17:27+00:00
draft: true
images: [""]
images: ["image-hyas.png"]
robots: "noindex, noarchive"
sitemap_exclude: true
---
4 changes: 2 additions & 2 deletions content/quick-start/index.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: "Quick Start"
description: "A quick start to using Hyas."
date: 2019-12-04T15:43:37+01:00
date: 2020-04-17T12:17:54+00:00
draft: false
images: ["hyas.jpg"]
images: ["image-hyas.png"]
---

```bash
Expand Down
22 changes: 11 additions & 11 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
<html lang="{{ .Site.LanguageCode | default "en" }}">
{{ block "head" . }}{{ partial "head/head.html" . }}{{ end }}
{{ if eq .Kind "home" -}}
{{ .Scratch.Set "class" "home" }}
{{ .Scratch.Set "class" "home" -}}
{{ else if eq .Kind "404" -}}
{{ .Scratch.Set "class" "error404" }}
{{ .Scratch.Set "class" "error404" -}}
{{ else if eq .Kind "page" -}}
{{ .Scratch.Set "class" .Type }}
{{ .Scratch.Add "class" " single" }}
{{ .Scratch.Set "class" .Type -}}
{{ .Scratch.Add "class" " single" -}}
{{ else -}}
{{ .Scratch.Set "class" .Type }}
{{ .Scratch.Add "class" " list" }}
{{ .Scratch.Set "class" .Type -}}
{{ .Scratch.Add "class" " list" -}}
{{ end -}}
<body class="{{ .Scratch.Get "class" }}">
{{ block "header" . }}{{ partial "header/header.html" . }}{{ end }}
<div class="wrap container" role="document">
<div class="content">
<main class="main">
{{ block "main" . }}{{ end }}
</main>
</div>
{{ block "main" . }}{{ end }}
</div>
</div>
{{ block "footer" . }}{{ partial "footer/footer.html" . }}{{ end }}
{{ if ne .Section "docs" }}
{{ block "footer" . }}{{ partial "footer/footer.html" . }}{{ end }}
{{ end }}
{{ block "script-footer" . }}{{ partial "footer/script-footer.html" . }}{{ end }}
</body>
</html>
4 changes: 2 additions & 2 deletions layouts/index.headers
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Content-Security-Policy: default-src 'self'; img-src 'self' data:; object-src 'none'
Content-Security-Policy: default-src 'self'; img-src 'self' data:; script-src 'self'; style-src 'self'
X-Frame-Options: SAMEORIGIN
Referrer-Policy: strict-origin
Feature-Policy: geolocation 'self'
Cache-Control: public, max-age=31536000
Cache-Control: public, max-age=31536000
2 changes: 1 addition & 1 deletion layouts/partials/footer/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
<div class="container">
<p class="m-0 text-center">{{ .Site.Params.footer | safeHTML }}</p>
</div>
</footer>
</footer>
2 changes: 1 addition & 1 deletion layouts/partials/head/resource-hints.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!-- <link rel="preload" href="https://gohugo.io/fonts/muli-latin-200.woff2" as="font" type="font/woff2" crossorigin> -->
<!-- <link rel="preload" href="https://gohugo.io/fonts/muli-latin-200.woff2" as="font" type="font/woff2" crossorigin> -->
2 changes: 1 addition & 1 deletion layouts/partials/head/structured-data.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@
}
}{{ end }}]
}
</script>
</script>
12 changes: 6 additions & 6 deletions layouts/partials/head/stylesheet.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{{ if eq (hugo.Environment) "development" -}}
{{ $options := (dict "targetPath" "main.css" "enableSourceMap" true "includePaths" (slice "node_modules")) }}
{{ $css := resources.Get "sass/app.scss" | toCSS $options }}
{{ $options := (dict "targetPath" "main.css" "enableSourceMap" true "includePaths" (slice "node_modules")) -}}
{{ $css := resources.Get "scss/app.scss" | toCSS $options -}}
<link rel="stylesheet" href="{{ $css.Permalink }}">
{{ else -}}
{{ $options := (dict "targetPath" "main.css" "outputStyle" "compressed" "includePaths" (slice "node_modules")) }}
{{ $css := resources.Get "sass/app.scss" | toCSS $options | postCSS (dict "config" "config/postcss.config.js") }}
{{ $secureCSS := $css | resources.Fingerprint "sha512" }}
{{ $options := (dict "targetPath" "main.css" "outputStyle" "compressed" "includePaths" (slice "node_modules")) -}}
{{ $css := resources.Get "scss/app.scss" | toCSS $options | postCSS (dict "config" "config/postcss.config.js") -}}
{{ $secureCSS := $css | resources.Fingerprint "sha512" -}}
<link rel="stylesheet" href="{{ $secureCSS.Permalink }}" integrity="{{ $secureCSS.Data.Integrity }}" crossorigin="anonymous">
{{ end -}}
<noscript><style>img.lazyload { display: none; }</style></noscript>
<noscript><style>img.lazyload { display: none; }</style></noscript>
4 changes: 2 additions & 2 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
functions = "functions/"

[build.environment]
HUGO_VERSION = "0.68.3"
HUGO_VERSION = "0.69.0"
NODE_VERSION = "13.11.0"
NPM_VERSION = "6.13.7"
YARN_VERSION = "1.22.0"
YARN_VERSION = "1.22.4"

[context.deploy-preview]
command = "yarn build:preview"
Expand Down
Loading

0 comments on commit f563021

Please sign in to comment.