mirror of
https://github.com/leoncvlt/loconotion.git
synced 2024-08-30 18:12:12 +00:00
Added safety check for 'slug' parameter in [site] table
This commit is contained in:
parent
74a16b8a17
commit
dbff4e0ddb
@ -130,6 +130,12 @@ class Parser():
|
||||
def get_page_config(self, token):
|
||||
# starts by grabbing the gobal site configuration table, if exists
|
||||
site_config = self.config.get("site", {})
|
||||
|
||||
# check if there's anything wrong with the site config
|
||||
if (site_config.get("slug", None)):
|
||||
log.error("'slug' parameter has no effect in the [site] table, and should only present in page tables.")
|
||||
del site_config['slug']
|
||||
|
||||
# find a table in the configuration file whose key contains the passed token string
|
||||
matching_page_config = [value for key, value in self.config.items() if key.lower() in token]
|
||||
if (matching_page_config):
|
||||
|
@ -25,7 +25,4 @@ page = "https://www.notion.so/A-Notion-Page-03c403f4fdc94cc1b315b9469a8950ef"
|
||||
|
||||
[[d2fa06f244e64f66880bb0491f58223d.meta]]
|
||||
name = "description"
|
||||
content = "A fullscreen list database page"
|
||||
|
||||
[d2fa06f244e64f66880bb] #list page
|
||||
slug = "list"
|
||||
content = "A fullscreen list database page"
|
Loading…
Reference in New Issue
Block a user