From f970a659bae62b823ea82b837a578be65b0fa16f Mon Sep 17 00:00:00 2001 From: Patrick Neff Date: Thu, 17 Jan 2019 18:51:01 +0100 Subject: [PATCH 01/10] add local target to makefile --- Makefile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 65d2391..0b043e5 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,6 @@ THEME = neff +LOCAL_DIR = /srv/http/staging +REMOTE_DIR = /srv/http/live REMOTE = dev.test:/var/www/neff-steindesign.dev.test HUGO = /usr/bin/hugo @@ -7,11 +9,15 @@ RSYNC = /usr/bin/rsync JPEGOPTIM = /usr/bin/jpegoptim OPTIPNG = /usr/bin/optipng -.PHONY: all clean server jpegoptim optipng site staging theme +.PHONY: all clean server jpegoptim optipng site staging theme local .SUFFIXES: .jpg .png .md .html .js .css .scss .toml DIRS = content data static themes/$(THEME) resources +HUGO_ARGS = --gc --minify + +IP := $(shell hostname --ip-address) + all: $(DIRS) public/* clean: @@ -22,7 +28,10 @@ theme: $(NPM) --prefix="themes/$(THEME)" run build site: - $(HUGO) --gc + $(HUGO) $(HUGO_ARGS) --destination $(REMOTE_DIR) + +local: + $(HUGO) $(HUGO_ARGS) --baseURL http://$(IP) --destination $(LOCAL_DIR) staging: $(HUGO) --buildDrafts --buildExpired --buildFuture --gc From 95ecbc48d438ac60cb99d20b70cea9084c3cdfe4 Mon Sep 17 00:00:00 2001 From: Patrick Neff Date: Thu, 17 Jan 2019 19:21:01 +0100 Subject: [PATCH 02/10] Add upload target to makefile --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 0b043e5..fa17513 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ THEME = neff LOCAL_DIR = /srv/http/staging REMOTE_DIR = /srv/http/live -REMOTE = dev.test:/var/www/neff-steindesign.dev.test +REMOTE = neff-steindesign.de@ssh.sterato.com:seiten/hugo HUGO = /usr/bin/hugo NPM = /usr/bin/npm @@ -9,7 +9,7 @@ RSYNC = /usr/bin/rsync JPEGOPTIM = /usr/bin/jpegoptim OPTIPNG = /usr/bin/optipng -.PHONY: all clean server jpegoptim optipng site staging theme local +.PHONY: all clean server jpegoptim optipng site staging theme local upload .SUFFIXES: .jpg .png .md .html .js .css .scss .toml DIRS = content data static themes/$(THEME) resources @@ -36,6 +36,9 @@ local: staging: $(HUGO) --buildDrafts --buildExpired --buildFuture --gc +upload: + $(RSYNC) -avz --delete $(REMOTE_DIR)/ $(REMOTE) + server: themes/$(THEME)/package-lock.json themes/$(THEME)/src $(HUGO) server --buildDrafts --buildExpired --buildFuture --gc From 9668ac1c6be47edd387425a07713b7cbb54035b1 Mon Sep 17 00:00:00 2001 From: Patrick Neff Date: Thu, 17 Jan 2019 21:02:53 +0100 Subject: [PATCH 03/10] update social --- themes/neff/layouts/partials/social.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/themes/neff/layouts/partials/social.html b/themes/neff/layouts/partials/social.html index 45d0d1d..25a89cc 100644 --- a/themes/neff/layouts/partials/social.html +++ b/themes/neff/layouts/partials/social.html @@ -1,5 +1,7 @@ From 1e72fd7c0e922ffea6df4607b82a737b22f3e186 Mon Sep 17 00:00:00 2001 From: Patrick Neff Date: Thu, 17 Jan 2019 21:35:55 +0100 Subject: [PATCH 04/10] fix menu --- config.toml | 3 +++ themes/neff/layouts/partials/menu-item.html | 8 ++++++-- themes/neff/layouts/partials/menu.html | 10 +++++++--- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/config.toml b/config.toml index 76dd32f..1f81f03 100644 --- a/config.toml +++ b/config.toml @@ -52,6 +52,7 @@ googleAnalytics = "UA-12671637-1" [[menu.footer]] identifier = "left" weight = -200 + url = "#" [[menu.footer]] identifier = "copyright" @@ -63,6 +64,7 @@ googleAnalytics = "UA-12671637-1" [[menu.footer]] identifier = "mid" weight = -100 + url = "#" [[menu.footer]] identifier = "kontakt" @@ -75,6 +77,7 @@ googleAnalytics = "UA-12671637-1" [[menu.footer]] identifier = "right" weight = 0 + url = "#" [[menu.footer]] identifier = "sitemap" diff --git a/themes/neff/layouts/partials/menu-item.html b/themes/neff/layouts/partials/menu-item.html index b3fc2c4..6e33efb 100644 --- a/themes/neff/layouts/partials/menu-item.html +++ b/themes/neff/layouts/partials/menu-item.html @@ -1,4 +1,6 @@ +{{ .item }} {{- $currentPage := .ctx -}} +{{- $link := .item -}} {{- if (eq .item.Identifier "copyright") -}}
  • @@ -7,9 +9,11 @@
  • {{- else -}}
  • + {{- if ne .item.Title "" -}} - {{ .item.Pre }} - {{ .item.Name }} + {{ $link.Pre }} + {{ $link.Name }} + {{- end -}}
  • {{- end -}} diff --git a/themes/neff/layouts/partials/menu.html b/themes/neff/layouts/partials/menu.html index ad68bd2..ffb57dc 100755 --- a/themes/neff/layouts/partials/menu.html +++ b/themes/neff/layouts/partials/menu.html @@ -3,10 +3,14 @@
      {{- if .HasChildren -}}
    • - - {{ .Pre }} - {{ .Name }} + {{- $pre := .Pre -}} + {{- $name := .Name -}} + {{- with .URL }} + + {{ $pre }} + {{ $name }} + {{- end -}}