mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-14 07:04:27 -04:00
Add custom archive directory as configuration option.
This commit is contained in:
parent
0a75dee583
commit
17d07239f0
4 changed files with 11 additions and 7 deletions
5
index.py
5
index.py
|
@ -7,6 +7,7 @@ from config import (
|
|||
INDEX_TEMPLATE,
|
||||
INDEX_ROW_TEMPLATE,
|
||||
ARCHIVE_PERMISSIONS,
|
||||
ARCHIVE_DIR,
|
||||
ANSI,
|
||||
chmod_file,
|
||||
)
|
||||
|
@ -33,10 +34,10 @@ def dump_index(links, service):
|
|||
'rows': article_rows,
|
||||
}
|
||||
|
||||
with open(os.path.join(service, 'index.html'), 'w', encoding='utf-8') as f:
|
||||
with open(os.path.join(ARCHIVE_DIR, service, 'index.html'), 'w', encoding='utf-8') as f:
|
||||
f.write(Template(index_html).substitute(**template_vars))
|
||||
|
||||
chmod_file(service, permissions=ARCHIVE_PERMISSIONS)
|
||||
chmod_file(os.path.join(ARCHIVE_DIR, service), permissions=ARCHIVE_PERMISSIONS)
|
||||
|
||||
print('[+] [{}] Created archive index with {}{}{} links.'.format(
|
||||
datetime.now().strftime('%Y-%m-%d %H:%M:%S'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue