commit c9b5d9c0c49592aa959ec45b6a5d3a9bde2f9a24 Author: Señor Rolando Date: Sun Dec 10 15:41:51 2023 +0100 Hugo-Rahmen für johannesjesse.de diff --git a/.env_sample b/.env_sample new file mode 100644 index 0000000..8be7b34 --- /dev/null +++ b/.env_sample @@ -0,0 +1,4 @@ +# -*- mode: shell-script -*- +export DEPLOY_SSH_USER=insert-remote-username +export DEPLOY_SSH_HOST=insert-remote-hostname +export DEPLOY_SSH_PATH=insert-remote-path diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f21e467 --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +# requires: source .env +build: + @ hugo + +deploy: build + @ rsync -axv --delete --ignore-errors --exclude .DS_Store --exclude .git public/ $(DEPLOY_SSH_USER)@$(DEPLOY_SSH_HOST):$(DEPLOY_SSH_PATH) diff --git a/README.md b/README.md new file mode 100644 index 0000000..eea0ff9 --- /dev/null +++ b/README.md @@ -0,0 +1,18 @@ + +``` +mkdir static/photos/new-gallery-name && copy all fotos in there +hugo new new-gallery-name.md +``` + +In `content/new-gallery-name.md`: + +``` +{{< load-photoswipe >}} +{{< gallery dir="/photos/new-gallery-name/" />}}` +``` + +Run: + +``` +hugo server -D +``` diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 0000000..00e77bd --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,6 @@ +--- +title: "{{ replace .Name "-" " " | title }}" +date: {{ .Date }} +draft: true +--- + diff --git a/hugo.toml b/hugo.toml new file mode 100644 index 0000000..968968c --- /dev/null +++ b/hugo.toml @@ -0,0 +1,51 @@ +baseURL = "https://johannesjesse.de" +languageCode = "de-de" +defaultContentLanguage = "de" +title = "Johannes" +theme = "hermit" +# enableGitInfo = true +pygmentsCodefences = true +pygmentsUseClasses = true +# hasCJKLanguage = true # If Chinese/Japanese/Korean is your main content language, enable this to make wordCount works right. + +disableKinds = ["RSS", "sitemap", "section"] + +enableEmoji = true # Shorthand emojis in content files - https://gohugo.io/functions/emojify/ +# googleAnalytics = "UA-123-45" +# disqusShortname = "yourdiscussshortname" + +[author] + name = "Johannes" + +[blackfriday] + # hrefTargetBlank = true + # noreferrerLinks = true + # nofollowLinks = true + +[params] + dateform = "Jan 2, 2006" + dateformShort = "Jan 2" + dateformNum = "2006-01-02" + dateformNumTime = "2006-01-02 15:04 -0700" + + # Metadata mostly used in document's head + # description = "" + # images = [""] + themeColor = "#494f5c" + + homeSubtitle = "Hier gibt's nichts zu sehen." + footerCopyright = '' + # bgImg = "" # Homepage background-image URL + + # Prefix of link to the git commit detail page. GitInfo must be enabled. + # gitUrl = "https://github.com/username/repository/commit/" + + # Toggling this option needs to rebuild SCSS, requires Hugo extended version + justifyContent = false # Set "text-align: justify" to `.content`. + + relatedPosts = false # Add a related content section to all single posts page + + code_copy_button = false # Turn on/off the code-copy-button for code-fields + + # Add custom css + # customCSS = ["css/foo.css", "css/bar.css"] diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html new file mode 100644 index 0000000..38924da --- /dev/null +++ b/layouts/shortcodes/figure.html @@ -0,0 +1,29 @@ + + +{{- if not ($.Page.Scratch.Get "figurecount") }}{{ end }} +{{- $.Page.Scratch.Add "figurecount" 1 -}} + +{{- $thumb := .Get "src" | default (printf "%s." (.Get "thumb") | replace (.Get "link") ".") }} +
+
+
+ +
+ {{ with .Get "link" | default (.Get "src") }}{{ end }} + {{- if or (or (.Get "title") (.Get "caption")) (.Get "attr")}} +
+ {{- with .Get "title" }}

{{.}}

{{ end }} + {{- if or (.Get "caption") (.Get "attr")}} +

+ {{- .Get "caption" -}} + {{- with .Get "attrlink"}}{{ .Get "attr" }}{{ else }}{{ .Get "attr"}}{{ end -}} +

+ {{- end }} +
+ {{- end }} +
+
diff --git a/layouts/shortcodes/gallery.html b/layouts/shortcodes/gallery.html new file mode 100644 index 0000000..aac2ace --- /dev/null +++ b/layouts/shortcodes/gallery.html @@ -0,0 +1,41 @@ + + +{{- if not ($.Page.Scratch.Get "figurecount") }}{{ end }} +{{- $.Page.Scratch.Add "figurecount" 1 }} +{{ $baseURL := .Site.BaseURL }} + diff --git a/layouts/shortcodes/load-photoswipe-theme.html b/layouts/shortcodes/load-photoswipe-theme.html new file mode 100644 index 0000000..4b3bfad --- /dev/null +++ b/layouts/shortcodes/load-photoswipe-theme.html @@ -0,0 +1,75 @@ + + + +{{ if not ($.Page.Scratch.Get "photoswipeloaded") }} + {{ $.Page.Scratch.Set "photoswipeloaded" 1 }} + + + + + + + + + + + +{{ end }} \ No newline at end of file diff --git a/layouts/shortcodes/load-photoswipe.html b/layouts/shortcodes/load-photoswipe.html new file mode 100644 index 0000000..9eec863 --- /dev/null +++ b/layouts/shortcodes/load-photoswipe.html @@ -0,0 +1,71 @@ + + + +{{ if not ($.Page.Scratch.Get "photoswipeloaded") }} + {{ $.Page.Scratch.Set "photoswipeloaded" 1 }} + + + + + + + + + + + + + +{{ end }} \ No newline at end of file