Skip to content

Commit f6a43ca

Browse files
committed
fix twilio logo and pdf work
1 parent c2e071d commit f6a43ca

File tree

10 files changed

+696
-13
lines changed

10 files changed

+696
-13
lines changed

Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,21 @@ run:
99
sed -i '' 's/~~//g' generated/updated_site/blog/*.html
1010

1111

12+
bookbuild:
13+
pelican -t theme -s book_settings.py -o generated/book content
14+
cp -R static-html/* generated/book/
15+
cp -R static/* generated/book/
16+
rm -rf generated/book/pages
17+
18+
19+
pdf: bookbuild
20+
sed -i '' 's/\(^.*~~.*$$\)/<span class="highlight-line">\1<\/span>/g' generated/book/pdf-book.html
21+
sed -i '' 's/"\/img\//"img\//g' generated/book/pdf-book.html
22+
sed -i '' 's/~~//g' generated/book/pdf-book.html
23+
cd generated/book; prince pdf-book.html -o full_stack_python.pdf
24+
25+
26+
1227
update:
1328
python update_s3.py
1429
rm -rf generated/current_site

book_settings.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# -*- coding: utf-8 -*-
2+
3+
AUTHOR = u'Matt Makai'
4+
SITENAME = u'Full Stack Python'
5+
SITEURL = 'https://www.fullstackpython.com'
6+
TIMEZONE = 'America/New_York'
7+
8+
GITHUB_URL = 'https://github.com/mattmakai/fullstackpython.com'
9+
PDF_GENERATOR = False
10+
11+
DIRECT_TEMPLATES = ('pdf-book', )#'epub-book')
12+
13+
ARTICLE_SAVE_AS = 'blog/{slug}.html'
14+
15+
SITEMAP_SAVE_AS = 'sitemap.xml'
16+
17+
FEED_DOMAIN = 'https://www.fullstackpython.com'
18+
FEED_ALL_ATOM = None
19+
CATEGORY_FEED_ATOM = None
20+
TRANSLATION_FEED_ATOM = None
21+
AUTHOR_FEED_ATOM = None
22+
AUTHOR_FEED_RSS = None
23+
24+
LINKS = ()
25+
26+
MARKUP = ('rst', 'markdown',)
27+
28+
SOCIAL = (
29+
('Email', 'mailto:matthew.makai@gmail.com'),
30+
('GitHub', 'https://github.com/mattmakai'),
31+
('Twitter', 'http://twitter.com/mattmakai'),
32+
)
33+
34+
PROJECTS = ()
35+
36+
JINJA_EXTENSIONS = (['jinja2.ext.autoescape',])

content/pages/10-web-apis/14-twilio.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ that software developers can use to add communications such as
1717
[two-factor authentication](https://www.twilio.com/docs/tutorials/walkthrough/two-factor-authentication/python/flask)
1818
into their [Python](/learning-programming.html) applications.
1919

20-
<img src="/img/twilio-logo.png" width="100%" alt="Twilio logo." class="technical-diagram" style="padding: 10px 0 10px 0;"/>
20+
<img src="/img/logos/twilio.png" width="100%" alt="Twilio logo." class="technical-diagram" style="padding: 10px 0 10px 0;"/>
2121

2222

2323
## Why is Twilio a good API choice?

theme/static/css/epub-book.css

Lines changed: 251 additions & 0 deletions
Large diffs are not rendered by default.

theme/static/css/pdf-book.css

Lines changed: 251 additions & 0 deletions
Large diffs are not rendered by default.

theme/static/files.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

theme/templates/epub-book.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!DOCTYPE html>
3+
<html lang="en">
4+
<head>
5+
<link href="theme/css/epub-book.css" rel="stylesheet">
6+
</head>
7+
<body>
8+
{% for page in pages|sort(attribute='sortorder') %}
9+
{% if page.sortorder[0:2] == "00" %}
10+
{{ page.content }}
11+
{% endif %}
12+
{% endfor %}
13+
<p style="page-break-after:always;"></p>
14+
15+
<h1>Table of Contents</h1>
16+
{% include "toc.html" %}
17+
18+
{% for page in pages|sort(attribute='sortorder') %}
19+
{% if not page.sortorder[0:2] == "00" %}
20+
{{ page.content }}
21+
{% endif %}
22+
{% endfor %}
23+
</body>
24+
</html>

theme/templates/pdf-book.html

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
1+
<?xml version="1.0" encoding="utf-8"?>
12
<!DOCTYPE html>
23
<html lang="en">
34
<head>
4-
<link href="theme/css/f.min.css" rel="stylesheet">
55
<link href="theme/css/pdf-book.css" rel="stylesheet">
66
</head>
77
<body>
8-
<div class="container">
9-
<div class="row">
10-
<div class="col-md-12">
11-
{% for page in pages|sort(attribute='sortorder') %}
12-
{{ page.content }}
13-
{% endfor %}
14-
</div>
15-
</div>
16-
</div>
8+
<img src="img/covers/cover-a4.png" width="100%">
9+
<br/>
10+
{% for page in pages|sort(attribute='sortorder') %}
11+
{% if page.sortorder[0:2] == "00" %}
12+
{{ page.content }}
13+
{% endif %}
14+
{% endfor %}
15+
<p style="page-break-after:always;"></p>
16+
17+
<h1>Table of Contents</h1>
18+
{% include "toc.html" %}
19+
20+
{% for page in pages|sort(attribute='sortorder') %}
21+
{% if not page.sortorder[0:2] == "00" %}
22+
{{ page.content }}
23+
{% endif %}
24+
{% endfor %}
1725
</body>
1826
</html>

theme/templates/table-of-contents.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ <h4 class="toc-subsection">7.2 <a href="/template-engines.html">Template Engines
162162
<h4 class="toc-subsection">7.3 <a href="/web-design.html">Web design</a></h4>
163163
<div class="toc"><a href="/cascading-style-sheets.html">CSS</a></div>
164164
<div class="toc"><a href="/responsive-design.html">Responsive Design</a></div>
165-
<div class="toc soon">Minification</div>
165+
<div class="toc"><a href="/minification.html">Minification</a></div>
166166

167167
<h4 class="toc-subsection">7.4 <span class="soon">CSS Frameworks</span></h4>
168168
<div class="toc"><a href="/bootstrap-css.html">Bootstrap</a></div>

theme/templates/toc.html

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<ol class="toc">
2+
<li>1. <a href="#introduction">Introduction</a></li>
3+
<ul class="toc2">
4+
<li>1.1 <a href="#our-deployment">Our Deployment</a></li>
5+
<li>1.2 <a href="#deployment-automation">Deployment Automation</a></li>
6+
<li>1.3 <a href="#services-and-code-well-use">Services and Code We'll Use</a></li>
7+
</ul>
8+
<li>2. <a href="#servers">Servers</a></li>
9+
<ul class="toc2">
10+
<li>2.1 <a href="#hosting-options">Hosting Options</a></li>
11+
<li>2.2 <a href="#what-are-virtualized-servers">What are Virtualized Servers?</a></li>
12+
<li>2.3 <a href="#obtain-your-virtual-server">Obtain Your Virtual Server</a></li>
13+
<li>2.4 <a href="#create-public-and-private-keys">Create Public and Private Keys</a></li>
14+
<li>2.5 <a href="#boot-and-secure-the-server">Boot and Secure the Server</a></li>
15+
<li>2.6 <a href="#upload-public-ssh-key">Upload Public SSH Key</a></li>
16+
<li>2.7 <a href="#restart-ssh-service">Restart SSH Service</a></li>
17+
<li>2.8 <a href="#automate-server-configuration">Automate Server Configuration</a></li>
18+
<li>2.9 <a href="#run-fabric-script">Run Fabric Script</a></li>
19+
<li>2.10 <a href="#more-server-resources">More Server Resources</a></li>
20+
</ul>
21+
<li>3. <a href="#operating-systems">Operating Systems</a></li>
22+
<ul class="toc2">
23+
<li>3.1 <a href="#ubuntu">Ubuntu</a></li>
24+
<li>3.2 <a href="#install-system-packages">Install System Packages</a></li>
25+
<li>3.3 <a href="#enable-firewall">Enable Firewall</a></li>
26+
<li>3.4 <a href="#ansible">Ansible</a></li>
27+
<li>3.5 <a href="#more-os-and-ansible-resources">More OS and Ansible Resources</a></li>
28+
</ul>
29+
<li>4. <a href="#web-servers">Web Servers</a></li>
30+
<ul class="toc2">
31+
<li>4.1 <a href="#nginx">Nginx</a></li>
32+
<li>4.2 <a href="#visualizing-nginxs-purpose">Visualizing Nginx's Purpose</a></li>
33+
<li>4.3 <a href="#install-nginx">Install Nginx</a></li>
34+
<li>4.4 <a href="#domain-name-service-resolution">Domain Name Service Resolution</a></li>
35+
<li>4.5 <a href="#nginx-without-https">Nginx Without HTTPS</a></li>
36+
<li>4.6 <a href="#create-ssl-certificate">Create SSL Certificate</a></li>
37+
<li>4.7 <a href="#restart-nginx-with-new-configuration">Restart Nginx with New Configuration</a></li>
38+
<li>4.8 <a href="#automate-nginx-configuration">Automate Nginx Configuration</a></li>
39+
<li>4.9 <a href="#more-web-server-resources">More Web Server Resources</a></li>
40+
</ul>
41+
<li>5. <a href="#source-control">Source Control</a></li>
42+
<ul class="toc2">
43+
<li>5.1 <a href="#hosted-source-control-services">Hosted Source Control Services</a></li>
44+
<li>5.2 <a href="#create-deploy-key">Create Deploy Key</a></li>
45+
<li>5.3 <a href="#authorize-git-clone-access">Authorize Git Clone Access</a></li>
46+
<li>5.4 <a href="#clone-app-code">Clone App Code</a></li>
47+
<li>5.5 <a href="#automate-source-control">Automate Source Control</a></li>
48+
<li>5.6 <a href="#more-source-control-git-resources">More Source Control & Git Resources</a></li>
49+
</ul>
50+
<li>6. <a href="#databases">Databases</a></li>
51+
<ul class="toc2">
52+
<li>6.1 <a href="#postgresql">PostgreSQL</a></li>
53+
<li>6.2 <a href="#nosql-data-stores">NoSQL Data Stores</a></li>
54+
<li>6.3 <a href="#redis">Redis</a></li>
55+
<li>6.4 <a href="#automate-postgresql-redis-installations">Automate PostgreSQL & Redis Installations</a></li>
56+
<li>6.5 <a href="#more-database-resources">More Database Resources</a></li>
57+
</ul>
58+
<li>7. <a href="#application-dependencies">Application Dependencies</a></li>
59+
<ul class="toc2">
60+
<li>7.1 <a href="#our-deployment-dependencies">Our Deployment Dependencies</a></li>
61+
<li>7.2 <a href="#virtualenv-requirementstxt">Virtualenv & requirements.txt</a></li>
62+
<li>7.3 <a href="#create-the-virtualenv">Create the Virtualenv</a></li>
63+
<li>7.4 <a href="#install-app-dependencies">Install App Dependencies</a></li>
64+
<li>7.5 <a href="#sync-database">Sync Database</a></li>
65+
<li>7.6 <a href="#automate-dependency-installation">Automate Dependency Installation</a></li>
66+
<li>7.7 <a href="#more-application-dependency-resources">More Application Dependency Resources</a></li>
67+
</ul>
68+
<li>8. <a href="#wsgi-servers">WSGI Servers</a></li>
69+
<ul class="toc2">
70+
<li>8.1 <a href="#what-is-wsgi">What is WSGI?</a></li>
71+
<li>8.2 <a href="#configure-gunicorn">Configure Gunicorn</a></li>
72+
<li>8.3 <a href="#start-gunicorn-with-supervisor">Start Gunicorn with Supervisor</a></li>
73+
<li>8.4 <a href="#our-app-is-live">Our App is Live!</a></li>
74+
<li>8.5 <a href="#automate-gunicorn-configuration">Automate Gunicorn Configuration</a></li>
75+
<li>8.6 <a href="#more-wsgi-resources">More WSGI Resources</a></li>
76+
</ul>
77+
<li>9. <a href="#task-queues">Task Queues</a></li>
78+
<ul class="toc2">
79+
<li>9.1 <a href="#celery">Celery</a></li>
80+
<li>9.2 <a href="#automate-celery-install">Automate Celery Install</a></li>
81+
<li>9.3 <a href="#more-task-queue-resources">More Task Queue Resources</a></li>
82+
</ul>
83+
<li>10. <a href="#continuous-integration">Continuous Integration</a></li>
84+
<ul class="toc2">
85+
<li>10.1 <a href="#jenkins">Jenkins</a></li>
86+
<li>10.2 <a href="#provision-a-new-server-for-ci">Provision A New Server for CI</a></li>
87+
<li>10.3 <a href="#ansible-automation-tweak">Ansible Automation Tweak</a></li>
88+
<li>10.4 <a href="#install-jenkins-system-package">Install Jenkins System Package</a></li>
89+
<li>10.5 <a href="#secure-jenkins">Secure Jenkins</a></li>
90+
<li>10.6 <a href="#create-ci-deploy-key">Create CI Deploy Key</a></li>
91+
<li>10.7 <a href="#configure-jenkins-build-job">Configure Jenkins Build Job</a></li>
92+
<li>10.8 <a href="#go-ahead-push-some-new-code">Go Ahead, Push Some New Code</a></li>
93+
<li>10.9 <a href="#more-continuous-integration-resources">More Continuous Integration Resources</a></li>
94+
</ul>
95+
<li>11. <a href="#whats-next">What's Next?</a></li>
96+
<li><a href="#appendix-a-glossary">Appendix A: Glossary</a></li>
97+
<li><a href="#appendix-b-more-python-resources">Appendix B: More Python Resources</a></li>
98+
<li><a href="#appendix-c-sample-app-tutorial">Appendix C: Sample App Tutorial</a></li>
99+
</ol>

0 commit comments

Comments
 (0)