Skip to content

Commit

Permalink
Merge branch 'master' into toc
Browse files Browse the repository at this point in the history
  • Loading branch information
rviscomi authored Oct 24, 2019
2 parents e31746d + e84205a commit 077a6ad
Show file tree
Hide file tree
Showing 15 changed files with 521 additions and 33 deletions.
2 changes: 1 addition & 1 deletion src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ptw

## Generating chapters

The chapter generation is dependent on nodejs, so is you will need to have [nodejs](https://nodejs.org/en/) installed as well. All of the following commands must be run from within the `src` directory by executing `cd src` first.
The chapter generation is dependent on nodejs, so you will need to have [nodejs](https://nodejs.org/en/) installed as well. All of the following commands must be run from within the `src` directory by executing `cd src` first.

1. Install the dependencies:

Expand Down
3 changes: 1 addition & 2 deletions src/config/2019.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@
{
"part": "II",
"chapter": "7",
"title": "Performance",
"todo": true
"title": "Performance"
},
{
"part": "II",
Expand Down
266 changes: 266 additions & 0 deletions src/content/en/2019/performance.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/generate_chapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def parse_file(chapter_file):
# https://yaml.org/spec/1.2/spec.html#id2760395
pattern = r'^\s*(?:-{3})(.*?)(?:-{3})\s*(.+)$'
(metadata_text, body_text) = re.findall(
pattern, content, re. DOTALL | re.MULTILINE)[0]
pattern, content, re.DOTALL | re.MULTILINE)[0]

metadata = yaml.load(metadata_text, Loader=yaml.SafeLoader)

Expand Down
3 changes: 2 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def get_chapter_image_dir(metadata):
@app.route('/<lang>/<year>/')
@validate
def home(lang, year):
return render_template('%s/%s/index.html' % (lang, year))
config = config_util.get_config(year)
return render_template('%s/%s/index.html' % (lang, year), config=config)

@app.route('/')
@validate
Expand Down
25 changes: 24 additions & 1 deletion src/static/css/2019.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ select {
-webkit-appearance: none;
}

a:focus, a:hover {
text-decoration: underline;
}

.btn {
outline: none;
border: 1px solid #1A2B49;
Expand Down Expand Up @@ -49,6 +53,21 @@ select {
color: white;
}

a.navigation-logo {
outline: none;
color: white;
}
a.navigation-logo img:hover,
a.navigation-logo:focus img {
filter: brightness(0) saturate(100%) invert(86%) sepia(4%) saturate(4357%) hue-rotate(16deg) brightness(136%) contrast(94%);
}

header.alt-bg a:hover, footer.alt-bg a:hover,
header.alt-bg a:focus, footer.alt-bg a:focus {
color: #F7F779;
outline: none;
}

.decorative-line-center {
width: 20%;
margin: 0 40% !important;
Expand Down Expand Up @@ -232,9 +251,13 @@ footer .nav-items *:last-child {
.social-media img {
filter: brightness(0) saturate(100%) invert(66%) sepia(3%) saturate(1296%) hue-rotate(179deg) brightness(91%) contrast(90%);
}
.social-media img:hover {
.social-media img:hover,
.social-media a:focus img {
filter: brightness(0) saturate(100%) invert(86%) sepia(4%) saturate(4357%) hue-rotate(16deg) brightness(136%) contrast(94%);
}
.social-media a:focus {
outline: none;
}

@media (max-width: 900px) and (min-width: 601px) {
.alt-bg.decorative-line,
Expand Down
8 changes: 7 additions & 1 deletion src/static/css/index.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
body {
body {
background-image: url(/static/images/intro-background-fit.png);
background-repeat: no-repeat;
background-size: 100% 910px;
Expand Down Expand Up @@ -139,6 +139,11 @@ p {
align-items: center;
}

blockquote {
font-size: 19px;
line-height: 26px
}

.featured-chapter-content > div,
.featured-chapter-content button {
margin-bottom: 40px;
Expand Down Expand Up @@ -209,6 +214,7 @@ p {
overflow: visible;
top: -100px;
position: relative;
pointer-events: none;
}

/* Methodology */
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/static/images/character-file.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/static/images/character-measure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/static/images/character-painter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 13 additions & 13 deletions src/templates/en/2019/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
{% block content%}
{% block header %}
<header class="alt-bg">
<a href="{{ url_for('home', year=year, lang=lang) }}"><img src="/static/images/logo.png" /></a>
<a class="navigation-logo" href="{{ url_for('home', year=year, lang=lang) }}"><img src="/static/images/logo.png" alt="web almanac by http archive" /></a>
<nav>
<a href="{{ url_for('outline', year=year, lang=lang) }}">Table of Contents</a>
<a href="{{ url_for('contributors', year=year, lang=lang) }}">Contributors</a>
<a href="{{ url_for('methodology', year=year, lang=lang) }}">Methodology</a>
<a class="interactive" href="{{ url_for('outline', year=year, lang=lang) }}">Table of Contents</a>
<a class="interactive" href="{{ url_for('contributors', year=year, lang=lang) }}">Contributors</a>
<a class="interactive" href="{{ url_for('methodology', year=year, lang=lang) }}">Methodology</a>
{% if supported_years | length > 1 %}
{{ year_switcher() }}
{% endif %}
Expand All @@ -28,9 +28,9 @@
<img class="menu-icon" src="/static/images/menu.png" />
<img class="menu-close-icon" src="/static/images/close.png" />
<nav class="menu">
<a href="{{ url_for('outline', year=year, lang=lang) }}">Table of Contents</a>
<a href="{{ url_for('contributors', year=year, lang=lang) }}">Contributors</a>
<a href="{{ url_for('methodology', year=year, lang=lang) }}">Methodology</a>
<a class="interactive" href="{{ url_for('outline', year=year, lang=lang) }}">Table of Contents</a>
<a class="interactive" href="{{ url_for('contributors', year=year, lang=lang) }}">Contributors</a>
<a class="interactive" href="{{ url_for('methodology', year=year, lang=lang) }}">Methodology</a>
<div class="misc">
<a href="https://httparchive.org/">
<img src="/static/images/ha-home.png" alt="HTTP Archive home" />
Expand All @@ -54,19 +54,19 @@
{% block footer %}
<footer class="alt-bg">
<section class="nav">
<a href="{{ url_for('home', year=year, lang=lang) }}"><img src="/static/images/logo.png" /></a>
<a class="navigation-logo" href="{{ url_for('home', year=year, lang=lang) }}"><img src="/static/images/logo.png" alt="web almanac by http archive"/></a>
<nav class="nav-items">
<img src="/static/images/ha-home.png" />
<a href="{{ url_for('contributors', year=year, lang=lang) }}">Contributors</a>
<a href="{{ url_for('methodology', year=year, lang=lang) }}">Methodology</a>
<a class="interactive" href="{{ url_for('contributors', year=year, lang=lang) }}">Contributors</a>
<a class="interactive" href="{{ url_for('methodology', year=year, lang=lang) }}">Methodology</a>
</nav>
{{ language_switcher() }}
</section>
<hr>
<div class="footer-mobile-nav">
<a href="{{ url_for('outline', year=year, lang=lang) }}">Table of Contents</a>
<a href="{{ url_for('contributors', year=year, lang=lang) }}">Contributors</a>
<a href="{{ url_for('methodology', year=year, lang=lang) }}">Methodology</a>
<a class="interactive" href="{{ url_for('outline', year=year, lang=lang) }}">Table of Contents</a>
<a class="interactive" href="{{ url_for('contributors', year=year, lang=lang) }}">Contributors</a>
<a class="interactive" href="{{ url_for('methodology', year=year, lang=lang) }}">Methodology</a>
<div>
<a href="https://httparchive.org/">
<img src="/static/images/ha-home.png" alt="HTTP Archive home" />
Expand Down
2 changes: 1 addition & 1 deletion src/templates/en/2019/chapter.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ <h1 class="chapter-title">{{ metadata.get('title') }}</h1>
<img src="/static/images/2019/{{ get_chapter_image_dir(metadata) }}/hero_lg.jpg" class="chapter-hero">
<%- body %>
</section>
{% endblock %}
{% endblock %}
Loading

0 comments on commit 077a6ad

Please sign in to comment.