diff --git a/modules/wowchemy-plugin-netlify/README.md b/modules/wowchemy-plugin-netlify/README.md new file mode 100644 index 00000000..e62251f2 --- /dev/null +++ b/modules/wowchemy-plugin-netlify/README.md @@ -0,0 +1,21 @@ +# Wowchemy Plugin for Netlify + +A build plugin to integrate your Hugo site seamlessly with Netlify. + +The plugin automatically generates a `_headers` and `_redirects` file at the root of the public folder to configure [HTTP headers](https://www.netlify.com/docs/headers-and-basic-auth/) and [redirects](https://www.netlify.com/docs/redirects/) on Netlify. + +By default, the plugin will help secure your site with some common security headers. You can easily add or replace headers through the plugin config. + +## Install + +1. Edit `config/_default/config.yaml` to install the `wowchemy-plugin-netlify` module: + + ```yaml + module: + imports: + - path: github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-plugin-netlify + ``` + +## Configure + +- 📚 [View the **documentation**](https://wowchemy.com/docs/hugo-tutorials/security/) diff --git a/modules/wowchemy-plugin-netlify/config.yaml b/modules/wowchemy-plugin-netlify/config.yaml new file mode 100644 index 00000000..979573a8 --- /dev/null +++ b/modules/wowchemy-plugin-netlify/config.yaml @@ -0,0 +1,19 @@ +module: + mounts: + - source: src/layouts + target: layouts +mediaTypes: + text/netlify: + delimiter: '' + suffixes: [''] +outputFormats: + headers: + baseName: _headers + isPlainText: true + mediatype: text/netlify + notAlternative: true + redirects: + baseName: _redirects + isPlainText: true + mediatype: text/netlify + notAlternative: true diff --git a/modules/wowchemy-plugin-netlify/go.mod b/modules/wowchemy-plugin-netlify/go.mod new file mode 100644 index 00000000..f1637a5f --- /dev/null +++ b/modules/wowchemy-plugin-netlify/go.mod @@ -0,0 +1,3 @@ +module github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-plugin-netlify + +go 1.15 diff --git a/modules/wowchemy/layouts/index.headers b/modules/wowchemy-plugin-netlify/src/layouts/index.headers similarity index 100% rename from modules/wowchemy/layouts/index.headers rename to modules/wowchemy-plugin-netlify/src/layouts/index.headers diff --git a/modules/wowchemy/layouts/index.redirects b/modules/wowchemy-plugin-netlify/src/layouts/index.redirects similarity index 100% rename from modules/wowchemy/layouts/index.redirects rename to modules/wowchemy-plugin-netlify/src/layouts/index.redirects diff --git a/modules/wowchemy/config.yaml b/modules/wowchemy/config.yaml index 1f47853b..49eeefc2 100644 --- a/modules/wowchemy/config.yaml +++ b/modules/wowchemy/config.yaml @@ -16,21 +16,6 @@ markup: tableOfContents: startLevel: 2 endLevel: 3 -mediaTypes: - text/netlify: - delimiter: '' - suffixes: [''] -outputFormats: - headers: - baseName: _headers - isPlainText: true - mediatype: text/netlify - notAlternative: true - redirects: - baseName: _redirects - isPlainText: true - mediatype: text/netlify - notAlternative: true sitemap: changefreq: weekly module: