Update publish info

website
Jake VanderPlas 2017-08-14 14:02:21 -07:00
parent db6e9e8da6
commit 5dd32444bd
5 changed files with 17 additions and 8 deletions

View File

@ -25,8 +25,8 @@ CLOUDFILES_CONTAINER=my_cloudfiles_container
DROPBOX_DIR=~/Dropbox/Public/
GITHUB_PAGES_REMOTE=git@github.com:jakevdp/jakevdp.github.io.git
GITHUB_PAGES_BRANCH=master
GITHUB_PAGES_REMOTE=git@github.com:jakevdp/PythonDataScienceHandbook.git
GITHUB_PAGES_BRANCH=gh-pages
GIT_COMMIT_HASH = $(shell git rev-parse HEAD)

View File

@ -8,7 +8,7 @@ import shutil
PAGEFILE = """title: {title}
slug: {slug}
Template: page
Template: {template}
{{% notebook notebooks/{notebook_file} cells[{cells}] %}}
"""
@ -38,7 +38,7 @@ def copy_notebooks():
shutil.copytree(figsource, figdest)
figurelist = os.listdir(abspath_from_here('content', 'figures'))
figure_map = {os.path.join('figures', fig) : os.path.join('/figures', fig)
figure_map = {os.path.join('figures', fig) : os.path.join('/PythonDataScienceHandbook/figures', fig)
for fig in figurelist}
for nb in nblist:
@ -50,16 +50,20 @@ def copy_notebooks():
if nb == 'Index.ipynb':
cells = '1:'
template = 'page'
title = 'Python Data Science Handbook'
else:
cells = '2:'
# put nav below title
template = 'booksection'
title = content.cells[2].source
if not title.startswith('#') or len(title.splitlines()) > 1:
raise ValueError('title not found in third cell')
title = title.lstrip('#').strip()
content.cells[1], content.cells[2] = content.cells[2], content.cells[1]
# put nav below title
content.cells[0], content.cells[1], content.cells[2] = content.cells[2], content.cells[0], content.cells[1]
# Replace internal URLs and figure links in notebook
for cell in content.cells:
if cell.cell_type == 'markdown':
for nbname, htmlname in name_map.items():
@ -76,6 +80,7 @@ def copy_notebooks():
f.write(PAGEFILE.format(title=title,
slug=base.lower(),
notebook_file=nb,
template=template,
cells=cells))
if __name__ == '__main__':

View File

@ -54,6 +54,7 @@ TWITTER_USERNAME = 'jakevdp'
GITHUB_USERNAME = 'jakevdp'
STACKOVERFLOW_ADDRESS = 'http://stackoverflow.com/users/2937831/jakevdp'
AUTHOR_WEBSITE = 'http://vanderplas.com'
AUTHOR_BLOG = 'http://jakevdp.github.io'
AUTHOR_CV = "http://staff.washington.edu/jakevdp/media/pdfs/CV.pdf"
SHOW_ARCHIVES = True
SHOW_FEED = False # Need to address large feeds

View File

@ -10,10 +10,10 @@ import sys
sys.path.append(os.curdir)
from pelicanconf import *
SITEURL = 'http://jakevdp.github.io'
SITEURL = 'http://jakevdp.github.io/PythonDataScienceHandbook'
RELATIVE_URLS = False
SHOW_FEED = True
SHOW_FEED = False
FEED_ALL_ATOM = 'feeds/all.atom.xml'
CATEGORY_FEED_ATOM = 'feeds/%s.atom.xml'
FEED_USE_SUMMARY = True # from the feed_summary plugin

View File

@ -16,6 +16,9 @@
{% if AUTHOR_WEBSITE %}
<li><a href="{{ AUTHOR_WEBSITE }}" rel="me">website</a></li>
{% endif %}
{% if AUTHOR_BLOG %}
<li><a href="{{ AUTHOR_BLOG }}" rel="me">blog</a></li>
{% endif %}
{% if AUTHOR_CV %}
<li><a href="{{ AUTHOR_CV }}" rel="me">CV</a></li>
{% endif %}