improve docs header, nav and social cards

pull/3642/head
Ben Phelps 5 months ago
parent aa33cf7295
commit 4d88ea1883

@ -51,8 +51,7 @@ jobs:
mkdocs-material- mkdocs-material-
- run: sudo apt-get install pngquant - run: sudo apt-get install pngquant
- run: pip install mike - run: pip install mike
- run: pip install mkdocs-material - run: pip install mkdocs-material mkdocs-redirects "mkdocs-material[imaging]"
- run: pip install "mkdocs-material[imaging]"
- name: Test Docs Build - name: Test Docs Build
run: MKINSIDERS=false mkdocs build run: MKINSIDERS=false mkdocs build
deploy: deploy:
@ -78,7 +77,7 @@ jobs:
- run: sudo apt-get install pngquant - run: sudo apt-get install pngquant
- run: pip install mike==2.0.0 - run: pip install mike==2.0.0
- run: pip install git+https://${GH_TOKEN}@github.com/benphelps/mkdocs-material-insiders.git - run: pip install git+https://${GH_TOKEN}@github.com/benphelps/mkdocs-material-insiders.git
- run: pip install "mkdocs-material[imaging]" - run: pip install mkdocs-redirects "mkdocs-material[imaging]"
- name: Set Git config - name: Set Git config
run: | run: |
git config --global user.name "GitHub Action" git config --global user.name "GitHub Action"

@ -1,6 +1,7 @@
--- ---
title: Configuration title: Configuration
description: Homepage Configuration description: Homepage Configuration
icon: material/cog
--- ---
Homepage uses YAML for configuration, YAML stands for "YAML Ain't Markup Language.". It's a human-readable data serialization format that's a superset of JSON. Great for config files, easy to read and write. Supports complex data types like lists and objects. **Indentation matters.** If you already use Docker Compose, you already use YAML. Homepage uses YAML for configuration, YAML stands for "YAML Ain't Markup Language.". It's a human-readable data serialization format that's a superset of JSON. Great for config files, easy to read and write. Supports complex data types like lists and objects. **Indentation matters.** If you already use Docker Compose, you already use YAML.

@ -1,5 +1,7 @@
--- ---
title: Home title: Home
description: A modern, fully static, fast, secure, fully proxied, highly customizable application dashboard with integrations for over 100 services and translations into multiple languages.
icon: material/home
hide: hide:
- navigation - navigation
- toc - toc

@ -1,6 +1,7 @@
--- ---
title: Installation title: Installation
description: Docs intro description: Docs intro
icon: simple/docker
--- ---
<p> <p>

@ -0,0 +1,252 @@
# Copyright (c) 2016-2024 Martin Donath <martin.donath@squidfunk.com>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
# -----------------------------------------------------------------------------
# Configuration
# -----------------------------------------------------------------------------
# Definitions
definitions:
# Background image
- &background_image >-
{{ layout.background_image | x }}
# Background color (default: indigo)
- &background_color >-
{%- if layout.background_color -%}
{{ layout.background_color }}
{%- else -%}
{%- set palette = config.theme.palette or {} -%}
{%- if not palette is mapping -%}
{%- set list = palette | selectattr("primary") | list + palette -%}
{%- set palette = list | first -%}
{%- endif -%}
{%- set primary = palette.get("primary", "indigo") -%}
{%- set primary = primary.replace(" ", "-") -%}
{{ {
"red": "#ef5552",
"pink": "#e92063",
"purple": "#ab47bd",
"deep-purple": "#7e56c2",
"indigo": "#4051b5",
"blue": "#2094f3",
"light-blue": "#02a6f2",
"cyan": "#00bdd6",
"teal": "#009485",
"green": "#4cae4f",
"light-green": "#8bc34b",
"lime": "#cbdc38",
"yellow": "#ffec3d",
"amber": "#ffc105",
"orange": "#ffa724",
"deep-orange": "#ff6e42",
"brown": "#795649",
"grey": "#757575",
"blue-grey": "#546d78",
"black": "#000000",
"white": "#ffffff"
}[primary] or "#4051b5" }}
{%- endif -%}
# Text color (default: white)
- &color >-
{%- if layout.color -%}
{{ layout.color }}
{%- else -%}
{%- set palette = config.theme.palette or {} -%}
{%- if not palette is mapping -%}
{%- set list = palette | selectattr("primary") | list + palette -%}
{%- set palette = list | first -%}
{%- endif -%}
{%- set primary = palette.get("primary", "indigo") -%}
{%- set primary = primary.replace(" ", "-") -%}
{{ {
"red": "#ffffff",
"pink": "#ffffff",
"purple": "#ffffff",
"deep-purple": "#ffffff",
"indigo": "#ffffff",
"blue": "#ffffff",
"light-blue": "#ffffff",
"cyan": "#ffffff",
"teal": "#ffffff",
"green": "#ffffff",
"light-green": "#ffffff",
"lime": "#000000",
"yellow": "#000000",
"amber": "#000000",
"orange": "#000000",
"deep-orange": "#ffffff",
"brown": "#ffffff",
"grey": "#ffffff",
"blue-grey": "#ffffff",
"black": "#ffffff",
"white": "#000000"
}[primary] or "#ffffff" }}
{%- endif -%}
# Font family (default: Roboto)
- &font_family >-
{%- if layout.font_family -%}
{{ layout.font_family }}
{%- elif config.theme.font is mapping -%}
{{ config.theme.font.get("text", "Roboto") }}
{%- else -%}
Roboto
{%- endif -%}
# Font variant
- &font_variant >-
{%- if layout.font_variant -%}
{{ layout.font_variant }}
{%- endif -%}
# Site name
- &site_name >-
{{ config.site_name }}
# Page title
- &page_title >-
{%- if layout.title -%}
{{ layout.title }}
{%- else -%}
{{ page.meta.get("title", page.title) }}
{%- endif -%}
# Page title with site name
- &page_title_with_site_name >-
{%- if not page.is_homepage -%}
{{ page.meta.get("title", page.title) }} - {{ config.site_name }}
{%- else -%}
{{ page.meta.get("title", page.title) }}
{%- endif -%}
# Page description
- &page_description >-
{%- if layout.description -%}
{{ layout.description }}
{%- else -%}
{{ page.meta.get("description", config.site_description) | x }}
{%- endif -%}
# Page icon
- &page_icon >-
{{ page.meta.icon | x }}
# Logo
- &logo >-
{%- if layout.logo -%}
{{ layout.logo }}
{%- elif config.theme.logo -%}
{{ config.docs_dir }}/{{ config.theme.logo }}
{%- endif -%}
# Logo (icon)
- &logo_icon >-
{%- if not layout.logo and config.theme.icon -%}
{{ config.theme.icon.logo | x }}
{%- endif -%}
# Meta tags
tags:
# Open Graph
og:type: website
og:title: *page_title_with_site_name
og:description: *page_description
og:image: "{{ image.url }}"
og:image:type: "{{ image.type }}"
og:image:width: "{{ image.width }}"
og:image:height: "{{ image.height }}"
og:url: "{{ page.canonical_url }}"
# Twitter
twitter:card: summary_large_image
twitter:title: *page_title_with_site_name
twitter:description: *page_description
twitter:image: "{{ image.url }}"
# -----------------------------------------------------------------------------
# Specification
# -----------------------------------------------------------------------------
# Card size and layers
size: { width: 1200, height: 630 }
layers:
# Background
- background:
image: *background_image
color: *background_color
# Page icon
- size: { width: 630, height: 630 }
offset: { x: 800, y: 0 }
icon:
value: *page_icon
color: "#FFFFFF20"
# Logo
- size: { width: 64, height: 64 }
offset: { x: 64, y: 64 }
background:
image: *logo
icon:
value: *logo_icon
color: *color
# Site name
- size: { width: 768, height: 42 }
offset: { x: 160, y: 74 }
typography:
content: *site_name
color: *color
font:
family: *font_family
variant: *font_variant
style: Bold
# Page title
- size: { width: 864, height: 256 }
offset: { x: 62, y: 192 }
typography:
content: *page_title
align: start
color: *color
line:
amount: 3
height: 1.25
font:
family: *font_family
variant: *font_variant
style: Bold
# Page description
- size: { width: 864, height: 64 }
offset: { x: 64, y: 512 }
typography:
content: *page_description
align: start
color: *color
line:
amount: 2
height: 1.5
font:
family: *font_family
variant: *font_variant
style: Regular

@ -1,6 +1,7 @@
--- ---
title: More title: More
description: More homepage resources and guides. description: More homepage resources and guides.
icon: material/information-slab-circle
--- ---
Here you'll find resources and guides for Homepage, troubleshooting tips, and more. Here you'll find resources and guides for Homepage, troubleshooting tips, and more.

@ -1,7 +1,7 @@
--- ---
title: Troubleshooting title: Troubleshooting
description: Basic Troubleshooting description: Basic Troubleshooting
icon: material/message-question
hide: hide:
- navigation - navigation
--- ---

@ -1,6 +1,6 @@
--- ---
title: API Guide title: API Guide
description: How to fetch data from an API in Homepage widgets. description: Get comfortable with making API calls from inside your widget.
--- ---
Homepage provides the `useWidgetAPI` hook to help you fetch data from an API. This hook insures that the data is fetched using a proxy, and is critical for security. Homepage provides the `useWidgetAPI` hook to help you fetch data from an API. This hook insures that the data is fetched using a proxy, and is critical for security.
@ -29,7 +29,7 @@ The `widget` argument is the metadata object for the widget. It contains informa
### `endpoint` ### `endpoint`
The `endpoint` argument is the name of the endpoint to fetch data from. This is [defined in the widget metadata object](widget.md#endpoint). The `useWidgetAPI` hook uses this argument to determine which endpoint to fetch data from. The `endpoint` argument is the name of the endpoint to fetch data from. This is [defined in the widget metadata object](metadata.md#endpoint). The `useWidgetAPI` hook uses this argument to determine which endpoint to fetch data from.
If no endpoint is provided, the `useWidgetAPI` hook will call the API endpoint defined in the widget metadata object directly. If no endpoint is provided, the `useWidgetAPI` hook will call the API endpoint defined in the widget metadata object directly.
@ -47,4 +47,4 @@ export default function Component({ service }) {
} }
``` ```
The `params` must be [whitelisted in the widget metadata object](widget.md#params). This is done to prevent arbitrary query parameters from being passed to the API. The `params` must be [whitelisted in the widget metadata object](metadata.md#params). This is done to prevent arbitrary query parameters from being passed to the API.

@ -1,6 +1,6 @@
--- ---
title: Component Guide title: Component Guide
description: How to create and configure Homepage widget components. description: Learn more about the widget component in Homepage, and how to build your widget UI.
--- ---
Homepage widgets are built using React components. These components are responsible for fetching data from the API and rendering the widget UI. Homepage provides a set of hooks and utilities to help you build your widget component. Homepage widgets are built using React components. These components are responsible for fetching data from the API and rendering the widget UI. Homepage provides a set of hooks and utilities to help you build your widget component.

@ -1,13 +1,14 @@
--- ---
title: Homepage Widget Guides title: Guides & Tutorials
description: How to create and configure Homepage widgets. description: Learn how to create and customize widgets in Homepage. Explore translations, widget components, widget metadata, proxy handlers, and making API calls.
icon: fontawesome/solid/graduation-cap
--- ---
Widgets are a core component of Homepage. They are used to display information about your system, services, and environment. Widgets are a core component of Homepage. They are used to display information about your system, services, and environment.
## Overview ## Overview
If you are new to Homepage widgets, and are looking to create a new widget, please follow along with the guide here: [Widget Guide](guide.md). If you are new to Homepage widgets, and are looking to create a new widget, please follow along with the guide here: [Widget Tutorial](tutorial.md).
### Translations ### Translations
@ -27,7 +28,7 @@ If you are looking to learn more about widget components, please refer to the gu
Widget metadata defines the configuration of the widget. It defines the API endpoint to fetch data from, the proxy handler to use, and any data mappings. Widget metadata defines the configuration of the widget. It defines the API endpoint to fetch data from, the proxy handler to use, and any data mappings.
If you are looking to learn more about widget metadata, endpoint and data mapping, please refer to the guide here: [Metadata Guide](widget.md). If you are looking to learn more about widget metadata, endpoint and data mapping, please refer to the guide here: [Metadata Guide](metadata.md).
If you are looking to learn more about proxy handlers, please refer to the guide here: [Proxies Guide](proxies.md). If you are looking to learn more about proxy handlers, please refer to the guide here: [Proxies Guide](proxies.md).

@ -1,6 +1,6 @@
--- ---
title: Metadata Guide title: Metadata Guide
description: How to create and configure Homepage widget metadata. description: Explore all the metadata properties that can be used to configure a widget in Homepage.
--- ---
Here, we will go over how to create and configure Homepage widget metadata. Metadata is a JS object that contains information about the widget, such as the API endpoint, proxy handler, and mappings. This metadata is used by Homepage to fetch data from the API and pass it to the widget. Here, we will go over how to create and configure Homepage widget metadata. Metadata is a JS object that contains information about the widget, such as the API endpoint, proxy handler, and mappings. This metadata is used by Homepage to fetch data from the API and pass it to the widget.

@ -1,6 +1,6 @@
--- ---
title: Proxies Guide title: Proxies Guide
description: How to use and create Homepage widget proxies. description: Learn about proxy handlers in Homepage, and how to securely fetch data from an API.
--- ---
Homepage includes a set of built-in proxy handlers that can be used to fetch data from an API. We will go over how to use these proxy handlers and briefly cover how to create your own. Homepage includes a set of built-in proxy handlers that can be used to fetch data from an API. We will go over how to use these proxy handlers and briefly cover how to create your own.

@ -1,6 +1,6 @@
--- ---
title: Widget Guide title: Widget Tutorial
description: How to create a custom widget for Homepage. description: Follow along with this guide to learn how to create a custom widget for Homepage. We'll cover the basic structure of a widget, how to use translations, and how to fetch data from an API.
--- ---
In this guide, we'll walk through the process of creating a custom widget for Homepage. We'll cover the basic structure of a widget, how to use translations, and how to fetch data from an API. By the end of this guide, you'll have a solid understanding of how to build your own custom widget. In this guide, we'll walk through the process of creating a custom widget for Homepage. We'll cover the basic structure of a widget, how to use translations, and how to fetch data from an API. By the end of this guide, you'll have a solid understanding of how to build your own custom widget.

@ -1,6 +1,7 @@
--- ---
title: Widgets title: Widgets
description: Homepage info and status widgets. description: Find information on how to configure specific widgets in Homepage.
icon: material/widgets
--- ---
Homepage has two types of widgets: info and service. Below we'll cover each type and how to configure them. Homepage has two types of widgets: info and service. Below we'll cover each type and how to configure them.

@ -1,4 +1,4 @@
site_name: homepage site_name: Homepage
# Project information # Project information
site_url: https://gethomepage.dev/ site_url: https://gethomepage.dev/
@ -144,6 +144,7 @@ nav:
- widgets/services/uptimerobot.md - widgets/services/uptimerobot.md
- widgets/services/urbackup.md - widgets/services/urbackup.md
- widgets/services/watchtower.md - widgets/services/watchtower.md
- widgets/services/wgeasy.md
- widgets/services/whatsupdocker.md - widgets/services/whatsupdocker.md
- widgets/services/xteve.md - widgets/services/xteve.md
- "Information Widgets": - "Information Widgets":
@ -160,15 +161,18 @@ nav:
- widgets/info/search.md - widgets/info/search.md
- widgets/info/unifi_controller.md - widgets/info/unifi_controller.md
- widgets/info/weather.md - widgets/info/weather.md
- "Guides": - "Learn":
- widgets/authoring/index.md - widgets/authoring/index.md
- widgets/authoring/guide.md - "Tutorials":
- widgets/authoring/component.md - widgets/authoring/tutorial.md
- widgets/authoring/widget.md - "Guides":
- widgets/authoring/proxies.md - widgets/authoring/component.md
- widgets/authoring/api.md - widgets/authoring/metadata.md
- widgets/authoring/translations.md - widgets/authoring/proxies.md
- more/troubleshooting.md - widgets/authoring/api.md
- widgets/authoring/translations.md
- "Troubleshooting":
- troubleshooting/index.md
- "More": - "More":
- more/index.md - more/index.md
- more/development.md - more/development.md
@ -259,7 +263,8 @@ plugins:
- optimize - optimize
- typeset - typeset
- social: - social:
cards_layout: default/variant cards_layout_dir: docs/layouts
cards_layout: custom
cards_layout_options: cards_layout_options:
background_image: docs/assets/BlossomValley.jpg background_image: docs/assets/BlossomValley.jpg
background_color: "rgba(13, 29, 41, 128)" background_color: "rgba(13, 29, 41, 128)"
@ -270,3 +275,6 @@ plugins:
- stemmer - stemmer
- stopWordFilter - stopWordFilter
- trimmer - trimmer
- redirects:
redirect_maps:
"more/troubleshooting.md": "troubleshooting/index.md"

Loading…
Cancel
Save