website: Restructure directory.
* Remove the _ prefix from directories. * Move cmd/website -> website/cmd.
3
website/.gitignore
vendored
|
@ -1,4 +1,5 @@
|
|||
/home.html
|
||||
/*/*.html
|
||||
!/ttyshot/*.html
|
||||
/tools/*.bin
|
||||
/_dst
|
||||
/_tools/*.bin
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
}
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 935 B After Width: | Height: | Size: 935 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |