From 8ad3ca54cc5d64c501140a26df397e097328a2dc Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Wed, 15 Jan 2025 02:08:49 +0100 Subject: [PATCH] Optimized language credentials --- app/config.yaml | 21 +++++++++++++++------ app/utils/configuration_resolver.py | 20 ++++++++------------ 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/app/config.yaml b/app/config.yaml index c8399fb..3f25a6c 100644 --- a/app/config.yaml +++ b/app/config.yaml @@ -1,12 +1,12 @@ --- accounts: - name: Accounts + name: Online Accounts description: My Online Accounts icon: class: fa-solid fa-users children: - - name: Publications - description: My Publications + - name: channels + description: My publication channels icon: class: fas fa-newspaper children: @@ -252,7 +252,7 @@ company: navigation: header: children: - - link: accounts.publications.children + - link: accounts.channels.children - name: Contact description: Get in touch icon: @@ -485,7 +485,16 @@ navigation: icon: class: fa-solid fa-file-lines url: https://s.veen.world/lebenslauf - - link: accounts + - name: Languages + icon: + class: fa-solid fa-language + children: + - link: accounts.duolingo + - name: Languages Credentials + description: Check out which languages I speak + url: https://s.veen.world/languages + icon: + class: fa-solid fa-language - name: Credentials description: Access my certifications, degrees, and professional records icon: @@ -506,7 +515,7 @@ navigation: icon: class: fa-solid fa-scroll url: https://s.veen.world/certifications - + - link: accounts - name: Imprint description: Check out the imprint information icon: diff --git a/app/utils/configuration_resolver.py b/app/utils/configuration_resolver.py index 06725a9..084c3d8 100644 --- a/app/utils/configuration_resolver.py +++ b/app/utils/configuration_resolver.py @@ -48,20 +48,16 @@ class ConfigurationResolver: if isinstance(loaded_link, list): self._replace_in_list_by_list(value,item,loaded_link) else: - self._replace_element_in_list(value,item,loaded_link) + self._replace_element_in_list(value,item,loaded_link) + else: + self._recursive_resolve(value, root_config) elif key == "link": try: - if self.__load_children(value): - loaded = self._find_entry(root_config, value.lower(), False) - self._replace_in_dict_by_dict( - current_config,key,loaded - ) - else: - loaded = self._find_entry(root_config, value.lower(), True) - if isinstance(loaded, list) and len(loaded) > 2: - loaded = self._find_entry(root_config, value.lower(), False) - current_config.clear() - current_config.update(loaded) + loaded = self._find_entry(root_config, value.lower(), True) + if isinstance(loaded, list) and len(loaded) > 2: + loaded = self._find_entry(root_config, value.lower(), False) + current_config.clear() + current_config.update(loaded) except Exception as e: raise ValueError( f"Error resolving link '{value}': {str(e)}. "