From f92368186f6a7d1eb629ec1105b49922e756d02c Mon Sep 17 00:00:00 2001 From: KemoNine Date: Sat, 18 Mar 2023 12:41:19 -0400 Subject: [PATCH] mobile decap cms integration --- static/.gitkeep => .hugo_build.lock | 0 public/admin/mobile/config.yml | 18 +++++ public/admin/mobile/index.html | 15 +++++ public/admin/mobile/mobile-overrides.css | 85 ++++++++++++++++++++++++ public/categories/index.xml | 10 +++ public/index.xml | 10 +++ public/sitemap.xml | 11 +++ public/tags/index.xml | 10 +++ static/admin/mobile/config.yml | 18 +++++ static/admin/mobile/index.html | 15 +++++ static/admin/mobile/mobile-overrides.css | 85 ++++++++++++++++++++++++ 11 files changed, 277 insertions(+) rename static/.gitkeep => .hugo_build.lock (100%) create mode 100644 public/admin/mobile/config.yml create mode 100644 public/admin/mobile/index.html create mode 100644 public/admin/mobile/mobile-overrides.css create mode 100644 public/categories/index.xml create mode 100644 public/index.xml create mode 100644 public/sitemap.xml create mode 100644 public/tags/index.xml create mode 100644 static/admin/mobile/config.yml create mode 100644 static/admin/mobile/index.html create mode 100644 static/admin/mobile/mobile-overrides.css diff --git a/static/.gitkeep b/.hugo_build.lock similarity index 100% rename from static/.gitkeep rename to .hugo_build.lock diff --git a/public/admin/mobile/config.yml b/public/admin/mobile/config.yml new file mode 100644 index 0000000..7333a48 --- /dev/null +++ b/public/admin/mobile/config.yml @@ -0,0 +1,18 @@ +media_folder: "static/uploads" +public_folder: "/uploads" +backend: + name: git-gateway + branch: main +collections: + - name: "blog" # Used in routes, e.g., /admin/collections/blog + label: "Blog" # Used in the UI + folder: "_posts/blog" # The path to the folder where the documents are stored + create: true # Allow users to create new documents in this collection + slug: "{{year}}-{{month}}-{{day}}-{{slug}}" # Filename template, e.g., YYYY-MM-DD-title.md + fields: # The fields for each document, usually in front matter + - {label: "Layout", name: "layout", widget: "hidden", default: "blog"} + - {label: "Title", name: "title", widget: "string"} + - {label: "Publish Date", name: "date", widget: "datetime"} + - {label: "Featured Image", name: "thumbnail", widget: "image"} + - {label: "Rating (scale of 1-5)", name: "rating", widget: "number"} + - {label: "Body", name: "body", widget: "markdown"} diff --git a/public/admin/mobile/index.html b/public/admin/mobile/index.html new file mode 100644 index 0000000..416173a --- /dev/null +++ b/public/admin/mobile/index.html @@ -0,0 +1,15 @@ + + + + + + + + Content Manager + + + + + + + diff --git a/public/admin/mobile/mobile-overrides.css b/public/admin/mobile/mobile-overrides.css new file mode 100644 index 0000000..565491f --- /dev/null +++ b/public/admin/mobile/mobile-overrides.css @@ -0,0 +1,85 @@ +@media (max-width: 799px) { + + [class*=BackCollection], + [class*=BackStatus] { + font-size: .6rem; + } + + [class*=AppHeaderContent], + [class*=AppMainContainer] { + margin-right: 0; + margin-left: 0; + min-width: calc(100vw - 24px); + max-width: 100vw; + } + + [class*=AppHeaderContent] { + display: flex; + justify-content: space-between; + } + + [class*=AppHeaderQuickNewButton] { + width: 100%; + } + + [class*=AppHeaderButton] { + padding-left: 4px; + padding-right: 4px; + } + + [class*=EditorContainer], + [class*=ToolbarContainer] { + min-width: initial; + } + + [class*=ToolbarSubSectionFirst] { + display: flex; + flex-direction: column; + } + + [class*=PublishedToolbarButton] { + padding: 0 8px; + } + + [class*=PublishedToolbarButton]::after { + display: none; + } + + [class*=DeleteButton] { + margin-top: 5px; + padding: 0 2px; + } + + [class*=ViewControls] { + position: initial; + } + + [class*=PreviewPaneContainer-ControlPaneContainer] { + padding: 0; + } + + [class*=ControlPaneContainer] { + max-width: 100vw; + } + + + [class*=EditorControlBar] [class*=ToolbarContainer] { + display: flex; + flex-direction: column; + } + + [class*=CollectionContainer] { + display: flex; + flex-direction: column; + } + + [class*=SidebarContainer] { + position: initial; + width: initial; + } + + [class*=CollectionMain] { + padding-left: 0; + margin-top: 20px; + } +} diff --git a/public/categories/index.xml b/public/categories/index.xml new file mode 100644 index 0000000..b92677a --- /dev/null +++ b/public/categories/index.xml @@ -0,0 +1,10 @@ + + + + Categories on My New Hugo Site + http://example.org/categories/ + Recent content in Categories on My New Hugo Site + Hugo -- gohugo.io + en-us + + diff --git a/public/index.xml b/public/index.xml new file mode 100644 index 0000000..da90485 --- /dev/null +++ b/public/index.xml @@ -0,0 +1,10 @@ + + + + My New Hugo Site + http://example.org/ + Recent content on My New Hugo Site + Hugo -- gohugo.io + en-us + + diff --git a/public/sitemap.xml b/public/sitemap.xml new file mode 100644 index 0000000..45379db --- /dev/null +++ b/public/sitemap.xml @@ -0,0 +1,11 @@ + + + + http://example.org/categories/ + + http://example.org/ + + http://example.org/tags/ + + diff --git a/public/tags/index.xml b/public/tags/index.xml new file mode 100644 index 0000000..201eda6 --- /dev/null +++ b/public/tags/index.xml @@ -0,0 +1,10 @@ + + + + Tags on My New Hugo Site + http://example.org/tags/ + Recent content in Tags on My New Hugo Site + Hugo -- gohugo.io + en-us + + diff --git a/static/admin/mobile/config.yml b/static/admin/mobile/config.yml new file mode 100644 index 0000000..7333a48 --- /dev/null +++ b/static/admin/mobile/config.yml @@ -0,0 +1,18 @@ +media_folder: "static/uploads" +public_folder: "/uploads" +backend: + name: git-gateway + branch: main +collections: + - name: "blog" # Used in routes, e.g., /admin/collections/blog + label: "Blog" # Used in the UI + folder: "_posts/blog" # The path to the folder where the documents are stored + create: true # Allow users to create new documents in this collection + slug: "{{year}}-{{month}}-{{day}}-{{slug}}" # Filename template, e.g., YYYY-MM-DD-title.md + fields: # The fields for each document, usually in front matter + - {label: "Layout", name: "layout", widget: "hidden", default: "blog"} + - {label: "Title", name: "title", widget: "string"} + - {label: "Publish Date", name: "date", widget: "datetime"} + - {label: "Featured Image", name: "thumbnail", widget: "image"} + - {label: "Rating (scale of 1-5)", name: "rating", widget: "number"} + - {label: "Body", name: "body", widget: "markdown"} diff --git a/static/admin/mobile/index.html b/static/admin/mobile/index.html new file mode 100644 index 0000000..416173a --- /dev/null +++ b/static/admin/mobile/index.html @@ -0,0 +1,15 @@ + + + + + + + + Content Manager + + + + + + + diff --git a/static/admin/mobile/mobile-overrides.css b/static/admin/mobile/mobile-overrides.css new file mode 100644 index 0000000..565491f --- /dev/null +++ b/static/admin/mobile/mobile-overrides.css @@ -0,0 +1,85 @@ +@media (max-width: 799px) { + + [class*=BackCollection], + [class*=BackStatus] { + font-size: .6rem; + } + + [class*=AppHeaderContent], + [class*=AppMainContainer] { + margin-right: 0; + margin-left: 0; + min-width: calc(100vw - 24px); + max-width: 100vw; + } + + [class*=AppHeaderContent] { + display: flex; + justify-content: space-between; + } + + [class*=AppHeaderQuickNewButton] { + width: 100%; + } + + [class*=AppHeaderButton] { + padding-left: 4px; + padding-right: 4px; + } + + [class*=EditorContainer], + [class*=ToolbarContainer] { + min-width: initial; + } + + [class*=ToolbarSubSectionFirst] { + display: flex; + flex-direction: column; + } + + [class*=PublishedToolbarButton] { + padding: 0 8px; + } + + [class*=PublishedToolbarButton]::after { + display: none; + } + + [class*=DeleteButton] { + margin-top: 5px; + padding: 0 2px; + } + + [class*=ViewControls] { + position: initial; + } + + [class*=PreviewPaneContainer-ControlPaneContainer] { + padding: 0; + } + + [class*=ControlPaneContainer] { + max-width: 100vw; + } + + + [class*=EditorControlBar] [class*=ToolbarContainer] { + display: flex; + flex-direction: column; + } + + [class*=CollectionContainer] { + display: flex; + flex-direction: column; + } + + [class*=SidebarContainer] { + position: initial; + width: initial; + } + + [class*=CollectionMain] { + padding-left: 0; + margin-top: 20px; + } +}