Compare commits

...

3 Commits

4 changed files with 34 additions and 31 deletions

View File

@ -1,7 +1,7 @@
# Landingpage
## Access
### Locale
http://127.0.0.1:5000
@ -19,12 +19,12 @@ docker build -t application-landingpage .
### Run
#### Development
#### Run Development Environment
```bash
sudo docker run -d -p 5000:5000 --name landingpage -v $(pwd)/app/:/app -e FLASK_APP=app.py -e FLASK_ENV=development application-landingpage
docker run -d -p 5000:5000 --name landingpage -v $(pwd)/app/:/app -e FLASK_APP=app.py -e FLASK_ENV=development application-landingpage
```
#### Production
#### Run Production Environment
```bash
docker run -d -p 5000:5000 --name landingpage application-landingpage
```
@ -32,4 +32,6 @@ docker run -d -p 5000:5000 --name landingpage application-landingpage
### Debug
```bash
docker logs -f landingpage
```
```
## Author
This software was created from [Kevin Veen-Birkenbach](https://www.veen.world/) with the help of [ChatGPT]()

View File

@ -240,12 +240,10 @@ navigation:
class: fa-brands fa-whatsapp
url: https://wa.me/491781798023
identifier: "+491781798023"
warning: |
⚠️ **Caution with Meta Services**
Using software and platforms from the Meta corporation (e.g., Facebook, Instagram, WhatsApp) may compromise your data privacy and digital freedom due to centralized control, extensive data collection practices, and inconsistent moderation policies. These platforms often fail to adequately address harmful content, misinformation, and abuse.
📌 **Recommendation:** Consider using decentralized and privacy-respecting alternatives to maintain control over your data, improve security, and foster healthier online interactions.
alternatives:
- link: navigation.header.contact.matrix
warning: |
Using software and platforms from the Meta corporation (e.g., Facebook, Instagram, WhatsApp) may compromise your data privacy and digital freedom due to centralized control, extensive data collection practices, and inconsistent moderation policies. These platforms often fail to adequately address harmful content, misinformation, and abuse.
footer:
- name: External Accounts
@ -257,13 +255,14 @@ navigation:
description: Social and developer networks
icon:
class: fa-brands fa-meta
url:
subitems:
- name: Instagram
description: Follow me on Instagram
icon:
class: fa-brands fa-instagram
url: https://www.instagram.com/kevinveenbirkenbach/
identifier: kevinveenbirkenbach
link: navigation.header.contact.whatsapp.warning
- name: Facebook
description: Like my Facebook page
icon:

View File

@ -10,7 +10,7 @@
{{ render_subitems(subitem.subitems) }}
</ul>
</li>
{% elif subitem.identifier %}
{% elif subitem.identifier or subitem.warning or subitem.info %}
<li>
<a class="dropdown-item" onclick='openDynamicPopup({{ subitem|tojson|safe }})' data-bs-toggle="tooltip" title="{{ subitem.description }}">
<i class="{{ subitem.icon.class }}"></i> {{ subitem.name }}

View File

@ -1,9 +1,4 @@
class ConfigurationResolver:
"""
A class to resolve `link` entries in a nested configuration structure.
Supports navigation through dictionaries, lists, and `subitems`.
"""
def __init__(self, config):
self.config = config
@ -21,15 +16,22 @@ class ConfigurationResolver:
for key, value in list(current_config.items()):
if key == "link":
try:
target = self._find_entry(root_config, value.lower())
current_config.clear()
current_config.update(target)
# Attempt to find the target entry in the root configuration
target = self._find_entry(root_config, value.lower().replace(" ", "_"))
if isinstance(target, dict):
# Replace the current config dictionary with the target dictionary
current_config.clear()
current_config.update(target)
else:
current_config[value.split(".")[-1]] = target
except Exception as e:
raise ValueError(
f"Error resolving link '{value}': {str(e)}. "
f"Current path: {key}, Current config: {current_config}"
)
else:
# Recurse into nested structures
self._recursive_resolve(value, root_config)
elif isinstance(current_config, list):
for item in current_config:
@ -43,26 +45,26 @@ class ConfigurationResolver:
parts = path.split('.')
current = config
for part in parts:
part = part.replace(" ", "_")
if isinstance(current, list):
# Look for a matching name in the list
# Search for a matching entry in a list
found = next(
(item for item in current if isinstance(item, dict) and item.get("name", "").lower() == part),
(
item
for item in current
if isinstance(item, dict) and item.get("name", "").lower().replace(" ", "_") == part
),
None
)
if found:
print(
f"Matching entry for '{part}' in list. Path so far: {' > '.join(parts[:parts.index(part)+1])}. "
f"Current list: {current}"
)
else:
if not found:
raise ValueError(
f"No matching entry for '{part}' in list. Path so far: {' > '.join(parts[:parts.index(part)+1])}. "
f"Current list: {current}"
)
current = found
elif isinstance(current, dict):
# Case-insensitive dictionary lookup
key = next((k for k in current if k.lower() == part), None)
# Perform a case-insensitive dictionary lookup
key = next((k for k in current if k.lower().replace(" ", "_") == part), None)
if key is None:
raise KeyError(
f"Key '{part}' not found in dictionary. Path so far: {' > '.join(parts[:parts.index(part)+1])}. "
@ -74,9 +76,9 @@ class ConfigurationResolver:
f"Invalid path segment '{part}'. Current type: {type(current)}. "
f"Path so far: {' > '.join(parts[:parts.index(part)+1])}"
)
# Navigate into `subitems` if present
if isinstance(current, dict) and ("subitems" in current and current["subitems"]):
if isinstance(current, dict) and "subitems" in current and current["subitems"]:
current = current["subitems"]
return current