From 05eeee19b3ffdfb549f096c5e94eb8f2b3552ecb Mon Sep 17 00:00:00 2001 From: decentral1se Date: Tue, 13 Jul 2021 10:41:39 +0200 Subject: [PATCH] Init this site --- .drone.yml | 23 ++ .gitignore | 2 + Dockerfile | 15 + README.md | 5 + archetypes/default.md | 5 + compose.yml | 26 ++ config.toml | 4 + makefile | 6 + themes/lumbung-theme/README.md | 18 + themes/lumbung-theme/archetypes/default.md | 2 + themes/lumbung-theme/layouts/404.html | 0 .../_default/_markdown/render-image.html | 2 + .../layouts/_default/baseof.html | 30 ++ .../lumbung-theme/layouts/_default/list.html | 23 ++ .../layouts/_default/single.html | 16 + themes/lumbung-theme/layouts/index.html | 29 ++ .../layouts/partials/calendar_card.html | 25 ++ .../lumbung-theme/layouts/partials/card.html | 34 ++ .../layouts/partials/footer.html | 5 + .../lumbung-theme/layouts/partials/head.html | 25 ++ .../layouts/partials/header.html | 12 + .../layouts/partials/video_box.html | 26 ++ themes/lumbung-theme/static/css/main.css | 329 ++++++++++++++++++ themes/lumbung-theme/static/css/video-box.css | 155 +++++++++ themes/lumbung-theme/theme.toml | 21 ++ 25 files changed, 838 insertions(+) create mode 100644 .drone.yml create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 archetypes/default.md create mode 100644 compose.yml create mode 100644 config.toml create mode 100644 makefile create mode 100644 themes/lumbung-theme/README.md create mode 100644 themes/lumbung-theme/archetypes/default.md create mode 100644 themes/lumbung-theme/layouts/404.html create mode 100644 themes/lumbung-theme/layouts/_default/_markdown/render-image.html create mode 100644 themes/lumbung-theme/layouts/_default/baseof.html create mode 100644 themes/lumbung-theme/layouts/_default/list.html create mode 100644 themes/lumbung-theme/layouts/_default/single.html create mode 100644 themes/lumbung-theme/layouts/index.html create mode 100644 themes/lumbung-theme/layouts/partials/calendar_card.html create mode 100644 themes/lumbung-theme/layouts/partials/card.html create mode 100644 themes/lumbung-theme/layouts/partials/footer.html create mode 100644 themes/lumbung-theme/layouts/partials/head.html create mode 100644 themes/lumbung-theme/layouts/partials/header.html create mode 100644 themes/lumbung-theme/layouts/partials/video_box.html create mode 100644 themes/lumbung-theme/static/css/main.css create mode 100644 themes/lumbung-theme/static/css/video-box.css create mode 100644 themes/lumbung-theme/theme.toml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..3c5f7f0 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,23 @@ +--- +kind: pipeline +name: deploy beta.lumbung.space +steps: + - name: bundle static + image: plugins/docker + settings: + username: decentral1se + password: + from_secret: docker_reg_passwd + repo: decentral1se/beta.lumbung.space + tags: latest + + - name: deployment + image: decentral1se/stack-ssh-deploy:latest + settings: + stack: beta_lumbung_space + host: lumbung.space + deploy_key: + from_secret: drone_ssh_lumbung.space +trigger: + branch: + - main diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..809f25d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.env +/public/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9b589c9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM klakegg/hugo:latest + +RUN apt update && \ + apt install -y \ + curl \ + git \ + python3 + +EXPOSE 8000 + +COPY . /src/ + +ENTRYPOINT ["/bin/bash"] + +CMD ["-c", "hugo && python3 -m http.server --bind 0.0.0.0 --directory public 8000"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..7f6bad5 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# beta.lumbung.space + +Public front-end for [lumbung.space](https://lumbung.space). + +The theme comes from [git.vvvvvvaria.org/rra/lumbung-theme](https://git.vvvvvvaria.org/rra/lumbung-theme). diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 0000000..26f317f --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,5 @@ +--- +title: "{{ replace .Name "-" " " | title }}" +date: {{ .Date }} +draft: true +--- diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..0b810f9 --- /dev/null +++ b/compose.yml @@ -0,0 +1,26 @@ +--- +version: "3.8" +services: + app: + image: decentral1se/beta.lumbung.space:latest + networks: + - proxy + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8000"] + interval: 10s + timeout: 10s + retries: 10 + start_period: 15s + deploy: + update_config: + failure_action: rollback + order: start-first + labels: + - "traefik.enable=true" + - "traefik.http.routers.coop-cloud-site.rule=Host(`beta.lumbung.space`)" + - "traefik.http.routers.coop-cloud-site.entrypoints=web-secure" + - "traefik.http.services.coop-cloud-site.loadbalancer.server.port=8000" + - "traefik.http.routers.coop-cloud-site.tls.certresolver=production" +networks: + proxy: + external: true diff --git a/config.toml b/config.toml new file mode 100644 index 0000000..bc2e1fe --- /dev/null +++ b/config.toml @@ -0,0 +1,4 @@ +baseURL = "https://beta.lumbung.space" +languageCode = "en-gb" +title = "beta.lumbung.space" +theme = "lumbung-theme" diff --git a/makefile b/makefile new file mode 100644 index 0000000..184625a --- /dev/null +++ b/makefile @@ -0,0 +1,6 @@ +DEFAULT: serve + +serve: + @hugo serve + +.PHONY: serve diff --git a/themes/lumbung-theme/README.md b/themes/lumbung-theme/README.md new file mode 100644 index 0000000..9ec81b9 --- /dev/null +++ b/themes/lumbung-theme/README.md @@ -0,0 +1,18 @@ +# lumbung-theme + +A Hugo theme for lumbung.space + +### Installation + +`cd /my/hugosite/themes` +`git clone https://git.vvvvvvaria.org/rra/lumbung-theme` + +edit `/my/hugosite/config.toml`: + +``` +cat config.toml +baseURL = "http://localhost/" +languageCode = "en-us" +title = "lumbung.space" +theme = 'lumbung-theme' +``` diff --git a/themes/lumbung-theme/archetypes/default.md b/themes/lumbung-theme/archetypes/default.md new file mode 100644 index 0000000..ac36e06 --- /dev/null +++ b/themes/lumbung-theme/archetypes/default.md @@ -0,0 +1,2 @@ ++++ ++++ diff --git a/themes/lumbung-theme/layouts/404.html b/themes/lumbung-theme/layouts/404.html new file mode 100644 index 0000000..e69de29 diff --git a/themes/lumbung-theme/layouts/_default/_markdown/render-image.html b/themes/lumbung-theme/layouts/_default/_markdown/render-image.html new file mode 100644 index 0000000..7d332b9 --- /dev/null +++ b/themes/lumbung-theme/layouts/_default/_markdown/render-image.html @@ -0,0 +1,2 @@ +{{- $image := .Page.Resources.GetMatch (printf "%s" (.Destination | safeURL)) -}} +{{- .PlainText | htmlUnescape -}} diff --git a/themes/lumbung-theme/layouts/_default/baseof.html b/themes/lumbung-theme/layouts/_default/baseof.html new file mode 100644 index 0000000..13acd96 --- /dev/null +++ b/themes/lumbung-theme/layouts/_default/baseof.html @@ -0,0 +1,30 @@ + + + {{- partial "head.html" . -}} + + {{- partial "header.html" . -}} +
+ {{- block "main" . }}{{- end }} +
+ {{- partial "footer.html" . -}} + + + + + diff --git a/themes/lumbung-theme/layouts/_default/list.html b/themes/lumbung-theme/layouts/_default/list.html new file mode 100644 index 0000000..cd6e480 --- /dev/null +++ b/themes/lumbung-theme/layouts/_default/list.html @@ -0,0 +1,23 @@ +{{ define "main" }} +
+
+ {{ range .Pages }} +
+
+
+

{{ .Title }}

+ +
+ {{ if .Truncated }} +
+ {{ .Summary }} +

Read More…

+ {{ else }} +
+ {{ end }} +
+
+
+ {{ end }} +
+{{ end }} diff --git a/themes/lumbung-theme/layouts/_default/single.html b/themes/lumbung-theme/layouts/_default/single.html new file mode 100644 index 0000000..25f08f3 --- /dev/null +++ b/themes/lumbung-theme/layouts/_default/single.html @@ -0,0 +1,16 @@ +{{ define "main" }} +
+ +
+{{ end }} diff --git a/themes/lumbung-theme/layouts/index.html b/themes/lumbung-theme/layouts/index.html new file mode 100644 index 0000000..422a4fc --- /dev/null +++ b/themes/lumbung-theme/layouts/index.html @@ -0,0 +1,29 @@ +{{ define "main" }} +
+
+ {{ range (.Paginator 10).Pages }} + + {{ if in .Params.category "tv"}} + + {{- partial "video_box.html" . -}} + + {{ else if in .Params.category "calendar" }} + + {{- partial "calendar_card.html" . -}} + + {{ else }} + + {{- partial "card.html" . -}} + + {{ end }} + + {{ end }} +
+ + + + +{{ end }} + diff --git a/themes/lumbung-theme/layouts/partials/calendar_card.html b/themes/lumbung-theme/layouts/partials/calendar_card.html new file mode 100644 index 0000000..d8ee10b --- /dev/null +++ b/themes/lumbung-theme/layouts/partials/calendar_card.html @@ -0,0 +1,25 @@ +
+
+
+

{{ .Title }}

+
+
+
+ + {{ .Params.localized_begin | markdownify }} + +
+ + + + +
+
\ No newline at end of file diff --git a/themes/lumbung-theme/layouts/partials/card.html b/themes/lumbung-theme/layouts/partials/card.html new file mode 100644 index 0000000..9154a32 --- /dev/null +++ b/themes/lumbung-theme/layouts/partials/card.html @@ -0,0 +1,34 @@ +
+
+
+

{{ .Title }}

+ +
+ + {{ $img := (.Resources.ByType "image").GetMatch "*featured*" }} + +
+
+ {{ .Summary }} +
+ {{ with $img }} + {{ $thumb := .Resize "400x300"}} +
+ {{ .Title }} +
+ {{ end }} +
+ {{ if .Truncated }} + + {{ end }} + +
+
\ No newline at end of file diff --git a/themes/lumbung-theme/layouts/partials/footer.html b/themes/lumbung-theme/layouts/partials/footer.html new file mode 100644 index 0000000..e033aca --- /dev/null +++ b/themes/lumbung-theme/layouts/partials/footer.html @@ -0,0 +1,5 @@ +
+
+ Imprint - Privacy Policy - Copyright +
+
\ No newline at end of file diff --git a/themes/lumbung-theme/layouts/partials/head.html b/themes/lumbung-theme/layouts/partials/head.html new file mode 100644 index 0000000..3180365 --- /dev/null +++ b/themes/lumbung-theme/layouts/partials/head.html @@ -0,0 +1,25 @@ + + + + + {{ if .IsHome }} {{ .Site.Title }} {{ else }} {{ .Title }} | {{ .Site.Title }} {{ end }} + + {{- if or .Description .Site.Params.description }} + + {{- end }} + {{- if or .Description .Site.Params.description }} + + {{- end }} + + + + + + {{ with .Site.Params.favicon }} + + {{ end }} + + {{ with .OutputFormats.Get "rss" -}} + {{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} + {{ end -}} + diff --git a/themes/lumbung-theme/layouts/partials/header.html b/themes/lumbung-theme/layouts/partials/header.html new file mode 100644 index 0000000..65d7386 --- /dev/null +++ b/themes/lumbung-theme/layouts/partials/header.html @@ -0,0 +1,12 @@ +
+

{{ .Site.Title }}

+ +
\ No newline at end of file diff --git a/themes/lumbung-theme/layouts/partials/video_box.html b/themes/lumbung-theme/layouts/partials/video_box.html new file mode 100644 index 0000000..1ad22af --- /dev/null +++ b/themes/lumbung-theme/layouts/partials/video_box.html @@ -0,0 +1,26 @@ +
+
+ + + +
{{.Params.video_duration}}
+
+
+
+
+
+ +
+ diff --git a/themes/lumbung-theme/static/css/main.css b/themes/lumbung-theme/static/css/main.css new file mode 100644 index 0000000..919c8c2 --- /dev/null +++ b/themes/lumbung-theme/static/css/main.css @@ -0,0 +1,329 @@ +/*nice body-border color combos + +antiquewhite - burlywood +peachpuff - tomato +lightpink - crimson +lightblue - cornflowerblue +palegreen - lightseagreen + +fonts +bungeeshade +allerta +*/ + +:root { + --border-color: tomato; +} + +/*Main Stuff*/ +body { + font-size:16px; + font-family: sans-serif; + color: maroon; +} + + a { + color: #1B4C8A; + } + +* { + box-sizing: border-box; +} + +#content { + margin: 2em auto; + max-width: 80%; + margin-bottom: 0; + } + +.card{ + + border: 2px solid var(--border-color); + box-shadow:1em 1em 0 #d2d1c8; + background-color: #fff09d; + max-width: 600px; + margin-bottom: 2em; + flex: auto; + margin: 0 3em 3em 0; + align-self: start; + + } + + .card{ + background-color: peachpuff; + } + + + .card:nth-child(even){ + transform: rotate(-1deg); + } + + .card:nth-child(odd){ + transform: rotate(1deg); + } + + .card:nth-child(5){ + transform: rotate(2deg); + } + + + .video.box{ + margin-top:3em; + } + + .bar{ + border: 2px solid var(--border-color); + box-shadow: 0.6em 0.6em 0 #d2d1c8; + margin-bottom: 2em; + margin-top:3em; + display: inline-block; + background-color: #fff09d; + } + +.h-feed{ + display: flex; + flex-flow: row wrap; + width: 100%; + +} + +/* base header & menu */ + +#top-menu{ + transform: rotate(-3deg); + margin-left: 2em; +} + +.logo { + margin-left: 0.5em; + margin-right: 0.5em; + margin-top: 0.2em; + margin-bottom: 0.2em; +} + +.logo a { + text-decoration: none; +} + +.menu { + border-top: 2px solid var(--border-color); + margin: 0px; + padding: 0px; + +} + +.menu ul{ + list-style-type: none; + margin: 0; + padding: 0; + display: flex; +} + +.menu-nav-item { + border-right: 2px solid var(--border-color); + padding: 0.5em; +} + +/*Article Summary Cards*/ + +.h-entry header { + display: flex; + border-bottom: 2px solid var(--border-color); +} + +.h-entry header h2{ + padding: 0.2em; + margin: 0; + padding-right: 0.3em; + padding-left: 0.3em; + border-right: 2px solid var(--border-color); +} + +.h-entry header h2:hover{ + box-shadow: inset 4px 4px 0px tomato; + cursor: pointer; +} + +.h-entry header h2 a { + text-decoration: none; + color: var(--border-color); +} + + +.h-entry header .header-metadata{ + margin: 0; + padding: 0.5em; + display: flex; + flex-flow: column wrap; + font-size: 0.9em; + align-content: flex-end; +} + +.p-summary.truncated.image { + display: flex; + flex-direction: row-reverse; +} + +.p-summary.truncated { + display: flex; + flex-direction: column; +} + +.summary-text { + flex: 1; + padding: 1em; + max-height: 300px; + min-width: 20ch; + text-overflow: ellipsis; + overflow: hidden; +} + +.summary-image > img { + height: 100%; + object-fit: cover; + max-width: 100%; + +} + +.summary-image{ + border-right: 2px solid var(--border-color); +} + +footer.post-footer { + display: flex; + flex-flow: row-reverse; +} + +.footer-filler{ + border-top: 2px solid var(--border-color); + flex-grow: 1; +} +.read-more { + border-top: 2px solid var(--border-color); + border-left: 2px solid var(--border-color); + align-content: flex-end; + padding: 0.2em 1em 0.2em 1em; + font-size: 0.9rem; +} + +/* calendar cards */ + +.card.calendar { + border: 2px solid cornflowerblue; + box-shadow:1em 1em 0 #d2d1c8; + background-color: lightblue; + max-width: 300px; + margin-bottom: 2em; + flex: auto; + margin: 0 3em 3em 0; + align-self: start; + color: royalblue; + +} + +.h-entry.calendar header { + display: flex; + border-bottom: 2px solid cornflowerblue; +} + +.h-entry.calendar header h2{ + padding: 0.2em 0.5em 0.2em 0.5em; + margin: 0; + border-right: 2px solid cornflowerblue; +} + +.h-entry.calendar header h2:hover{ + box-shadow: inset 4px 4px 0px royalblue; + cursor: pointer; +} + +.h-entry.calendar header h2 a { + text-decoration: none; + color: royalblue; +} + +.header-filler { + min-width: 10%; +} + +.calendar-location{ + font-size: 0.8rem; + min-width: 20%; + padding: 0.5em 0.9em 0.5em 0.9em; + border-left: 2px solid cornflowerblue; +} + +.calendar-duration{ + font-size: 0.8rem; + border-right: 2px solid cornflowerblue; + padding: 0.5em 0.9em 0.5em 0.9em; +} + +.start-scroller { + display: flex; + flex-flow: row-reverse; + border-bottom: 2px solid cornflowerblue; +} +.start-scroller marquee{ + font-size: 0.8rem; + padding-top: 0.2em; + padding-bottom: 0.2em; +} + +.calendar .description { + border-top: 2px solid cornflowerblue; +} + +/* Card metadata (video & calendar) */ + +.metadata { + display: flex; + justify-content: space-between; + flex-wrap: wrap; +} + +.description p { + margin:0; +} + +input + label +.calendar-location+.description{ + display: none; + } + +input:checked + label +.calendar-location+.description { + display: block; + transition: ease .5s; + } + +.metadata label { + text-align: center; + vertical-align: sub; + flex-grow: 1; + font-weight: normal; + cursor: pointer; + padding: 0.4em 0.9em 0.4em 0.9em; + font-size: 0.9em; +} + +label:hover { + box-shadow: inset 2px 2px 0px #95948c; +} + +.description{ + padding: 0.5em 0.7em 0.7em 0.5em; + overflow: hidden; + flex-basis: 100%; +} + +.descr_button { + cursor: pointer; + flex-grow: 1; + text-align: center; +} + + +/* Page footer */ + +footer.bar { + margin-top:0; +} \ No newline at end of file diff --git a/themes/lumbung-theme/static/css/video-box.css b/themes/lumbung-theme/static/css/video-box.css new file mode 100644 index 0000000..051cd70 --- /dev/null +++ b/themes/lumbung-theme/static/css/video-box.css @@ -0,0 +1,155 @@ +:root { + --video-border-color: burlywood; + --video-background-color: antiquewhite; +} + .video-box { + border:2px solid var(--video-border-color); + max-width:560px; + margin:auto; + box-shadow:1em 1em 0 #d2d1c8; + margin-bottom: 2em; + color: chocolate; + } + + .video-box:nth-child(even){ + transform: rotate(-1deg); + } + + .video-box:nth-child(odd){ + transform: rotate(1deg); + } + + .video-box:nth-child(5){ + transform: rotate(3deg); + } + + + .video-box img { + max-width: 100%; + } + + .video-box iframe { + max-width: 100%; +} + + .video-box .media { + line-height: 0; + } + + .video { + background-color: var(--video-background-color); + } + + .video .metadata{ + font-size:0.9rem; + justify-content: space-between; + flex-wrap: wrap; + } + + .metadata .title{ + margin-top:0; + border-top: 2px solid var(--video-border-color); + border-bottom: 2px solid var(--video-border-color); + padding:0.5em; + font-weight:700; + font-size:1.3rem; + flex-basis: 100%; + } + + .video.channel{ + border-right: 2px solid var(--video-border-color); + padding: 0.5em 0.9em 0.5em 0.9em; + font-size: 0.8rem; + } + + .video.date { + float:right; + border-left: 2px solid var(--video-border-color); + padding: 0.5em 0.9em 0.5em 0.9em; + font-size: 0.8rem; + } + + .video.description { + border-top: 2px solid var(--video-border-color); + padding: 0.8em 0.8em 0.8em 0.8em; + + } + .descr_button a { + color:inherit; + text-decoration: inherit; + } + + input.descr_button { + display: none; + } + + input + label + .video.date + .description{ + display: none; + } + + input:checked + label + .video.date +.description { + display: block; + } + + .play-icon { + width: 0; + height: 0; + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%,-50%) scale(.5); + border-top: 13px solid transparent; + border-bottom: 13px solid transparent; + border-left: 18px solid hsla(0,0%,100%,.95); + } + + .video-thumbnail { + position: absolute; + width: 100%; + height: 100%; + top: 0; + } + .video-thumbnail { + display: flex; + flex-direction: column; + position: relative; + overflow: hidden; + background-color: #ececec; + transition: filter .2s ease; + } + +.video-thumbnail-duration-overlay { + display: inline-block; + background-color: var(--video-background-color); + color: chocolate; + font-size: 14px; + line-height: 1.1; + z-index: 10; + position: absolute; + padding: 1px 3px 1px 3px; + right: 5px; + bottom: 5px; + border: 2px solid var(--video-border-color); + } + + .play-overlay { + transition: all .2s ease; + position: absolute; + right: 0; + bottom: 0; + width: inherit; + height: inherit; + opacity: 0; + background-color: rgba(0,0,0,.3); + cursor: pointer; + } + +.video-thumbnail:hover { + text-decoration:none!important +} +.video-thumbnail:hover .play-overlay { +opacity:1 +} +.video-thumbnail:hover .play-overlay .play-icon { +transform:translate(-50%,-50%) scale(1) +} diff --git a/themes/lumbung-theme/theme.toml b/themes/lumbung-theme/theme.toml new file mode 100644 index 0000000..72ac31f --- /dev/null +++ b/themes/lumbung-theme/theme.toml @@ -0,0 +1,21 @@ +# theme.toml template for a Hugo theme +# See https://github.com/gohugoio/hugoThemes#themetoml for an example + +name = "Lumbung" +license = "AGPL3" +licenselink = "https://github.com/yourname/yourtheme/blob/master/LICENSE" +description = "" +homepage = "http://example.com/" +tags = [] +features = [] +min_version = "0.41.0" + +[author] + name = "" + homepage = "" + +# If porting an existing theme +[original] + name = "" + homepage = "" + repo = ""