-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathREADME.html
More file actions
33 lines (32 loc) · 8.03 KB
/
README.html
File metadata and controls
33 lines (32 loc) · 8.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Markmap</title>
<style>
* {
margin: 0;
padding: 0;
}
#mindmap {
display: block;
width: 100vw;
height: 100vh;
}
</style>
</head>
<body>
<svg id="mindmap"></svg>
<script src="https://cdn.jsdelivr.net/npm/d3@5"></script><script src="https://cdn.jsdelivr.net/npm/markmap-lib@0.7.11/dist/browser/view.min.js"></script><script>((data, init, items, opts) => {
const {
Markmap,
loadPlugins
} = window.markmap;
(init ? init(loadPlugins, items, opts) : Promise.resolve()).then(() => {
Markmap.create('svg#mindmap', null, data);
});
})({"t":"heading","d":1,"v":"Docker Compose for creation and development of an <a href=\"https://gohugo.io/documentation/\" title=\"\" target=\"_blank\" rel=\"noopener noreferrer\">Hugo</a> static site generator instance","c":[{"t":"heading","d":2,"v":"Video"},{"t":"heading","d":2,"v":"Refs","c":[{"t":"list_item","d":3,"v":"<a href=\"https://docs.docker.com/compose/install/\" title=\"\" target=\"_blank\" rel=\"noopener noreferrer\">Install Docker Compose</a> on your development system"},{"t":"list_item","d":3,"v":"<a href=\"https://hub.docker.com/r/klakegg/hugo/\" title=\"\" target=\"_blank\" rel=\"noopener noreferrer\">klakegg/hugo images recommended by Hugo docs</a>"},{"t":"list_item","d":3,"v":"<a href=\"https://vsupalov.com/cleaning-up-after-docker/\" title=\"\" target=\"_blank\" rel=\"noopener noreferrer\">Vladislav Supalov's very useful article: Cleaning Up After Docker</a>"}]},{"t":"heading","d":2,"v":"Requirements","c":[{"t":"list_item","d":3,"v":"You must have docker-compose <a href=\"https://docs.docker.com/compose/install/\" title=\"\" target=\"_blank\" rel=\"noopener noreferrer\">installed and running</a> on your development system"}]},{"t":"heading","d":2,"v":"What's the plan","c":[{"t":"list_item","d":3,"v":"Use docker compose to scaffold an Hugo app from scratch,<br/>even without having installed Hugo on your system, and clean up afterwards"},{"t":"list_item","d":3,"v":"Use another docker compose file to bring up your newly created Hugo App in your favorite IDE<br/>and develop in a hot reloading environment"},{"t":"list_item","d":3,"v":"You can install several different apps, using in each case different Hugo releases and types<br/>and of course container names!"}]},{"t":"heading","d":2,"v":"Clone or download this repo","c":[{"t":"list_item","d":3,"v":"<a href=\"https://github.com/demystifying-dev/docker-compose-hugo-app-builder.git\" title=\"\" target=\"_blank\" rel=\"noopener noreferrer\">clone this GitHub repo</a>, or"},{"t":"list_item","d":3,"v":"(or as an alternative, download interactively <a href=\"https://github.com/demystifying-dev/docker-compose-hugo-app-builder/archive/master.zip\" title=\"\" target=\"_blank\" rel=\"noopener noreferrer\">from this link</a>)<br/>and unpack into any workspace folder reserved for Hugo projects","c":[{"t":"list_item","d":4,"v":"<pre><code class=\"language-bash\">$ git clone git@github.com:demystifying-dev/docker-compose-hugo-app-builder.git\n$ cd docker-compose-hugo-app-builder\n</code></pre>"}]}]},{"t":"heading","d":2,"v":"Create one or more Hugo app instances","c":[{"t":"list_item","d":3,"v":"Specify the site name in the <code>.env</code> file","c":[{"t":"list_item","d":4,"v":"<pre><code class=\"language-bash\">$ cat .env\nSITE=hugodockerftw\n</code></pre>"}]},{"t":"list_item","d":3,"v":"Scaffold the code for your Hugo app","c":[{"t":"list_item","d":4,"v":"<pre><code class=\"language-bash\">$ ./create.sh \nhugodockerftw\nCreating network "docker-compose-hugo-app-builder_default" with the default driver\nCreating hugodockerftw ... done\nAttaching to hugodockerftw\nhugodockerftw | Congratulations! Your new Hugo site is created in /src/hugodockerftw.\nhugodockerftw | \nhugodockerftw | Just a few more steps and you're ready to go:\nhugodockerftw | \nhugodockerftw | 1. Download a theme into the same-named folder.\nhugodockerftw | Choose a theme from https://themes.gohugo.io/ or\nhugodockerftw | create your own with the "hugo new theme <THEMENAME>" command.\nhugodockerftw | 2. Perhaps you want to add some content. You can add single files\nhugodockerftw | with "hugo new <SECTIONNAME>/<FILENAME>.<FORMAT>".\nhugodockerftw | 3. Start the built-in live server via "hugo server".\nhugodockerftw | \nhugodockerftw | Visit https://gohugo.io/ for quickstart guide and full documentation.\nhugodockerftw exited with code 0\nRemoving hugodockerftw ... done\nRemoving network docker-compose-hugo-app-builder_default\n</code></pre>"}]},{"t":"list_item","d":3,"v":"Note that it runs, asks you for sudo privileges,<br/>then cleans up, according to .env and docker-compose file,<br/>and we are left simply with the scaffolded source files","c":[{"t":"list_item","d":4,"v":"<pre><code class=\"language-bash\">$ docker-compose -f docker-compose.create.yml ps\nName Command State Ports\n------------------------------\n$ tree -a hugodockerftw\nhugodockerftw/\n├── archetypes\n│ └── default.md\n├── config.toml\n├── content\n├── data\n├── docker-compose.yml\n├── .env\n├── .gitignore\n├── layouts\n├── static\n└── themes\n</code></pre>"}]}]},{"t":"heading","d":2,"v":"Enter the app instance folder and docker up","c":[{"t":"list_item","d":3,"v":"Run","c":[{"t":"list_item","d":4,"v":"<pre><code class=\"language-\">$ cd hugodockerftw\n$ mkdir layouts/_default\n$ echo "Hello brave world!" > layouts/_default/list.html\n$ docker-compose up\nStarting hugodockerftw ... done\nAttaching to hugodockerftw\nhugodockerftw | Building sites … \nhugodockerftw | | EN \nhugodockerftw | -------------------+-----\nhugodockerftw | Pages | 6 \nhugodockerftw | Paginator pages | 0 \nhugodockerftw | Non-page files | 0 \nhugodockerftw | Static files | 0 \nhugodockerftw | Processed images | 0 \nhugodockerftw | Aliases | 0 \nhugodockerftw | Sitemaps | 1 \nhugodockerftw | Cleaned | 0 \nhugodockerftw | \nhugodockerftw | Built in 1 ms\nhugodockerftw | Watching for changes in /src/{archetypes,content,data,layouts,static}\nhugodockerftw | Watching for config changes in /src/config.toml\nhugodockerftw | Environment: "DEV"\nhugodockerftw | Serving pages from memory\nhugodockerftw | Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender\nhugodockerftw | Web Server is available at http://localhost:1313/ (bind address 0.0.0.0)\nhugodockerftw | Press Ctrl+C to stop\n</code></pre>"}]},{"t":"list_item","d":3,"v":"Point your browser at http://localhost:1313"},{"t":"list_item","d":3,"v":"Make some changes in any IDE or text editor","c":[{"t":"list_item","d":4,"v":"<pre><code class=\"language-bash\">$ code .\n</code></pre>"}]},{"t":"list_item","d":3,"v":"Indeed, go forth and create 1,2 many Hugo apps!"},{"t":"list_item","d":3,"v":"Ctrl-C when finished to bring the container down"},{"t":"list_item","d":3,"v":"If you wish to clean up to the last possible vestige, do","c":[{"t":"list_item","d":4,"v":"<pre><code class=\"language-bash\">$ docker-compose down -v --rmi all --remove-orphans\n</code></pre>"}]},{"t":"list_item","d":3,"v":"In any case, you are still left with the code you have developed"}]},{"t":"heading","d":2,"v":"Thanks!","c":[{"t":"list_item","d":3,"v":"To <a href=\"https://gohugo.io/\" title=\"\" target=\"_blank\" rel=\"noopener noreferrer\">Hugo SSG</a>"},{"t":"list_item","d":3,"v":"To <a href=\"https://docs.docker.com/compose/\" title=\"\" target=\"_blank\" rel=\"noopener noreferrer\">Docker Compose</a>"},{"t":"list_item","d":3,"v":"To the fantastic <a href=\"https://hub.docker.com/r/klakegg/hugo/\" title=\"\" target=\"_blank\" rel=\"noopener noreferrer\">Hugo Docker image always kept up to date and offering so many alternatives</a>,<br/>only two of which we're using here, but we will be using more"}]}]})</script>
</body>
</html>