mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-14 07:04:27 -04:00
add template staticfiles
This commit is contained in:
parent
73c8a9e158
commit
f7015d2594
6 changed files with 7 additions and 4 deletions
11
index.py
11
index.py
|
@ -3,11 +3,13 @@ import json
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from string import Template
|
from string import Template
|
||||||
|
from distutils.dir_util import copy_tree
|
||||||
|
|
||||||
from config import (
|
from config import (
|
||||||
INDEX_TEMPLATE,
|
INDEX_TEMPLATE,
|
||||||
INDEX_ROW_TEMPLATE,
|
INDEX_ROW_TEMPLATE,
|
||||||
LINK_INDEX_TEMPLATE,
|
LINK_INDEX_TEMPLATE,
|
||||||
|
TEMPLATE_STATICFILES,
|
||||||
ARCHIVE_PERMISSIONS,
|
ARCHIVE_PERMISSIONS,
|
||||||
ARCHIVE_DIR,
|
ARCHIVE_DIR,
|
||||||
ANSI,
|
ANSI,
|
||||||
|
@ -31,11 +33,10 @@ def write_links_index(out_dir, links):
|
||||||
write_json_links_index(out_dir, links)
|
write_json_links_index(out_dir, links)
|
||||||
write_html_links_index(out_dir, links)
|
write_html_links_index(out_dir, links)
|
||||||
|
|
||||||
print('[√] [{}] Archive index is now up-to-date with {}{}{} links.'.format(
|
print('[√] [{}] Main archive index now up-to-date: {}/index.html'.format(
|
||||||
datetime.now().strftime('%Y-%m-%d %H:%M:%S'),
|
datetime.now().strftime('%Y-%m-%d %H:%M:%S'),
|
||||||
ANSI['green'],
|
out_dir,
|
||||||
len(links),
|
|
||||||
ANSI['reset'],
|
|
||||||
))
|
))
|
||||||
|
|
||||||
def write_json_links_index(out_dir, links):
|
def write_json_links_index(out_dir, links):
|
||||||
|
@ -71,6 +72,8 @@ def write_html_links_index(out_dir, links):
|
||||||
|
|
||||||
path = os.path.join(out_dir, 'index.html')
|
path = os.path.join(out_dir, 'index.html')
|
||||||
|
|
||||||
|
copy_tree(TEMPLATE_STATICFILES, os.path.join(out_dir, "static"))
|
||||||
|
|
||||||
with open(INDEX_TEMPLATE, 'r', encoding='utf-8') as f:
|
with open(INDEX_TEMPLATE, 'r', encoding='utf-8') as f:
|
||||||
index_html = f.read()
|
index_html = f.read()
|
||||||
|
|
||||||
|
|
BIN
templates/static/archive.png
Normal file
BIN
templates/static/archive.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
BIN
templates/static/complete.png
Normal file
BIN
templates/static/complete.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.5 KiB |
BIN
templates/static/external.png
Normal file
BIN
templates/static/external.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
BIN
templates/static/incomplete.png
Normal file
BIN
templates/static/incomplete.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.7 KiB |
BIN
templates/static/spinner.gif
Normal file
BIN
templates/static/spinner.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
Loading…
Add table
Add a link
Reference in a new issue