diff --git a/.stylelintignore b/.stylelintignore index 353b7e8c..9d9a3cec 100644 --- a/.stylelintignore +++ b/.stylelintignore @@ -1,2 +1,2 @@ -assets/sass/vendor +assets/scss/vendor node_modules \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 24bf5117..2f60d907 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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" @@ -19,4 +20,4 @@ script: env: global: - PRODUCTION=true - - HUGO_RELEASE=0.60.1 \ No newline at end of file + - HUGO_RELEASE=0.69.0 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index e74e0cfd..f2fd3066 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) @@ -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 diff --git a/README.md b/README.md index 537693db..16eeb2b4 100644 --- a/README.md +++ b/README.md @@ -3,27 +3,32 @@ [](https://travis-ci.org/h-enk/hyas) [](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: @@ -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 - -``` ## Documentation - [Hugo](https://gohugo.io/documentation/) -- [Goldmark](https://github.com/yuin/goldmark/) +- [Hyas](https://gethyas.com/) diff --git a/archetypes/default.md b/archetypes/default.md index c192a067..383c33d5 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -3,5 +3,5 @@ title: "{{ replace .Name "-" " " | title }}" description: "" date: {{ .Date }} draft: true -images: [""] +images: {{ .Site.Params.images }} --- diff --git a/archetypes/news.md b/archetypes/news.md index e22239c8..c05b5269 100644 --- a/archetypes/news.md +++ b/archetypes/news.md @@ -3,7 +3,7 @@ title: "{{ replace .Name "-" " " | title }}" description: "" date: {{ .Date }} draft: true -images: [""] +images: {{ .Site.Params.images }} --- {{< img src="" alt="" caption="" class="wide" >}} diff --git a/assets/sass/app.scss b/assets/scss/app.scss similarity index 100% rename from assets/sass/app.scss rename to assets/scss/app.scss diff --git a/assets/sass/common/_global.scss b/assets/scss/common/_global.scss similarity index 100% rename from assets/sass/common/_global.scss rename to assets/scss/common/_global.scss diff --git a/assets/sass/common/_syntax.scss b/assets/scss/common/_syntax.scss similarity index 100% rename from assets/sass/common/_syntax.scss rename to assets/scss/common/_syntax.scss diff --git a/assets/sass/common/_variables.scss b/assets/scss/common/_variables.scss similarity index 100% rename from assets/sass/common/_variables.scss rename to assets/scss/common/_variables.scss diff --git a/assets/sass/components/_buttons.scss b/assets/scss/components/_buttons.scss similarity index 100% rename from assets/sass/components/_buttons.scss rename to assets/scss/components/_buttons.scss diff --git a/assets/sass/components/_code.scss b/assets/scss/components/_code.scss similarity index 100% rename from assets/sass/components/_code.scss rename to assets/scss/components/_code.scss diff --git a/assets/sass/components/_comments.scss b/assets/scss/components/_comments.scss similarity index 100% rename from assets/sass/components/_comments.scss rename to assets/scss/components/_comments.scss diff --git a/assets/sass/components/_forms.scss b/assets/scss/components/_forms.scss similarity index 100% rename from assets/sass/components/_forms.scss rename to assets/scss/components/_forms.scss diff --git a/assets/sass/components/_images.scss b/assets/scss/components/_images.scss similarity index 100% rename from assets/sass/components/_images.scss rename to assets/scss/components/_images.scss diff --git a/assets/sass/layouts/_footer.scss b/assets/scss/layouts/_footer.scss similarity index 100% rename from assets/sass/layouts/_footer.scss rename to assets/scss/layouts/_footer.scss diff --git a/assets/sass/layouts/_header.scss b/assets/scss/layouts/_header.scss similarity index 100% rename from assets/sass/layouts/_header.scss rename to assets/scss/layouts/_header.scss diff --git a/assets/sass/layouts/_pages.scss b/assets/scss/layouts/_pages.scss similarity index 100% rename from assets/sass/layouts/_pages.scss rename to assets/scss/layouts/_pages.scss diff --git a/assets/sass/layouts/_posts.scss b/assets/scss/layouts/_posts.scss similarity index 100% rename from assets/sass/layouts/_posts.scss rename to assets/scss/layouts/_posts.scss diff --git a/assets/sass/layouts/_sidebar.scss b/assets/scss/layouts/_sidebar.scss similarity index 100% rename from assets/sass/layouts/_sidebar.scss rename to assets/scss/layouts/_sidebar.scss diff --git a/assets/sass/vendor/.gitkeep b/assets/scss/vendor/.gitkeep similarity index 100% rename from assets/sass/vendor/.gitkeep rename to assets/scss/vendor/.gitkeep diff --git a/config/_default/config.toml b/config/_default/config.toml index 6bdad666..17037b51 100644 --- a/config/_default/config.toml +++ b/config/_default/config.toml @@ -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" diff --git a/config/_default/params.toml b/config/_default/params.toml index e9511bcd..9c9d26e5 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -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" diff --git a/config/postcss.config.js b/config/postcss.config.js index c7c38770..deeb5c88 100644 --- a/config/postcss.config.js +++ b/config/postcss.config.js @@ -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', ]), ], }), diff --git a/config/production/config.toml b/config/production/config.toml index 796d80a7..2e2817ba 100644 --- a/config/production/config.toml +++ b/config/production/config.toml @@ -1,2 +1,2 @@ -baseurl = "https://hyas.netlify.com/" +baseurl = "https://hyas.netlify.app/" canonifyURLs = false diff --git a/config/staging/config.toml b/config/staging/config.toml index 3453ac0a..4d24e3d5 100644 --- a/config/staging/config.toml +++ b/config/staging/config.toml @@ -1,2 +1,2 @@ -baseurl = "https://hyas-staging.netlify.com/" +baseurl = "https://hyas-staging.netlify.app/" canonifyURLs = false diff --git a/content/_index.md b/content/_index.md index 649b193f..abab9ffa 100644 --- a/content/_index.md +++ b/content/_index.md @@ -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." --- diff --git a/content/news/_index.md b/content/news/_index.md index 46d6f24d..5e6e852a 100644 --- a/content/news/_index.md +++ b/content/news/_index.md @@ -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 --- diff --git a/content/quick-start/index.md b/content/quick-start/index.md index 56763949..3cc36674 100644 --- a/content/quick-start/index.md +++ b/content/quick-start/index.md @@ -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 diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 7c384399..3dea4031 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -2,26 +2,26 @@ {{ 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 -}}
{{ block "header" . }}{{ partial "header/header.html" . }}{{ end }}{{ .Site.Params.footer | safeHTML }}