Skip to content

Commit

Permalink
Update remove_citations
Browse files Browse the repository at this point in the history
  • Loading branch information
nntrn committed Mar 9, 2024
1 parent 3459cac commit fe0c292
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
11 changes: 8 additions & 3 deletions _includes/style.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*{box-sizing:border-box}
h1,h2,h3,h4{margin:.5rem 0}
html{font-size:10px}
body{scrollbar-width:thin;margin:0 0;padding:0 0;margin:auto;font-family:monospace;font-size:inherit}
html{font-size:14px}
body{scrollbar-width:thin;margin:0 0;padding:0 0}
hr{border:0;border-bottom:2px solid #222;margin:1rem 0}
h3 a{text-transform:capitalize;text-decoration:none;color:initial}
h3[id]:hover:after{content:"#";color:#aaa}
Expand All @@ -10,9 +10,14 @@ h3[id]:hover:after{content:"#";color:#aaa}
.content a{text-decoration:none}
.content a:hover{text-decoration:underline}
.content span{white-space:pre-wrap}
.content li>a{transition:all 0s;color:#aaa;font-family:sans-serif;text-transform:uppercase;font-size:.85em;font-variant:proportional-nums}
.content li>a:hover{color:#222}
aside,footer,header,section{padding:0 0;padding-left:1rem;padding-right:1rem;margin:1rem 0}
aside{background:#f2f2f2;padding-top:.5rem;padding-bottom:.5rem}
aside h4 a{font-family:sans-serif;font-size:.8em}
ol,ul{padding:0 1.15rem}
ul>li{padding:0 .4rem}
aside ol{display:flex;flex-direction:column;gap:.1rem;margin:.5rem 1rem;padding-left:2rem}
aside ol{gap:.1rem;margin:1rem 1rem;padding-left:1rem}
aside a:hover{font-weight:700;background:#fff}
aside ol li{padding-left:.5rem}
date{margin-right:.5rem;text-transform:uppercase}
20 changes: 7 additions & 13 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,27 @@
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
<meta charset="UTF-8">
<title>{% if page.title != 'Home' %}{{page.title|default:page.name}} | {%-endif %} {{site.title}}</title>

<link rel="canonical" href="{{ page.url | absolute_url }}" />
<link rel="icon" href="{{site.favicon_ico|relative_url}}" type="image/x-icon">
<meta name="description" content="{{site.description}}" />
<meta name="author" content="{{site.github_username}}">
<meta name="author" content="{{site.author}} (@{{site.github_username}})">
<meta name="robots" content="index, follow">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="default">

<link rel="canonical" href="https://nntrn.github.io{{ page.url | relative_url }}" />
<link rel="icon" href="{{site.favicon_ico|relative_url}}" type="image/x-icon">

<meta property="og:site_name" content="{{ site.title }}">
<meta property="og:type" content="website">
<meta property="og:url" content="{{ page.url | relative_url }}">
<meta property="og:url" content="{{ page.url | absolute_url }}">
<meta property="og:title" content="{{ page.title | default: site.title }}">
<meta property="og:description" content="{{ page.description | default: site.description }}">

<meta name="twitter:site" content="{{ site.title }}">
<meta name="twitter:card" content="summary">
<meta name="twitter:url" content="{{ site.url | relative_url }}">
<meta name="twitter:url" content="{{ site.url | absolute_url }}">
<meta name="twitter:title" content="{{ page.title | default: site.title }}">
<meta name="twitter:description" content="{{ page.description | default: site.description }}">

<style>
{% include style.css %}
</style>
Expand Down
1 change: 1 addition & 0 deletions _layouts/genre.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
layout: default
type: genre
---
{%- assign title = page.tag -%}
{%- assign pagetag = page.tag -%}
{%- assign bookpages = site.data.books | where: 'tags', pagetag -%}
<section>
Expand Down
4 changes: 3 additions & 1 deletion scripts/books.jq
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ def epublocation($cfi):
| map(select(length < 5)|tonumber);

def remove_citations($text):
$text | gsub("(?<period>[a-zA-Z][^a-zA-Z0-9\\ ])[0-9]{1,2} ";.period+""; "xs");
$text
| gsub("(?<a>[^0-9]{3})[0-9]{1,2}(?<b>[^0-9%]{2})"; .a +.b; "x")
| gsub("(?<a>[^0-9]{3})[0-9]{1,2}([\\s]+)?$"; .a +.b; "xs");

def remove_citations: remove_citations(.);

Expand Down

0 comments on commit fe0c292

Please sign in to comment.