4
.gitignore
vendored
@ -1,2 +1,2 @@
|
||||
test.html
|
||||
html/
|
||||
html/
|
||||
build/dist
|
5
build.sh
@ -1,5 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
mkdir -p dist
|
||||
go build -v -ldflags "-X main.Version=`git describe --tags --long` -X main.GitHash=`git rev-parse HEAD` -X main.BuildTime=`date -u '+%Y-%m-%d_%I:%M:%S%p'`" -o dist/mark2web-`cat VERSION`-${GOOS}-${GOARCH}${FILEEXT} mark2web/main.go
|
||||
|
@ -15,15 +15,15 @@ steps:
|
||||
commands:
|
||||
- git submodule update --init --recursive
|
||||
- git fetch --tags
|
||||
- ./build.sh
|
||||
- scripts/build.sh
|
||||
when:
|
||||
event: [ push, tag ]
|
||||
|
||||
- name: test with example content
|
||||
image: alpine
|
||||
commands:
|
||||
- ./dist/mark2web-`cat VERSION`-linux-amd64 -version
|
||||
- ./dist/mark2web-`cat VERSION`-linux-amd64 -in _example -out example_out -create -logLevel debug
|
||||
- dist/mark2web-`cat build/VERSION`-linux-amd64 -version
|
||||
- dist/mark2web-`cat build/VERSION`-linux-amd64 -in example -out example_out -create -logLevel debug
|
||||
when:
|
||||
event: [ push, tag ]
|
||||
|
||||
@ -34,7 +34,7 @@ steps:
|
||||
GOOS: freebsd
|
||||
GOARCH: amd64
|
||||
commands:
|
||||
- ./build.sh
|
||||
- scripts/build.sh
|
||||
when:
|
||||
event: [ tag ]
|
||||
|
||||
@ -45,7 +45,7 @@ steps:
|
||||
GOOS: darwin
|
||||
GOARCH: amd64
|
||||
commands:
|
||||
- ./build.sh
|
||||
- scripts/build.sh
|
||||
when:
|
||||
event: [ tag ]
|
||||
|
||||
@ -57,7 +57,7 @@ steps:
|
||||
GOARCH: amd64
|
||||
FILEEXT: .exe
|
||||
commands:
|
||||
- ./build.sh
|
||||
- scripts/build.sh
|
||||
when:
|
||||
event: [ tag ]
|
||||
|
||||
@ -65,7 +65,7 @@ steps:
|
||||
image: docker
|
||||
commands:
|
||||
- cp dist/mark2web-`cat VERSION`-linux-amd64 mark2web
|
||||
- docker build -t apairon/mark2web .
|
||||
- docker build -t apairon/mark2web build/package
|
||||
volumes:
|
||||
- name: docker
|
||||
path: /var/run/docker.sock
|
||||
@ -81,7 +81,7 @@ steps:
|
||||
from_secret: rsync_pass
|
||||
commands:
|
||||
- /mark2web -version
|
||||
- /mark2web -in _website -out html -create -logLevel info
|
||||
- /mark2web -in website -out html -create -logLevel info
|
||||
- '
|
||||
rsync -rlcgD -i -u -v --stats
|
||||
--delete
|
||||
@ -110,8 +110,8 @@ steps:
|
||||
base_url: https://gitbase.de
|
||||
files:
|
||||
- dist/*
|
||||
title: VERSION
|
||||
note: RELEASE.md
|
||||
title: build/VERSION
|
||||
note: build/RELEASE.md
|
||||
checksum:
|
||||
- md5
|
||||
- sha256
|
||||
@ -121,4 +121,4 @@ steps:
|
||||
volumes:
|
||||
- name: docker
|
||||
host:
|
||||
path: /var/run/docker.sock
|
||||
path: /var/run/docker.sock
|
@ -1,4 +1,4 @@
|
||||
FROM alpine
|
||||
RUN apk update && apk add ca-certificates openssh-client sshpass rsync gzip && rm -r /var/cache/
|
||||
ADD mark2web /
|
||||
ADD ../../mark2web /
|
||||
CMD ["/mark2web"]
|
@ -6,9 +6,9 @@ import (
|
||||
"os"
|
||||
"path"
|
||||
|
||||
"gitbase.de/apairon/mark2web"
|
||||
"gitbase.de/apairon/mark2web/filter"
|
||||
"gitbase.de/apairon/mark2web/helper"
|
||||
"gitbase.de/apairon/mark2web/pkg/filter"
|
||||
"gitbase.de/apairon/mark2web/pkg/helper"
|
||||
"gitbase.de/apairon/mark2web/pkg/mark2web"
|
||||
)
|
||||
|
||||
var (
|
Before Width: | Height: | Size: 247 B After Width: | Height: | Size: 247 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
@ -5,8 +5,8 @@ import (
|
||||
"path"
|
||||
"strings"
|
||||
|
||||
"gitbase.de/apairon/mark2web"
|
||||
"gitbase.de/apairon/mark2web/helper"
|
||||
"gitbase.de/apairon/mark2web/pkg/helper"
|
||||
"gitbase.de/apairon/mark2web/pkg/mark2web"
|
||||
"github.com/ddliu/motto"
|
||||
"github.com/flosch/pongo2"
|
||||
_ "github.com/robertkrimen/otto/underscore"
|
@ -12,8 +12,8 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"gitbase.de/apairon/mark2web"
|
||||
"gitbase.de/apairon/mark2web/helper"
|
||||
"gitbase.de/apairon/mark2web/pkg/helper"
|
||||
"gitbase.de/apairon/mark2web/pkg/mark2web"
|
||||
"github.com/disintegration/imaging"
|
||||
"github.com/flosch/pongo2"
|
||||
)
|
@ -1,8 +1,8 @@
|
||||
package filter
|
||||
|
||||
import (
|
||||
"gitbase.de/apairon/mark2web"
|
||||
"gitbase.de/apairon/mark2web/helper"
|
||||
"gitbase.de/apairon/mark2web/pkg/helper"
|
||||
"gitbase.de/apairon/mark2web/pkg/mark2web"
|
||||
"github.com/flosch/pongo2"
|
||||
)
|
||||
|
@ -1,7 +1,7 @@
|
||||
package filter
|
||||
|
||||
import (
|
||||
"gitbase.de/apairon/mark2web"
|
||||
"gitbase.de/apairon/mark2web/pkg/mark2web"
|
||||
"github.com/flosch/pongo2"
|
||||
)
|
||||
|
@ -1,4 +1,4 @@
|
||||
package mark2web
|
||||
package helper
|
||||
|
||||
import "fmt"
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"gitbase.de/apairon/mark2web/helper"
|
||||
"gitbase.de/apairon/mark2web/pkg/helper"
|
||||
cpy "github.com/otiai10/copy"
|
||||
)
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mark2web
|
||||
|
||||
import "gitbase.de/apairon/mark2web/pkg/helper"
|
||||
|
||||
// CollectionConfig describes a collection
|
||||
type CollectionConfig struct {
|
||||
Name *string `yaml:"Name"`
|
||||
@ -21,7 +23,7 @@ type ThisPathConfig struct {
|
||||
Navname *string `yaml:"Navname"`
|
||||
GoTo *string `yaml:"GoTo"`
|
||||
Collections []*CollectionConfig `yaml:"Collections"`
|
||||
Data MapString `yaml:"Data"`
|
||||
Data helper.MapString `yaml:"Data"`
|
||||
}
|
||||
|
||||
// IndexConfig describes index input and output file
|
||||
@ -81,5 +83,5 @@ type PathConfig struct {
|
||||
Markdown *MarkdownConfig `yaml:"Markdown"`
|
||||
Imaging *ImagingConfig `yaml:"Imaging"`
|
||||
|
||||
Data MapString `yaml:"Data"`
|
||||
Data helper.MapString `yaml:"Data"`
|
||||
}
|
@ -7,7 +7,7 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"gitbase.de/apairon/mark2web/helper"
|
||||
"gitbase.de/apairon/mark2web/pkg/helper"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/flosch/pongo2"
|
||||
cpy "github.com/otiai10/copy"
|
@ -8,7 +8,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"gitbase.de/apairon/mark2web/helper"
|
||||
"gitbase.de/apairon/mark2web/pkg/helper"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/extemporalgenome/slug"
|
||||
"github.com/flosch/pongo2"
|
||||
@ -44,7 +44,7 @@ func (node *TreeNode) handleCollections() {
|
||||
}
|
||||
|
||||
if node.ColMap == nil {
|
||||
node.ColMap = make(MapString)
|
||||
node.ColMap = make(helper.MapString)
|
||||
}
|
||||
ctx := NewContext()
|
||||
ctx["This"] = node.Config.This
|
||||
@ -239,7 +239,7 @@ func Add2Nav(currentNode *TreeNode, pathConfig *PathConfig, tplFilename, outDir
|
||||
}
|
||||
if dataMapKey != "" {
|
||||
if newNode.Config.Data == nil {
|
||||
newNode.Config.Data = make(MapString)
|
||||
newNode.Config.Data = make(helper.MapString)
|
||||
}
|
||||
// as submap in Data
|
||||
newNode.Config.Data[dataMapKey] = ctx
|
@ -1,7 +1,7 @@
|
||||
package mark2web
|
||||
|
||||
import (
|
||||
"gitbase.de/apairon/mark2web/helper"
|
||||
"gitbase.de/apairon/mark2web/pkg/helper"
|
||||
"github.com/flosch/pongo2"
|
||||
)
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"gitbase.de/apairon/mark2web/helper"
|
||||
"gitbase.de/apairon/mark2web/pkg/helper"
|
||||
)
|
||||
|
||||
// NavElement is one element with ist attributes and subs
|
||||
@ -14,7 +14,7 @@ type NavElement struct {
|
||||
GoTo string
|
||||
Active bool
|
||||
|
||||
ColMap MapString
|
||||
ColMap helper.MapString
|
||||
|
||||
Data interface{}
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"path"
|
||||
"strings"
|
||||
|
||||
"gitbase.de/apairon/mark2web/helper"
|
||||
"gitbase.de/apairon/mark2web/pkg/helper"
|
||||
)
|
||||
|
||||
// ResolveNavPath fixes nav target relative to current navigation path
|
@ -1,12 +1,14 @@
|
||||
package mark2web
|
||||
|
||||
import "gitbase.de/apairon/mark2web/pkg/helper"
|
||||
|
||||
// TreeNode is complete config tree of content dir
|
||||
type TreeNode struct {
|
||||
InputPath string
|
||||
OutputPath string
|
||||
Hidden bool // for collections which are not part of the navigation
|
||||
|
||||
ColMap MapString
|
||||
ColMap helper.MapString
|
||||
|
||||
InputFiles []string
|
||||
OtherFiles []string
|
7
scripts/build.sh
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
curdir=$(dirname $0)
|
||||
distdir="$curdir/../dist"
|
||||
|
||||
mkdir -p "$distdir"
|
||||
go build -v -ldflags "-X main.Version=`git describe --tags --long` -X main.GitHash=`git rev-parse HEAD` -X main.BuildTime=`date -u '+%Y-%m-%d_%I:%M:%S%p'`" -o "$distdir/mark2web-`cat $curdir/../build/VERSION`-${GOOS}-${GOARCH}${FILEEXT}" "$curdir/../cmd/mark2web/main.go"
|
Before Width: | Height: | Size: 790 KiB After Width: | Height: | Size: 790 KiB |
Before Width: | Height: | Size: 714 KiB After Width: | Height: | Size: 714 KiB |
Before Width: | Height: | Size: 453 KiB After Width: | Height: | Size: 453 KiB |
Before Width: | Height: | Size: 436 KiB After Width: | Height: | Size: 436 KiB |
Before Width: | Height: | Size: 644 KiB After Width: | Height: | Size: 644 KiB |
Before Width: | Height: | Size: 524 KiB After Width: | Height: | Size: 524 KiB |
Before Width: | Height: | Size: 881 KiB After Width: | Height: | Size: 881 KiB |
Before Width: | Height: | Size: 520 KiB After Width: | Height: | Size: 520 KiB |
Before Width: | Height: | Size: 595 KiB After Width: | Height: | Size: 595 KiB |
Before Width: | Height: | Size: 691 KiB After Width: | Height: | Size: 691 KiB |
Before Width: | Height: | Size: 389 KiB After Width: | Height: | Size: 389 KiB |
Before Width: | Height: | Size: 171 KiB After Width: | Height: | Size: 171 KiB |
Before Width: | Height: | Size: 715 KiB After Width: | Height: | Size: 715 KiB |