typography style updates; sort rss by publish date

This commit is contained in:
James Brumond 2023-06-17 14:51:07 -07:00
parent 5d36def32c
commit dc3b8ea5d8
Signed by: james
GPG Key ID: E8F2FC44BAA3357A
6 changed files with 71 additions and 20 deletions

View File

@ -76,3 +76,11 @@ dd + dt {
figcaption {
margin-block-start: 1.5rem;
}
/* ===== Pre-formatted Blocks ===== */
pre {
margin-block: 1.5rem;
}

View File

@ -80,6 +80,14 @@ p {
/* ===== Inline Styles ===== */
del {
text-decoration: line-through;
}
/* ===== Links ===== */
@ -111,6 +119,10 @@ a.icon-link svg.icon {
--icon-size: 1rem;
}
del a {
text-decoration: line-through underline;
}
@ -255,8 +267,8 @@ table dl {
pre {
color: var(--theme-code-normal);
font-family: var(--font-monospace);
margin-block: 3rem;
margin-inline: 2rem;
margin-inline-start: 1rem;
margin-inline-end: 5rem;
padding-block: 0.5rem;
padding-inline: 1rem;
border: 0.1rem solid var(--theme-line);
@ -266,6 +278,12 @@ pre {
background: var(--theme-bg-light);
}
@media screen and (max-width: 60rem) {
pre {
margin-inline: 0;
}
}
@ -280,8 +298,11 @@ code, samp {
:not(pre) > :is(code, samp) {
color: inherit;
background: var(--theme-bg-light);
margin-inline: 0.15rem;
padding-block: 0.1rem;
padding-inline: 0.25rem;
border: 0.1rem solid var(--theme-line);
border-radius: 0.2rem;
}

View File

@ -75,3 +75,11 @@ dd + dt {
figcaption {
margin-block-start: 2rem;
}
/* ===== Pre-formatted Blocks ===== */
pre {
margin-block: 2rem;
}

31
package-lock.json generated
View File

@ -8,9 +8,9 @@
"name": "@doc-utils/docs2website",
"version": "0.1.6",
"dependencies": {
"@doc-utils/color-themes": "^0.1.14",
"@doc-utils/color-themes": "^0.1.15",
"@doc-utils/jsonschema2markdown": "^0.1.1",
"@doc-utils/markdown2html": "^0.3.2",
"@doc-utils/markdown2html": "^0.3.4",
"glob": "^10.2.3",
"ical": "^0.8.0",
"ical-generator": "^4.1.0",
@ -33,9 +33,9 @@
}
},
"node_modules/@doc-utils/color-themes": {
"version": "0.1.14",
"resolved": "https://gitea.jbrumond.me/api/packages/doc-utils/npm/%40doc-utils%2Fcolor-themes/-/0.1.14/color-themes-0.1.14.tgz",
"integrity": "sha512-j0U8v8Y+9zAm9D7pbCheTQYGEKt9FSpKSZQNGsogxWl95S9Z7QMjtmJns6QPgdOsSDss7sjMLFS5Gm50GCMzNA=="
"version": "0.1.15",
"resolved": "https://gitea.jbrumond.me/api/packages/doc-utils/npm/%40doc-utils%2Fcolor-themes/-/0.1.15/color-themes-0.1.15.tgz",
"integrity": "sha512-P0oIlq4Z0cUOf7P4T2OUfhT/Cn/msl3oHTenVWHxKMDPlIYueR6AhFdRCHTI0A+DxyH+0EIi6CnMq3JYnILI0w=="
},
"node_modules/@doc-utils/jsonschema2markdown": {
"version": "0.1.1",
@ -51,9 +51,9 @@
}
},
"node_modules/@doc-utils/markdown2html": {
"version": "0.3.2",
"resolved": "https://gitea.jbrumond.me/api/packages/doc-utils/npm/%40doc-utils%2Fmarkdown2html/-/0.3.2/markdown2html-0.3.2.tgz",
"integrity": "sha512-aRPlxA25gowmWmzPID4xyLCTVs7VgQJvlmYn3amnFAsUC55JzFXZQ9MR40AKeQYv9VSXIpxjUr7A86hgOzRFFw==",
"version": "0.3.4",
"resolved": "https://gitea.jbrumond.me/api/packages/doc-utils/npm/%40doc-utils%2Fmarkdown2html/-/0.3.4/markdown2html-0.3.4.tgz",
"integrity": "sha512-zL3kay/zbrBJWGKIxGCyF+EXsafSxY1aN+miG+GOyml1neoOwd67vNIiE96KuEucf6rvuICPiYTjm3uJxkjd/g==",
"dependencies": {
"bytefield-svg": "^1.6.1",
"dompurify": "^2.3.6",
@ -66,6 +66,9 @@
"qrcode": "^1.5.1",
"vega": "^5.22.1",
"yaml": "^2.2.2"
},
"bin": {
"markdown2html": "bin/markdown2html"
}
},
"node_modules/@isaacs/cliui": {
@ -2674,9 +2677,9 @@
},
"dependencies": {
"@doc-utils/color-themes": {
"version": "0.1.14",
"resolved": "https://gitea.jbrumond.me/api/packages/doc-utils/npm/%40doc-utils%2Fcolor-themes/-/0.1.14/color-themes-0.1.14.tgz",
"integrity": "sha512-j0U8v8Y+9zAm9D7pbCheTQYGEKt9FSpKSZQNGsogxWl95S9Z7QMjtmJns6QPgdOsSDss7sjMLFS5Gm50GCMzNA=="
"version": "0.1.15",
"resolved": "https://gitea.jbrumond.me/api/packages/doc-utils/npm/%40doc-utils%2Fcolor-themes/-/0.1.15/color-themes-0.1.15.tgz",
"integrity": "sha512-P0oIlq4Z0cUOf7P4T2OUfhT/Cn/msl3oHTenVWHxKMDPlIYueR6AhFdRCHTI0A+DxyH+0EIi6CnMq3JYnILI0w=="
},
"@doc-utils/jsonschema2markdown": {
"version": "0.1.1",
@ -2692,9 +2695,9 @@
}
},
"@doc-utils/markdown2html": {
"version": "0.3.2",
"resolved": "https://gitea.jbrumond.me/api/packages/doc-utils/npm/%40doc-utils%2Fmarkdown2html/-/0.3.2/markdown2html-0.3.2.tgz",
"integrity": "sha512-aRPlxA25gowmWmzPID4xyLCTVs7VgQJvlmYn3amnFAsUC55JzFXZQ9MR40AKeQYv9VSXIpxjUr7A86hgOzRFFw==",
"version": "0.3.4",
"resolved": "https://gitea.jbrumond.me/api/packages/doc-utils/npm/%40doc-utils%2Fmarkdown2html/-/0.3.4/markdown2html-0.3.4.tgz",
"integrity": "sha512-zL3kay/zbrBJWGKIxGCyF+EXsafSxY1aN+miG+GOyml1neoOwd67vNIiE96KuEucf6rvuICPiYTjm3uJxkjd/g==",
"requires": {
"bytefield-svg": "^1.6.1",
"dompurify": "^2.3.6",

View File

@ -22,9 +22,9 @@
"typescript": "^5.0.4"
},
"dependencies": {
"@doc-utils/color-themes": "^0.1.14",
"@doc-utils/color-themes": "^0.1.15",
"@doc-utils/jsonschema2markdown": "^0.1.1",
"@doc-utils/markdown2html": "^0.3.2",
"@doc-utils/markdown2html": "^0.3.4",
"glob": "^10.2.3",
"ical": "^0.8.0",
"ical-generator": "^4.1.0",

View File

@ -6,6 +6,7 @@ import { write_text } from '../fs';
import { AuthorConfig, app_version } from '../conf';
import { map_output_file_to_url } from './helpers';
import { DateTime } from 'luxon';
import { FileMetadata } from '../metadata';
export interface RSSEntry {
url: string;
@ -84,11 +85,21 @@ export async function write_rss_if_needed(state: BuildState) {
// channel.ele('image').txt('');
// channel.ele('skipHours').txt('');
// channel.ele('skipDays').txt('');
let entries: (RSSEntry & { metadata: FileMetadata, first_seen: number })[] = [ ];
for (const entry of state.rss[index] || [ ]) {
const item = channel.ele('item');
const in_file = entry.in_file.slice(state.conf.input.root.length);
const metadata = state.new_metadata.files[in_file];
entries.push({ ...entry, metadata, first_seen: DateTime.fromISO(metadata.first_seen_time).toUnixInteger() });
}
entries = entries.sort((a, b) => {
return b.first_seen - a.first_seen;
});
for (const entry of entries) {
const item = channel.ele('item');
item.ele('link').txt(entry.url);
@ -111,7 +122,7 @@ export async function write_rss_if_needed(state: BuildState) {
}
item.ele('guid').txt(entry.url);
item.ele('pubDate').txt(DateTime.fromISO(metadata.first_seen_time).toRFC2822());
item.ele('pubDate').txt(DateTime.fromISO(entry.metadata.first_seen_time).toRFC2822());
if (entry.html_content) {
item.ele('content:encoded').ele({ $: entry.html_content });