diff --git a/.gitignore b/.gitignore index 1c9d475..b4b4347 100644 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,6 @@ _site # nix packages .direnv -result # Environment variables .env diff --git a/_data/site.js b/_data/site.js deleted file mode 100644 index e214bbe..0000000 --- a/_data/site.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - // Set SITE_URL environment variable to build for different domains: - // SITE_URL=https://blog.jan-leila.com pnpm run build - // SITE_URL=https://volpe.jan-leila.com pnpm run build - // SITE_URL=http://your-onion-address.onion pnpm run build - url: process.env.SITE_URL || "http://localhost:8080" -}; \ No newline at end of file diff --git a/_includes/base.njk b/_includes/base.njk index 394a3fa..a1186f7 100644 --- a/_includes/base.njk +++ b/_includes/base.njk @@ -3,47 +3,9 @@ - Volpe{% if title %} | {{ title }}{% endif %} - {% if description %} - - {% endif %} - - {# Critical CSS inlined for faster initial render #} - - - {# Preload full stylesheet with cache-busted filename #} - - - - {# Defer prism.css - only needed for syntax highlighting #} - - - + {{ title }} | Volpe + +
@@ -57,12 +19,7 @@ \ No newline at end of file diff --git a/eleventy.config.js b/eleventy.config.js index 0726aed..1551fcb 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -4,26 +4,8 @@ const markdownItFootnote = require("markdown-it-footnote"); const markdownItMermaid = require('markdown-it-mermaid').default const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight"); const fs = require("fs"); -const crypto = require("crypto"); -const path = require("path"); const { DateTime } = require("luxon"); -const cssHashCache = {}; -const getCssHash = (cssFile) => { - if (cssHashCache[cssFile]) return cssHashCache[cssFile]; - - const cssPath = path.join(__dirname, "css", cssFile); - try { - const content = fs.readFileSync(cssPath, "utf-8"); - const hash = crypto.createHash("md5").update(content).digest("hex").slice(0, 8); - cssHashCache[cssFile] = hash; - return hash; - } catch (e) { - console.warn(`Could not hash CSS file: ${cssFile}`); - return null; - } -}; - const extractTags = (content, mdInstance) => { if (!content) return []; @@ -54,7 +36,7 @@ const getPostTags = (post, mdInstance) => { } const isReleased = (post) => { - return post.data.released !== false; + return post.data.unreleased !== true; } const markdownItHashtag = (md) => { @@ -238,39 +220,7 @@ module.exports = (eleventyConfig) => { return tagMap; }); - // Cache busting filter: returns hashed CSS filename - eleventyConfig.addFilter("cssHash", (cssFile) => { - const hash = getCssHash(cssFile); - const ext = path.extname(cssFile); - const base = path.basename(cssFile, ext); - return `/css/${base}.${hash}${ext}`; - }); - - eleventyConfig.on("eleventy.before", async () => { - const cssDir = path.join(__dirname, "css"); - const outputCssDir = path.join(__dirname, "_site", "css"); - - if (!fs.existsSync(outputCssDir)) { - fs.mkdirSync(outputCssDir, { recursive: true }); - } - - const cssFiles = fs.readdirSync(cssDir).filter(f => f.endsWith(".css")); - for (const cssFile of cssFiles) { - const hash = getCssHash(cssFile); - const ext = path.extname(cssFile); - const base = path.basename(cssFile, ext); - const hashedName = `${base}${hash == null ? '' : `.${hash}`}${ext}`; - - fs.copyFileSync( - path.join(cssDir, cssFile), - path.join(outputCssDir, hashedName) - ); - } - }); - - eleventyConfig.addPassthroughCopy("robots.txt"); - - eleventyConfig.ignores.add("README.md"); + eleventyConfig.addPassthroughCopy("css"); return { dir: { diff --git a/flake.nix b/flake.nix index 00aa531..91bbb0e 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "Volpe Blog"; + description = "A Nix-flake-based Node.js development environment"; inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz"; @@ -19,46 +19,9 @@ pkgs = import nixpkgs {inherit overlays system;}; }); in { - packages = forEachSupportedSystem ({pkgs}: { - default = pkgs.callPackage ./nix/package.nix { - siteUrl = "https://blog.jan-leila.com"; - }; - blog = pkgs.callPackage ./nix/package.nix { - siteUrl = "https://blog.jan-leila.com"; - }; - volpe = pkgs.callPackage ./nix/package.nix { - siteUrl = "https://volpe.jan-leila.com"; - }; - }); - devShells = forEachSupportedSystem ({pkgs}: { default = pkgs.mkShell { - packages = with pkgs; [ - nodejs - nodePackages.pnpm - ]; - }; - }); - - nixosConfigurations.volpe = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - {nixpkgs.overlays = overlays;} - ./nix/configuration.nix - ]; - }; - - # Deployment helper - use with: nix run .#deploy - apps = forEachSupportedSystem ({pkgs}: { - deploy = { - type = "app"; - program = toString (pkgs.writeShellScript "deploy-volpe" '' - set -e - echo "Building and deploying to cyberian@69.61.19.180..." - nixos-rebuild switch --flake .#volpe \ - --target-host cyberian@69.61.19.180 \ - --sudo - ''); + packages = with pkgs; [node2nix nodejs pnpm sqlite]; }; }); }; diff --git a/index.njk b/index.njk index bc952c7..ff56fb5 100644 --- a/index.njk +++ b/index.njk @@ -1,13 +1,8 @@ --- layout: base.njk title: Blog -description: Welcome to my website! I write about tech, politics, food, and hobby projects. Stay a while, make some friends, learn something, and help your neighbors. --- -
-

{{ description }}

-
-

Blog Posts