Skip to content

Commit 734e2f7

Browse files
Merge pull request #2870 from jasonrandrews/review2
update Hugo setup to remove Gitpod
2 parents 51eef8a + 4a3c98e commit 734e2f7

2 files changed

Lines changed: 39 additions & 78 deletions

File tree

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
# User change
32
title: "Troubleshooting"
43

54
weight: 12 # 1 is first, 2 is second, etc.
@@ -9,21 +8,46 @@ layout: "learningpathall"
98
---
109
## Hugo Server Issues
1110

12-
### Hugo server is not staging or detecting my content updates when I publish the server, How to fix it?
11+
### Why doesn't Hugo show my changes when I'm editing my markdown files?
1312

14-
There could be multiple reasons for the Hugo server not detecting your content updates. Please try the following steps in order:
13+
There could be multiple reasons for the Hugo server not detecting your content updates.
1514

16-
* Check that you are pusblishing the server from the right directorty where you are updating your learning path (You might have multiple locations where you are updating and saving your content to and you could be starting the server from the wrong location/directory).
15+
Please try the following steps in order:
1716

18-
* Your Browser might be caching the older version of your server/pages. Please clear your browser history or turn off cashing or simple open a new private tab/window and call your page from there.
17+
1. Check that you are running the server from the right directory
18+
19+
You might have multiple locations where you are updating and saving your content to and you could be starting the server from the wrong location/directory.
20+
21+
2. Confirm the port number
22+
23+
The first port number used is 1313. If you run a second `hugo server` command a new port will be chosen. Your browser may be connected to a different Hugo server than you expect.
24+
25+
3. Draft mode is activated
26+
27+
Draft mode is used during content review and editing to avoid publishing Learning Paths before they are ready.
28+
29+
If you see draft settings as shown below in an _index.md or at the top of an install guide it means draft mode is on.
30+
31+
```console
32+
draft: true
33+
cascade:
34+
draft: true
35+
```
36+
37+
To see the content in the browser you have two options:
38+
39+
1. Remove the draft mode tags.
40+
41+
2. Run Hugo with the draft flag.
42+
43+
This tells Hugo to render the draft articles.
1944

20-
* Draft mode is activated: sometimes when we return back your learning path after we review it for adjustments, we usually enable "Draft Mode" which will not stage any new content to be published. Once you pull back the learning path changes "Draft Mode" will be activated by default. To fix this issue you can try one of the following options:
21-
1. Remove the "Draft Mode" tags. Ususally, you will find "draft: true" tag(s) on the main/first page of your learning path (it could also be in other pages). Simply comment out those tags or remove them till you are done with your updates and rerun the Hugo server again.
22-
2. Rerun the server using the following options:
2345
```bash
24-
hugo server --buildDrafts=false
46+
hugo server --buildDrafts=true
2547
```
48+
2649
or
50+
2751
```bash
2852
hugo server -D
2953
```

content/learning-paths/cross-platform/_example-learning-path/setup.md

Lines changed: 6 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ Three possible ways to set up a development machine are covered below.
3535
Select **one** that works for you. Please share other ways that work for you
3636

3737
- A [local computer (Linux, macOS, or Windows)](#option-1-set-up-a-local-computer)
38-
- A [Gitpod instance](#option-2-set-up-gitpod) with tools pre-installed (easiest to set up and manage)
39-
- A [remote Linux server](#option-3-set-up-a-remote-linux-server) via SSH (on your local network or from a Cloud Service Provider)
38+
- A [remote Linux server](#option-2-set-up-a-remote-linux-server) via SSH (on your local network or from a Cloud Service Provider)
4039

4140
## Option 1: Set up a local computer
4241

@@ -89,8 +88,9 @@ Check Hugo is installed correctly and check the version by running this command:
8988
hugo version
9089
```
9190

92-
Navigate into the `arm-learning-paths` folder and run hugo to launch a
93-
development version of website on your machine.
91+
Most recent versions of Hugo will work, but you may face errors if the version is too old.
92+
93+
Navigate into the `arm-learning-paths` folder and run hugo to launch a development version of website on your machine.
9494

9595
```bash
9696
cd arm-learning-paths
@@ -107,37 +107,7 @@ Open a browser and go to [http://localhost:1313](http://localhost:1313)
107107

108108
You are now ready to start developing content. The content creation process consists of editing the markdown files for Learning Paths and viewing the changes on your computer using Hugo.
109109

110-
## Option 2: Set up Gitpod
111-
112-
The second option is to use Gitpod as a development environment.
113-
114-
[Gitpod](https://www.gitpod.io/) is a cloud development environment (CDE) which makes it easy to create software from any computer.
115-
116-
Instead of installing tools on your local computer, you can create and modify content directly in Gitpod. The repository is configured to initialize a Gitpod instance with all tools/software you need to start contributing right away.
117-
118-
Visit your fork of the GitHub project in your browser.
119-
120-
Install the [Gitpod Chrome Extension](https://chrome.google.com/webstore/detail/gitpod-always-ready-to-co/dodmmooeoklaejobgleioelladacbeki) which installs a Gitpod button in your GitHub projects.
121-
122-
If you do not want install the browser extension, you can also prefix the URL for your fork of the GitHub project with gitpod.io/# to open the project in Gitpod.
123-
124-
Either way, open the repository in Gitpod. The URL looks like this: https://gitpod.io/#github.com/ArmDeveloperEcosystem/arm-learning-paths (replace with the path to your fork).
125-
126-
You can use your GitHub credentials, or select another authentication method to login to Gitpod and use the Free plan which offers 500 credits (about 50 hours) per month.
127-
128-
A new project will open in the browser. This is VS Code with the project loaded in your browser.
129-
130-
All the required tools are installed automatically by Gitpod during the environment setup.
131-
132-
A view of the generated site is also opened automatically. The website view is not easy to see because it's in a sub-window of VS Code.
133-
134-
To move the website view into another browser tab, click on the top right corner. The tooltip for this click is “open in browser”.
135-
136-
This gives you a private version of the content in a new tab to review.
137-
138-
You are now ready to edit markdown files and view the results in the Gitpod environment.
139-
140-
## Option 3: Set up a remote Linux server
110+
## Option 2: Set up a remote Linux server
141111

142112
The third option for Learning Path development is to use a remote Linux server, such as an AWS EC2 instance or other cloud virtual machine. The remote Linux server can also be on your local network.
143113

@@ -184,41 +154,8 @@ You are now ready to edit markdown files and view the results on the Hugo server
184154

185155
{{% notice Note %}}
186156

187-
If your content is not updating/staging on your web browser after you save it correctly then please check the [Troubleshooting section](/learning-paths/cross-platform/_example-learning-path/appendix-5-troubleshooting/) for debugging instructions.
157+
If your content is not updating/staging on your web browser after you save it correctly then please check the [Troubleshooting section](/learning-paths/cross-platform/_example-learning-path/appendix-5-troubleshooting/).
188158

189159
{{%/notice%}}
190160

191-
## Enable the search box on the home page {#search}
192-
193-
When you run `hugo server` you will not see the search box on the home page. You don't need to do anything for the search feature to find your content, but you may want to enable the search box and test it during your development.
194-
195-
The search feature requires search index data to be created. If the data is available, the search box will appear on the home page.
196-
197-
To see the search box run the following commands before you run `hugo server` as described above:
198-
199-
```console
200-
hugo
201-
pagefind --site "public" --output-subdir ../static/pagefind
202-
```
203-
204-
If you have `pagefind` installed on your computer, or if your computer is supported by one of the `pagefind` in the `bin/` directory, then you can run the `hugo-server.sh` script, located at the top of the repository, to create the search index and start the server. If no suitable `pagefind` is available for your computer, the server will still be launched, but without the search index.
205-
206-
| Pagefind executable | OS |
207-
| ---------------------- | ----------------------- |
208-
| `bin/pagefind` | Linux (x86) |
209-
| `bin/pagefind.aarch64` | Linux (aarch64) |
210-
| `bin/pagefind.arm64` | macOS (Apple Silicon) |
211-
| `bin/pagefind.exe` | Windows (x86) |
212-
213-
214-
For example, if you are working on Arm Linux you generate the search index using:
215-
216-
```console
217-
bin/pagefind.aarch64 --site "public" --output-subdir ../static/pagefind
218-
```
219-
220-
{{% notice Note %}}
221-
The search index does not automatically update as you enter content. You can run `hugo` and `pagefind` again and restart `hugo server` to update the search index with your current content.
222-
{{% /notice %}}
223-
224161
The next section will cover how to create and format Learning Paths.

0 commit comments

Comments
 (0)