From e3bd2ecc2ca874270282c3c42813b8053d67dcbd Mon Sep 17 00:00:00 2001 From: luixal Date: Thu, 7 Jan 2021 09:39:58 +0100 Subject: Adds multiple pages based on different config files --- public/assets/page2.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 public/assets/page2.yml (limited to 'public') diff --git a/public/assets/page2.yml b/public/assets/page2.yml new file mode 100644 index 0000000..e10d706 --- /dev/null +++ b/public/assets/page2.yml @@ -0,0 +1,39 @@ +# this config is used by a page linked in the navbar +# this pages will use the same configuration from config.yml, but will overwrite fields present here + +# this overwrites title and subtitle: +title: "Page2" +subtitle: "this is the second page" + +# this overwrites message config. Setting it to empty to remove message from this page and keep it only in the main one: +message: + +# as we want to include a differente link here (so we can get back to home page), we need to replicate all links or they will be revome when overwriting the links field: +links: + - name: "Home" + icon: "fas fa-home" + url: "/" + - name: "Contribute" + icon: "fab fa-github" + url: "https://github.com/bastienwirtz/homer" + target: "_blank" # optional html a tag target attribute + - name: "Wiki" + icon: "fas fa-book" + url: "https://www.wikipedia.org/" + +# we keep the first group from the main page, but remove the second group. We need to replicate that first group or it will be removed: +services: + - name: "NEW" + icon: "fas fa-cloud" + items: + - name: "Awesome app" + logo: "assets/tools/sample.png" + subtitle: "Bookmark example" + tag: "app" + url: "https://www.reddit.com/r/selfhosted/" + target: "_blank" + - name: "Another one" + logo: "assets/tools/sample2.png" + subtitle: "Another application" + tag: "app" + url: "#" -- cgit v1.2.3 From c6267296ec03db24ff40959ef58eedcec904c39b Mon Sep 17 00:00:00 2001 From: luixal Date: Tue, 23 Feb 2021 20:50:32 +0100 Subject: Changes relative paths to hash. Avoids problems with #8 --- public/assets/page2.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'public') diff --git a/public/assets/page2.yml b/public/assets/page2.yml index e10d706..00001e9 100644 --- a/public/assets/page2.yml +++ b/public/assets/page2.yml @@ -26,14 +26,9 @@ services: - name: "NEW" icon: "fas fa-cloud" items: - - name: "Awesome app" + - name: "Awesome app on a second page!" logo: "assets/tools/sample.png" subtitle: "Bookmark example" tag: "app" url: "https://www.reddit.com/r/selfhosted/" target: "_blank" - - name: "Another one" - logo: "assets/tools/sample2.png" - subtitle: "Another application" - tag: "app" - url: "#" -- cgit v1.2.3 From ba07da6b1011e77c9ed42e8643e62b903c6c6d7b Mon Sep 17 00:00:00 2001 From: Bastien Wirtz Date: Sat, 6 Mar 2021 22:50:58 -0800 Subject: Avoid full reload when swithcing page. --- public/assets/additionnal-page.yml.dist | 35 +++++++++++++++++++++++++++++++++ public/assets/config.yml.dist | 5 +++++ public/assets/page2.yml | 34 -------------------------------- 3 files changed, 40 insertions(+), 34 deletions(-) create mode 100644 public/assets/additionnal-page.yml.dist delete mode 100644 public/assets/page2.yml (limited to 'public') diff --git a/public/assets/additionnal-page.yml.dist b/public/assets/additionnal-page.yml.dist new file mode 100644 index 0000000..f918dc1 --- /dev/null +++ b/public/assets/additionnal-page.yml.dist @@ -0,0 +1,35 @@ +--- +# Additionnal page configuration + +# Additionnal configurations are loaded using its file name, minus the extension, as an anchor (https://#). +# `config.yml` is still used as a base configuration, and all values here will overwrite it, so you don't have to re-defined everything + + +subtitle: "this is another dashboard page" + +# This overwrites message config. Setting it to empty to remove message from this page and keep it only in the main one: +message: ~ + +# as we want to include a differente link here (so we can get back to home page), we need to replicate all links or they will be revome when overwriting the links field: +links: + - name: "Home" + icon: "fas fa-home" + url: "#" + - name: "Contribute" + icon: "fab fa-github" + url: "https://github.com/bastienwirtz/homer" + target: "_blank" # optional html a tag target attribute + - name: "Wiki" + icon: "fas fa-book" + url: "https://www.wikipedia.org/" + +services: + - name: "More applications on another page!" + icon: "fas fa-cloud" + items: + - name: "Awesome app on a second page!" + logo: "assets/tools/sample.png" + subtitle: "Bookmark example" + tag: "app" + url: "https://www.reddit.com/r/selfhosted/" + target: "_blank" diff --git a/public/assets/config.yml.dist b/public/assets/config.yml.dist index 85478ec..65c5098 100644 --- a/public/assets/config.yml.dist +++ b/public/assets/config.yml.dist @@ -56,6 +56,11 @@ links: - name: "Wiki" icon: "fas fa-book" url: "https://www.wikipedia.org/" + # this will link to a second homer page that will load config from additionnal-page.yml and keep default config values as in config.yml file + # see url field and assets/additionnal-page.yml.dist used in this example: + - name: "another page!" + icon: "fas fa-file-alt" + url: "#additionnal-page" # Services # First level array represent a group. diff --git a/public/assets/page2.yml b/public/assets/page2.yml deleted file mode 100644 index 00001e9..0000000 --- a/public/assets/page2.yml +++ /dev/null @@ -1,34 +0,0 @@ -# this config is used by a page linked in the navbar -# this pages will use the same configuration from config.yml, but will overwrite fields present here - -# this overwrites title and subtitle: -title: "Page2" -subtitle: "this is the second page" - -# this overwrites message config. Setting it to empty to remove message from this page and keep it only in the main one: -message: - -# as we want to include a differente link here (so we can get back to home page), we need to replicate all links or they will be revome when overwriting the links field: -links: - - name: "Home" - icon: "fas fa-home" - url: "/" - - name: "Contribute" - icon: "fab fa-github" - url: "https://github.com/bastienwirtz/homer" - target: "_blank" # optional html a tag target attribute - - name: "Wiki" - icon: "fas fa-book" - url: "https://www.wikipedia.org/" - -# we keep the first group from the main page, but remove the second group. We need to replicate that first group or it will be removed: -services: - - name: "NEW" - icon: "fas fa-cloud" - items: - - name: "Awesome app on a second page!" - logo: "assets/tools/sample.png" - subtitle: "Bookmark example" - tag: "app" - url: "https://www.reddit.com/r/selfhosted/" - target: "_blank" -- cgit v1.2.3