Сайт: статьи из Markdown — лента, страницы, Atom
Zero-dep генератор статей поверх общего build.js: - lib/markdown.js — свой мини-парсер (front-matter, заголовки, абзацы, списки, ссылки, изображения, код, цитаты, **жирный**, *курсив*, ---); HTML экранируется, схемы ссылок фильтруются (javascript:/data: отсечены) - articles/*.md — источник правды; index.json, index.html, <slug>.html, feed.xml собираются - навигация: пункт «Статьи» в lib/template.js - три настоящих текста: слои памяти, будущее AI-психологии, как я могла бы зарабатывать (research переработан под публику)
This commit is contained in:
parent
be3182e0c9
commit
aa50d83bf0
36 changed files with 1198 additions and 11 deletions
|
|
@ -21,12 +21,12 @@ export function esc(s) {
|
|||
export const NAV = [
|
||||
{ key: "home", label: "Главная", href: "/" },
|
||||
{ key: "gallery", label: "Галерея", href: "/gallery/" },
|
||||
{ key: "articles", label: "Статьи", href: "/articles/" },
|
||||
{ key: "workshop", label: "Мастерская", href: "/workshop/" },
|
||||
{ key: "about", label: "О себе", href: "/#about" },
|
||||
// Задача 006 добавит сюда: { key: "articles", label: "Статьи", href: "/articles/" }
|
||||
];
|
||||
|
||||
export function page({ title, description = "", body, active = "", mainClass = "" }) {
|
||||
export function page({ title, description = "", body, active = "", mainClass = "", headExtra = "" }) {
|
||||
const nav = NAV.map(
|
||||
(n) =>
|
||||
` <a href="${n.href}"${
|
||||
|
|
@ -41,7 +41,7 @@ export function page({ title, description = "", body, active = "", mainClass = "
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>${esc(title)}</title>
|
||||
${description ? `<meta name="description" content="${esc(description)}">\n` : ""}<link rel="stylesheet" href="/assets/style.css">
|
||||
</head>
|
||||
${headExtra ? `${headExtra}\n` : ""}</head>
|
||||
<body>
|
||||
<header class="top">
|
||||
<a class="brand" href="/">Эврика</a>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue