mirror of
https://gitlab.com/octospacc/Pignio.git
synced 2025-07-17 22:37:38 +02:00
Add WebManifest, base social metadata, noindex on non-pages; Add /api/items and adapt storing to support it; Improve auth handling and add session verification; Fix #11; Improve editing page with image paste from clipboard and file upload preview; Add footer; Autogenerate config
This commit is contained in:
11
_util.py
Normal file
11
_util.py
Normal file
@ -0,0 +1,11 @@
|
||||
def read_textual(filepath:str) -> str:
|
||||
try:
|
||||
with open(filepath, "r", encoding="utf-8") as f:
|
||||
return f.read()
|
||||
except UnicodeDecodeError:
|
||||
with open(filepath, "r") as f:
|
||||
return f.read()
|
||||
|
||||
def write_textual(filepath:str, content:str):
|
||||
with open(filepath, "w", encoding="utf-8") as f:
|
||||
return f.write(content)
|
Reference in New Issue
Block a user