Skip to content

Commit 0bbb0e6

Browse files
committed
get rid of 'pages' in urls
1 parent be2c013 commit 0bbb0e6

File tree

3 files changed

+5
-37
lines changed

3 files changed

+5
-37
lines changed

website/content/pages/about.md

-27
This file was deleted.

website/content/pages/home.md

-6
This file was deleted.

website/copy_notebooks.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
import shutil
88

99
PAGEFILE = """title: {title}
10-
slug: {slug}
10+
url:
11+
save_as: {htmlfile}
1112
Template: {template}
1213
1314
{{% notebook notebooks/{notebook_file} cells[{cells}] %}}
@@ -27,8 +28,7 @@ def abspath_from_here(*args):
2728
def copy_notebooks():
2829
nblist = sorted(nb for nb in os.listdir(NB_SOURCE_DIR)
2930
if nb.endswith('.ipynb'))
30-
name_map = {nb: os.path.join('/PythonDataScienceHandbook', 'pages',
31-
nb.rsplit('.', 1)[0].lower() + '.html')
31+
name_map = {nb: nb.rsplit('.', 1)[0].lower() + '.html'
3232
for nb in nblist}
3333

3434
figsource = abspath_from_here('..', 'notebooks', 'figures')
@@ -77,9 +77,10 @@ def copy_notebooks():
7777
nbformat.write(content, os.path.join(NB_DEST_DIR, nb))
7878

7979
pagefile = os.path.join(PAGE_DEST_DIR, base + '.md')
80+
htmlfile = base.lower() + '.html'
8081
with open(pagefile, 'w') as f:
8182
f.write(PAGEFILE.format(title=title,
82-
slug=base.lower(),
83+
htmlfile=htmlfile,
8384
notebook_file=nb,
8485
template=template,
8586
cells=cells))

0 commit comments

Comments
 (0)