If "fixed_top_menu" boolean is set to True on the "shell" component, the top navigation bar will be fixed at top. However, it spans the entire page width (probably, by design) regardless of layout used and works best with the fluid layout.
This template checks if the font variable starts with a slash and, if so, declares a custom font using @font-face with the name LocalFont. If the font URL does not start with a slash, it assumes it is a Google Fonts URL.
Explanation of Changes
Backward Compatibility:
The font_custom variable is checked to see if it is an array. If not, it is converted to an array using the array helper function.
Handling Multiple Fonts:
The rest of the logic remains the same to handle multiple fonts and generate the necessary @font-face rules and CSS variables.
This approach ensures that the code works correctly whether font_custom is passed as a single string or as a list, maintaining backward compatibility.
Explanation of Changes
Handling Multiple Fonts:
The font_custom variable is treated as an array, and for each font, a @font-face rule is generated if the font URL starts with / (indicating a local font).
The CSS variables are dynamically named using the font name, replacing spaces and slashes to ensure valid CSS variable names.
Google Fonts:
Google Fonts are handled by filtering the font_custom array to include only those fonts that do not start with /.
Multiple Google Fonts are included by iterating over this filtered list and generating the necessary <link> tags.
CSS Variables:
CSS variables are created for each font in the :root selector. Local fonts will have _custom appended to their names to avoid conflicts with Google Fonts.
This setup enables the registration and usage of multiple fonts, both locally stored and from Google Fonts, ensuring broad compatibility and flexibility for the user.
menu_item accepts plain strings, which causes parse_json to throw an error. Assume that menu_item is a plain string not starting with "{", a string containing a valid JSON object (the first character is "{"), or a parsed JSON. parse_json only behaves properly if it receives a JSON object or a string representing a valid JSON object (in this case, the first character must be "{").
The "table" component template will now set the width property of the table component div to "fit-content" if the table defines a boolean "overflow" attribute set to TRUE.
- automatically center the map on the contents when no top-level latitude and longitude properties are provided even when the map contains geojson data.
- allow using `FALSE as tile_source` to completely remove the base map. This makes the map component useful to display even non-geographical geometric data.
In this updated version, the image_og variable is conditionally checked and included in the <head> section to provide the Open Graph image metadata if it is available.