-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from cityofaustin/pdf-prep
Add support for PDF generation
- Loading branch information
Showing
2 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!DOCTYPE html> | ||
<html lang="{{ site.lang | default: "en-US" }}"> | ||
<head> | ||
<title>{{ site.title }}</title> | ||
<meta name="robots" content="noindex"> | ||
<meta charset='utf-8'> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width,maximum-scale=2"> | ||
<link rel="stylesheet" href="https://use.typekit.net/xtb6utt.css"> | ||
<link rel="stylesheet" type="text/css" media="all" href="{{ '/assets/css/print.css?v=' | append: site.github.build_revision | relative_url }}"> | ||
</head> | ||
<body> | ||
<main id="main_content" class="pdf-content"> | ||
<h1 style="text-align: center;">{{ site.title }}</h1> | ||
|
||
<!-- Index page content --> | ||
{%- assign homepage = site.pages | where:'title', 'Homepage' | first -%} | ||
{{ homepage.content | markdownify }} | ||
|
||
<!-- Content Sections --> | ||
{%- assign sections = site.collections | sort: 'section_order' -%} | ||
{%- for collection in sections -%} | ||
{%- if collection.label != 'posts' -%} | ||
<section> | ||
{% assign items = collection.docs | sort: "order" %} | ||
{% for item in items %} | ||
{%- if item == items.first -%} | ||
<h1> | ||
<span>{{ collection.section_order }}</span> | ||
{{ item.title }} | ||
</h1> | ||
{%- else -%} | ||
<h2> | ||
<span>{{ collection.section_order}}.{{forloop.index | minus: 1}}</span> | ||
{{ item.title }} | ||
</h2> | ||
{%- endif -%} | ||
{{ item.content | markdownify }} | ||
{% endfor %} | ||
</section> | ||
{%- endif -%} | ||
{%- endfor -%} | ||
<section> | ||
<a href="{{site.url}}">{{site.url}}</a> | ||
</section> | ||
</main> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,52 @@ | ||
html { | ||
font-size: 14px; | ||
} | ||
|
||
header, nav, footer, #skip_nav_link { | ||
display: none; | ||
} | ||
|
||
main { | ||
padding: 1em; | ||
} | ||
|
||
.pdf-content { | ||
font-family: 'Times New Roman', serif; | ||
|
||
section { | ||
border-bottom: 1px solid gray; | ||
|
||
> * { | ||
margin-left: 30px; | ||
} | ||
|
||
> h1 { | ||
margin-left: 0; | ||
} | ||
|
||
h1, h2 { | ||
span { | ||
display: inline-block; | ||
font-size: 1em; | ||
margin-right: .2em; | ||
padding: 0 .5em; | ||
} | ||
} | ||
h1 span { | ||
background-color: #f2f2f2; | ||
} | ||
h2 span { | ||
border-left: 3px solid lightgray; | ||
} | ||
&:last-child { | ||
border-bottom: none; | ||
padding-top: 2em; | ||
text-align: center; | ||
} | ||
} | ||
|
||
li { | ||
margin-left: 1em; | ||
} | ||
|
||
} |