From f130e1ac7f75c1421b94096149d0a5507b084864 Mon Sep 17 00:00:00 2001
From: Edward Muller <edward_muller@icloud.com>
Date: Thu, 25 Mar 2021 13:27:01 +0000
Subject: [PATCH] Add support for using as a Hugo module (#534)

---
 exampleSite/config.toml |    5 ++++-
 go.sum                  |    0 
 theme.toml              |    2 +-
 exampleSite/go.mod      |    5 +++++
 go.mod                  |    3 +++
 exampleSite/go.sum      |    2 ++
 CONTRIBUTORS.md         |    1 +
 config.toml             |    5 +++++
 netlify.toml            |   11 +++--------
 9 files changed, 24 insertions(+), 10 deletions(-)

diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 0557035..ab5a42d 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -96,3 +96,4 @@
 - [Ziwei Pan](https://github.com/PanZiwei/)
 - [Viktar Patotski](https://github.com/xp-vit)
 - [cuso4-5h2o](https://www.cuso4.me)
+- [freeformz](https://icanhazdowntime.org)
\ No newline at end of file
diff --git a/config.toml b/config.toml
new file mode 100644
index 0000000..62b395a
--- /dev/null
+++ b/config.toml
@@ -0,0 +1,5 @@
+baseURL = "https://example.com/"
+
+[module]
+[module.hugoVersion]
+min = "0.77.0"
\ No newline at end of file
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 9af81e3..c008e00 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -1,6 +1,5 @@
 baseURL = "http://www.example.com"
 title = "johndoe"
-theme = "hugo-coder"
 languageCode = "en"
 defaultContentLanguage = "en"
 paginate = 20
@@ -11,6 +10,10 @@
 # Enable Disqus comments
 # disqusShortname = "yourdiscussshortname"
 
+[module]
+  [[module.imports]]
+    path = "github.com/luizdepra/hugo-coder"
+
 [params]
 author = "John Doe"
 description = "John Doe's personal website"
diff --git a/exampleSite/go.mod b/exampleSite/go.mod
new file mode 100644
index 0000000..209c82b
--- /dev/null
+++ b/exampleSite/go.mod
@@ -0,0 +1,5 @@
+module github.com/luizdepra/exampleSite
+
+go 1.16
+
+require github.com/luizdepra/hugo-coder v0.0.0-20210316001240-32ffc536aa93 // indirect
diff --git a/exampleSite/go.sum b/exampleSite/go.sum
new file mode 100644
index 0000000..6b1d702
--- /dev/null
+++ b/exampleSite/go.sum
@@ -0,0 +1,2 @@
+github.com/luizdepra/hugo-coder v0.0.0-20210316001240-32ffc536aa93 h1:mTXlzQ5p3ancH7W300Bur7PDScXd2ZKqEdZBM3TTQTE=
+github.com/luizdepra/hugo-coder v0.0.0-20210316001240-32ffc536aa93/go.mod h1:6nu/OxeF5LLM5MBhpzTM40kZi80qCHPm2IXxHI0H+KA=
diff --git a/go.mod b/go.mod
new file mode 100644
index 0000000..9b2ac45
--- /dev/null
+++ b/go.mod
@@ -0,0 +1,3 @@
+module github.com/luizdepra/hugo-coder
+
+go 1.16
diff --git a/go.sum b/go.sum
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/go.sum
diff --git a/netlify.toml b/netlify.toml
index 9a854c6..5234e10 100644
--- a/netlify.toml
+++ b/netlify.toml
@@ -1,14 +1,9 @@
 [build]
+HUGO_VERSION = "0.77.0"
+HUGO_THEME = "repo"
+GO_VERSION = "1.16.2"
 publish = "exampleSite/public"
 command = "cd exampleSite && hugo --themesDir=../.. --baseURL $URL"
 
-[context.production.environment]
-HUGO_VERSION = "0.73.0"
-HUGO_THEME = "repo"
-
 [context.deploy-preview]
 command = "cd exampleSite &&  hugo --themesDir=../.. --buildFuture --buildDrafts --baseURL $DEPLOY_PRIME_URL"
-
-[context.deploy-preview.environment]
-HUGO_VERSION = "0.73.0"
-HUGO_THEME = "repo"
diff --git a/theme.toml b/theme.toml
index 09fe299..42f573e 100644
--- a/theme.toml
+++ b/theme.toml
@@ -20,7 +20,7 @@
   "single-column",
   "syntax-highlighting"
 ]
-min_version = "0.73.0"
+min_version = "0.77.0"
 
 [author]
 name = "Luiz F. A. de PrĂ¡"

--
Gitblit v1.10.0