Skip to content

Commit c8a8dbf

Browse files
committed
doc: Fix readme, Makefile
1 parent a035bb7 commit c8a8dbf

4 files changed

Lines changed: 24 additions & 19 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,6 @@ $RECYCLE.BIN/
104104
*.lnk
105105

106106
# End of https://www.toptal.com/developers/gitignore/api/hugo,go,macos,windows,linux
107+
108+
### Internal docs build
109+
/internal/

Makefile

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,38 +17,43 @@ HUGO = $(GO) run -tags extended github.com/gohugoio/hugo
1717
YARN_DEPS = doc/themes/the-things-stack/node_modules
1818
FREQUENCY_PLAN_URL = https://raw.githubusercontent.com/TheThingsNetwork/lorawan-frequency-plans/master/frequency-plans.yml
1919
FREQUENCY_PLAN_DEST = doc/data/frequency-plans.yml
20-
PUBLIC_DEST = public
21-
INTERNAL_DEST = internal
20+
DOC_ROOT = doc
21+
PUBLIC_DEST = ../public # Relative to DOC_ROOT
22+
INTERNAL_DEST = ../internal # Relative to DOC_ROOT
2223
ENVIRONMENT = gh-pages
24+
HUGO_BASE_URL = thethingsindustries.com/docs
2325

2426
.PHONY: default
25-
default: build.internal
27+
default: server
2628

2729
.PHONY: clean.internal
2830
clean.internal:
29-
rm -rf $(INTERNAL_DEST)
31+
cd $(DOC_ROOT) && rm -rf $(INTERNAL_DEST)
3032

3133
.PHONY: clean.public
3234
clean.public:
33-
rm -rf $(PUBLIC_DEST)
35+
cd $(DOC_ROOT) && rm -rf $(PUBLIC_DEST)
36+
37+
.PHONY: clean.deps
38+
clean.deps:
39+
rm -rf $(FREQUENCY_PLAN_DEST)
3440

3541
.PHONY: build.internal
36-
build.internal: $(INTERNAL_DEST) deps
37-
$(HUGO) -d $(INTERNAL_DEST)
42+
build.internal: deps
43+
$(HUGO) --source $(DOC_ROOT) --destination $(INTERNAL_DEST)
3844

3945
.PHONY: build.public
40-
build.public: $(PUBLIC_DEST) deps
41-
$(HUGO) -s "./doc" -d $(PUBLIC_DEST) -b $(HUGO_BASE_URL) --environment $(ENVIRONMENT)
46+
build.public: deps
47+
$(HUGO) --source $(DOC_ROOT) --destination $(PUBLIC_DEST) --baseURL $(HUGO_BASE_URL) --environment $(ENVIRONMENT)
4248

4349
.PHONY: server
4450
server: deps
45-
$(HUGO) server -s "./doc" --environment $(ENVIRONMENT)
51+
$(HUGO) server -s $(DOC_ROOT) --environment $(ENVIRONMENT)
4652

4753
.PHONY: deps
48-
deps: frequency-plan-deps | $(YARN_DEPS)
54+
deps: $(FREQUENCY_PLAN_DEST) | $(YARN_DEPS)
4955

50-
.PHONY: frequency-plan-deps
51-
frequency-plan-deps:
56+
$(FREQUENCY_PLAN_DEST):
5257
curl -o $(FREQUENCY_PLAN_DEST) $(FREQUENCY_PLAN_URL)
5358

5459
$(YARN_DEPS):

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ In order to build the documentation site with the right theme, you need to run
1818
## Running a Development Server
1919

2020
You can start a development server with live reloading by running
21-
`make server`. This command will print the address of the server.
21+
`make` or `make server`. This command will print the address of the server.
2222

2323
## Building the Documentation for Github Pages
2424

25-
The documentation site can be built for Github Pages by running `make build-public`. This will
25+
The documentation site can be built for Github Pages by running `make build.public`. This will
2626
output the site to `public`.
2727

2828
## Building the Documentation for Internal (Offline) Use
2929

30-
The documentation site can be built for internal (offline) use by running `make build` or `make build-internal`. This will
30+
The documentation site can be built for internal (offline) use by running `make build.internal`. This will
3131
output the site to `internal`.
3232

3333
## Style Guidelines

doc/.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
/ttn-lw-*/ttn-lw-*.md
2-
/ttn-lw-*/ttn-lw-*.yaml
3-
/ttn-lw-*/ttn-lw-*.1
41
/resources
52
/public

0 commit comments

Comments
 (0)