Ver Fonte

Updated building a blog part 2

Steffen Cole Blake há 4 anos atrás
pai
commit
95532455b9

+ 8 - 9
content/post/hugo/part-2-building-a-blog.md

@@ -344,6 +344,8 @@ All this tool does is listen on port 9000 and, when triggered, pulls the repo th
 
 Take a moment on your github to note the branch name your repo has, it might be `master` or `main`, this is `<HUGO_BRANCH>` for the below command.
 
+Also once again we will be needing the Repository clone url, `<HUGO_REPOSITORY>`
+
 You also will need to come up with some kind of Secret Password (henceforth called `<HUGO_SECRET>`)
 
 You can find it here
@@ -354,7 +356,7 @@ You can find it here
 
 ```
 
-docker run -d -v C:/www:/www -p 9000:9000 -e HUGO_BRANCH=<HUGO_BRANCH> -e HUGO_SECRET=<HUGO_SECRET> --name build-server steffenblake/webhook-hugo
+docker run -d -v C:/www:/www -p 9000:9000 -e HUGO_BRANCH=<HUGO_BRANCH> -e HUGO_SECRET=<HUGO_SECRET> -e HUGO_REPOSITORY=<HUGO_REPOSITORY> --name build-server steffenblake/webhook-hugo
 
 ```
 
@@ -362,21 +364,21 @@ docker run -d -v C:/www:/www -p 9000:9000 -e HUGO_BRANCH=<HUGO_BRANCH> -e HUGO_S
 
 ```
 
-docker run -d -v /www:/www -p 9000:9000 -e HUGO_BRANCH=<HUGO_BRANCH> -e HUGO_SECRET=<HUGO_SECRET> --name build-server steffenblake/webhook-hugo
+docker run -d -v /www:/www -p 9000:9000 -e HUGO_BRANCH=<HUGO_BRANCH> -e HUGO_SECRET=<HUGO_SECRET> -e HUGO_REPOSITORY=<HUGO_REPOSITORY> --name build-server steffenblake/webhook-hugo
 
 ```
 
 ### Example
-So if my branch is `master` and I want my secret to be `PaSsWoRd123` then I would execute something like:
+So if my branch is `master` and I want my secret to be `PaSsWoRd123` and my repo is at `https://github.com/someone/somerepo.git` then I would execute something like:
 
 ```
 
 
-docker run -d -v C:/www:/www -p 9000:9000 -e HUGO_BRANCH=master -e HUGO_SECRET=PaSsWoRd123 --name build-server steffenblake/webhook-hugo
+docker run -d -v C:/www:/www -p 9000:9000 -e HUGO_BRANCH=master -e HUGO_SECRET=PaSsWoRd123 -e HUGO_REPOSITORY=https://github.com/someone/somerepo.git --name build-server steffenblake/webhook-hugo
 
 ```
 
-We can test if its working by executing the following, with `<YOUR_REPO_URL>` being the https clone url for your websites git repo.
+We can test if its working by executing the following:
 
 ```
 
@@ -385,10 +387,7 @@ curl -L -X POST 'localhost:9000/hooks/build' \
 -H "X-Gitlab-Token: <HUGO_SECRET>" \
 --insecure \
 -d "{
-    \"ref\" : \"<HUGO_BRANCH>\",
-    \"repository\": {
-        \"clone_url\": \"<YOUR_REPO_URL>\"
-    }
+    \"ref\" : \"<HUGO_BRANCH>\"
 }"
 
 ```

+ 1 - 1
layouts/partials/scripts.html

@@ -42,5 +42,5 @@
 
 })();</script>
 {{- range .Site.Params.customJS }}
-  <script src="{{ . | relURL }}{{ slicestr (. | relURL | md5) 0 10 }}"></script>
+  <script src="{{ . | relURL }}?{{ slicestr (. | relURL | md5) 0 10 }}"></script>
 {{- end }}