From 6f3c075669cf0c525e9b070ce30f061270e49f91 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 29 Jan 2022 18:53:15 +0100 Subject: [PATCH] feat: add prettier --- .drone.yml | 88 ++++----- .prettierignore | 5 + .prettierrc | 15 ++ layouts/404.html | 35 ++-- layouts/_default/baseof.html | 16 ++ layouts/_default/list.html | 47 +++-- layouts/_default/single.html | 12 +- layouts/doc/single.html | 18 +- layouts/index.html | 88 +++++---- layouts/partials/footer.html | 206 ++++++++++++++------- layouts/partials/header.html | 111 ++++++----- layouts/partials/menu.html | 40 ++-- layouts/partials/navbar.html | 54 ++++-- layouts/partials/plausible-tracking.html | 9 +- layouts/partials/prose.html | 4 +- layouts/partials/vikunja-cloud-banner.html | 10 +- layouts/post/list.html | 141 ++++++++------ layouts/post/single.html | 23 +-- layouts/shortcodes/table_of_contents.html | 4 +- package.json | 48 ++--- src/style.css | 8 +- static/fonts/fonts.css | 40 ++-- tailwind.config.js | 22 +-- yarn.lock | 22 +++ 24 files changed, 635 insertions(+), 431 deletions(-) create mode 100644 .prettierignore create mode 100644 .prettierrc create mode 100644 layouts/_default/baseof.html diff --git a/.drone.yml b/.drone.yml index a25a1a9..80ab285 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,59 +2,59 @@ kind: pipeline name: build trigger: - event: - - push + event: + - push steps: - - name: build - image: node:16 - pull: true - group: build-static - commands: - - yarn --frozen-lockfile - - yarn prod - - yarn clean - - yarn release + - name: build + image: node:16 + pull: true + group: build-static + commands: + - yarn --frozen-lockfile + - yarn prod + - yarn clean + - yarn release - - name: release - image: plugins/s3:1 - pull: true - settings: - bucket: vikunja-releases - access_key: - from_secret: aws_access_key_id - secret_key: - from_secret: aws_secret_access_key - endpoint: https://s3.fr-par.scw.cloud - region: fr-par - path_style: true - strip_prefix: dist/ - source: dist/vikunja-theme.tar.gz - target: /theme/ - when: - event: [ push ] - branch: [ main ] + - name: release + image: plugins/s3:1 + pull: true + settings: + bucket: vikunja-releases + access_key: + from_secret: aws_access_key_id + secret_key: + from_secret: aws_secret_access_key + endpoint: https://s3.fr-par.scw.cloud + region: fr-par + path_style: true + strip_prefix: dist/ + source: dist/vikunja-theme.tar.gz + target: /theme/ + when: + event: [push] + branch: [main] --- kind: pipeline name: trigger-website-update trigger: - branch: - - main - event: - - push + branch: + - main + event: + - push depends_on: - - build + - build steps: - - name: trigger - image: plugins/downstream - settings: - server: https://drone.kolaente.de - token: - from_secret: drone_token - repositories: - - vikunja/website@main - - vikunja/blog@main - - vikunja/api@main + - name: trigger + image: plugins/downstream + settings: + server: https://drone.kolaente.de + token: + from_secret: drone_token + repositories: + - vikunja/website@main + - vikunja/blog@main + - vikunja/api@main diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..6ee77fb --- /dev/null +++ b/.prettierignore @@ -0,0 +1,5 @@ +.idea/ +node_modules/ +static/css/*.css +dist/ +yarn-error.log diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..4a6c636 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,15 @@ +{ + "tabWidth": 4, + "useTabs": true, + "goTemplateBracketSpacing": true, + "printWidth": 100, + "singleQuote": true, + "overrides": [ + { + "files": ["*.html"], + "options": { + "parser": "go-template" + } + } + ] +} diff --git a/layouts/404.html b/layouts/404.html index 6955867..80737bf 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -1,13 +1,22 @@ -{{ partial "header.html" . }} - -
-

- Page not found -

- - - - - Back to home page - -
+{{ define "main" }} +
+

Page not found

+ + + + + Back to home page + +
+{{ end }} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..318ecc8 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,16 @@ + + + + + {{ partial "header.html" . }} + + + {{ partial "navbar.html" . }} + + {{ block "main" . }} + + {{ end }} + + {{ partial "footer.html" . }} + + diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 98406bd..e17eeef 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,25 +1,24 @@ -{{ partial "header.html" . }} - -
-
- {{ partial "menu" . }} -
-
-
- {{ partial "headline-hash.html" . }} - - {{ range .Pages.GroupBy "Section" }} -

{{ .Key | title }}

-
    - {{ range .Pages }} -
  • - {{ .Title }} -
  • +{{ define "main" }} +
    +
    {{ partial "menu" . }}
    +
    +
    + {{ partial "headline-hash.html" . }} + {{ range .Pages.GroupBy + "Section" + }} +

    {{ .Key | title }}

    + {{ end }} -
- {{ end }} -
-
-
- -{{ partial "footer.html" . }} + + + +{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 083e65a..3c52671 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,7 +1,5 @@ -{{ partial "header.html" . }} - -
- {{ partial "prose.html" .Content }} -
- -{{ partial "footer.html" . }} +{{ define "main" }} +
+ {{ partial "prose.html" .Content }} +
+{{ end }} diff --git a/layouts/doc/single.html b/layouts/doc/single.html index 50e7d8f..afc48ff 100644 --- a/layouts/doc/single.html +++ b/layouts/doc/single.html @@ -1,12 +1,8 @@ -{{ partial "header.html" . }} - -
-
- {{ partial "menu" . }} +{{ define "main" }} +
+
{{ partial "menu" . }}
+
+ {{ partial "prose.html" .Content }} +
-
- {{ partial "prose.html" .Content }} -
-
- -{{ partial "footer.html" . }} +{{ end }} diff --git a/layouts/index.html b/layouts/index.html index 120bda4..999b002 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,41 +1,55 @@ -{{ partial "header.html" . }} +{{ define "main" }} +
+
+ {{ if .Params.heading }} + {{ if .Params.heading.heading }} +

+ {{ .Params.heading.heading | markdownify }} +

+ {{ end }} + {{ if .Params.heading.content }} +

+ {{ .Params.heading.content | markdownify }} +

+ {{ end }} + {{ if .Params.heading.subtitle }} +

+ {{ .Params.heading.subtitle | markdownify }} +

+ {{ end }} + {{ if .Params.heading.subsubtitle }} +

+ {{ .Params.heading.subsubtitle | markdownify }} +

+ {{ end }} -
-
- {{ if .Params.heading }} - {{ if .Params.heading.heading }} -

{{.Params.heading.heading | markdownify}}

- {{end}} - {{ if .Params.heading.content }} -

{{.Params.heading.content | markdownify}}

- {{end}} - {{ if .Params.heading.subtitle }} -

{{.Params.heading.subtitle | markdownify}}

- {{end}} - {{ if .Params.heading.subsubtitle }} -

{{.Params.heading.subsubtitle | markdownify}}

- {{end}} - {{end}} + {{ end }} - -
-
- - - - - -
-
- -{{ partial "footer.html" . }} +
+ + + + + +
+
+{{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 7828614..78fbe06 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,109 +1,171 @@ -