website: Restructure directory.

* Remove the _ prefix from directories.

* Move cmd/website -> website/cmd.
This commit is contained in:
Qi Xiao 2020-06-14 13:56:58 +01:00
parent ba4f672694
commit 88c1d1514f
36 changed files with 8 additions and 10 deletions

3
website/.gitignore vendored
View File

@ -1,4 +1,5 @@
/home.html
/*/*.html
!/ttyshot/*.html
/tools/*.bin
/_dst
/_tools/*.bin

View File

@ -1,8 +1,8 @@
TOOLS_DIR := ./_tools
TOOLS_DIR := ./tools
DST_DIR = ./_dst
PUBLISH_DIR := ./_publish
MDS := home.md $(wildcard [^_]*/*.md)
MDS := home.md $(filter-out %/README.md,$(wildcard [^_]*/*.md))
HTMLS := $(MDS:.md=.html)
TOOLS := highlight macros elvdoc genblog
@ -12,17 +12,14 @@ default: gen
%.html: %.md $(TOOL_BINARIES) $(TOOLS_DIR)/md-to-html
$(TOOLS_DIR)/md-to-html $< $@
%.bin: %.go
go build -o $@ ./$<
# Generates the website into the dst directory.
gen: tools $(HTMLS)
./_tools/genblog.bin . $(DST_DIR)
ln -sf `pwd`/_favicons/* $(DST_DIR)/
./$(TOOLS_DIR)/genblog.bin . $(DST_DIR)
ln -sf `pwd`/favicons/* $(DST_DIR)/
tools:
for tool in $(TOOLS); do \
go build -o _tools/$$tool.bin ../cmd/website/$$tool; \
go build -o $(TOOLS_DIR)/$$tool.bin ./cmd/$$tool; \
done
genblog:

View File

@ -36,7 +36,7 @@ func expandTtyshot(line string) string {
return line
}
name := line[i+len(ttyshot):]
content, err := ioutil.ReadFile(path.Join("_ttyshot", name+".html"))
content, err := ioutil.ReadFile(path.Join("ttyshot", name+".html"))
if err != nil {
log.Fatal(err)
}

View File

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

View File

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

View File

Before

Width:  |  Height:  |  Size: 935 B

After

Width:  |  Height:  |  Size: 935 B

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB