Add ability for web-viewing

master
Dario Ernst 4 years ago
parent 7b20a28247
commit 42579fe07d

@ -7,7 +7,7 @@ all: hugo $(objects)
$(output)/%.pdf: $(source)/%.md $(output)/%.pdf: $(source)/%.md
chromium --temp-profile --headless --disable-gpu --run-all-compositor-stages-before-draw --allow-file-access-from-files --allow-running-insecure-content --print-to-pdf-no-header --print-to-pdf="$@" "public/print/$(notdir $(basename $@))/print.html" chromium --temp-profile --headless --disable-gpu --run-all-compositor-stages-before-draw --allow-file-access-from-files --allow-running-insecure-content --print-to-pdf-no-header --print-to-pdf="$@" "public/print/$(notdir $(basename $@))/print.html"
.PHONY : clean hugo .PHONY : clean hugo deploy
clean: clean:
rm -rf pdf/ public/ rm -rf pdf/ public/
@ -15,3 +15,7 @@ clean:
hugo: hugo:
hugo hugo
mkdir -p pdf mkdir -p pdf
deploy:
scp -r public/* dario@ghostdub.de:~/www-data/rezepte/
scp pdf/*.pdf dario@ghostdub.de:~/www-data/rezepte/print/

@ -1,10 +1,12 @@
baseURL = "http://example.org/" baseURL = "https://rezepte.kanojo.de/"
languageCode = "en-us" languageCode = "en-us"
title = "My Cookbook" title = "My Cookbook"
theme = "cookbook" theme = "cookbook"
sectionPagesMenu = "main"
# Print output just creates a special route for a print view # Print output just creates a special route for a print view
[outputs] [outputs]
home = ["HTML"]
page = ["PRINT"] page = ["PRINT"]
[outputFormats] [outputFormats]

@ -0,0 +1,8 @@
<!DOCTYPE html>
<html>
<body>
<div id="content">
{{- block "main" . }}{{ end }}
</div>
</body>
</html>

@ -0,0 +1,7 @@
{{ define "main" }}
{{ range $index, $element := .Site.RegularPages }} {{/* Ranging over all the posts */}}
<div class="column is-one-quarter">
{{ partial "summary.html" . }} {{/* pass in the element to the partial */}}
</div>
{{ end }}
{{ end }}

@ -0,0 +1 @@
<a href="{{ .Permalink }}"><p class="title is-4 has-text-centered">{{ $.Title }} </a> (<a href="print/{{ .File.BaseFileName }}.pdf">PDF</a>)</p>
Loading…
Cancel
Save