Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions _layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@
{{ content }}
<nav role="navigation" aria-label="Post navigation">
<hr>
{%- unless page.collection == 'posts' %}
<a href="https://github.com/cb341/cb341.github.io/blob/main/{{ page.path }}?plain=1" target="_blank" rel="noopener noreferrer">Source</a>
{%- if page.raw_url %} |
<a href="{{ page.raw_url }}">Markdown</a>
Expand All @@ -302,6 +303,7 @@
<a href="{{ page.pdf_url }}">PDF</a>
{%- endif %}
|
{%- endunless %}
<a href="https://docs.google.com/forms/d/e/1FAIpQLSeRD0Q9wYYZelAkRXEu2cCFN89-cvoAfOtyTY9vaz9-FUvYXQ/viewform?usp=pp_url&entry.2083454847={{ current_url | url_encode }}" target="_blank" rel="noopener noreferrer">Page Feedback</a>
{%- if page.collection == 'posts' %}{% include post_nav.html %}{%- endif -%}
{%- if page.collection == 'projects' %}{% include project_nav.html %}{%- endif -%}
Expand Down
17 changes: 15 additions & 2 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,21 @@

<header class="article-title">
<h1>{{ page.title }}</h1>
{% if page.description %}<p class="print-description" hidden>{{ page.description }}</p>{% endif %}
{% if page.date %}<p class="print-date" hidden>{{ page.date | date: site.date_format }}</p>{% endif %}
{% if page.description %}<p class="print-description">{{ page.description }}</p>{% endif %}
<p class="print-date">
<time datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | date: site.date_format }}</time>
<span class="article-formats">
<span aria-hidden="true">·</span>
<a href="https://github.com/cb341/cb341.github.io/blob/main/{{ page.path }}?plain=1" target="_blank" rel="noopener noreferrer">Source</a>
{%- if page.raw_url %} <span aria-hidden="true">·</span>
<a href="{{ page.raw_url }}">Markdown</a>
{%- endif %}
{%- if page.pdf_url %} <span aria-hidden="true">·</span>
<a href="{{ page.pdf_url }}">PDF</a>
{%- endif %}
</span>
</p>
<hr>
</header>

{{ content }}
6 changes: 5 additions & 1 deletion _plugins/raw_markdown.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ def self.pages(site)
source_path = File.expand_path(page.path, site.source)
raw_path = File.join(site.dest, page.data.fetch("raw_url").delete_prefix("/"))
FileUtils.mkdir_p(File.dirname(raw_path))
FileUtils.cp(source_path, raw_path)
body = File.read(source_path).sub(/\A---[ \t]*\r?\n.*?^---[ \t]*\r?\n/m, "").lstrip
heading, body = body.split(/\r?\n/, 2) if body.start_with?("# ")
heading ||= "# #{page.data.fetch("title")}"
date = page.data["date"]&.strftime(site.config.fetch("date_format", "%Y-%m-%d"))
File.write(raw_path, [heading, date, body&.lstrip].compact.join("\n\n"))
end
end
21 changes: 11 additions & 10 deletions bin/pdf.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@
@media print {
@page {
size: A4;
margin: 19mm 18mm 22mm;
margin: 17mm 18mm 20mm;
color: #666;
font: 7.5pt Arial, sans-serif;
font: 7.5pt Georgia, serif;

@bottom-left { content: "Dani Bengl (it/its)"; }
@bottom-center { content: __CURRENT_URL__; }
@bottom-right { content: counter(page) " / " counter(pages); }
}

html, body { background: #fff; color: #000; }
body { font-size: 10.5pt; line-height: 1.45; }
body { font: 10.5pt/1.45 Georgia, serif; }
.wrapper { max-width: none; margin: 0; padding: 0; }

.article-title {
margin: 0 0 9mm;
padding: 0 0 7mm;
margin: 0 0 7mm;
padding: 0 0 3.5mm;
border-bottom: .4mm solid #1c1c1a;
}
.article-title h1 {
Expand All @@ -29,20 +29,21 @@
line-height: 1.05;
letter-spacing: -.025em;
}
.article-title > hr {
display: none;
}
.print-description {
display: block;
margin: 4mm 0 0;
margin: 3mm 0;
color: #444;
font-size: 12pt;
}
.article-formats { display: none; }
.print-date {
display: block;
margin: 3mm 0 0;
margin: 0;
color: #666;
font-family: Arial, sans-serif;
font-size: 8pt;
letter-spacing: .04em;
text-transform: uppercase;
}

header[role="banner"],
Expand Down
Loading