diff --git a/.envrc b/.envrc deleted file mode 100644 index 201e5d8..0000000 --- a/.envrc +++ /dev/null @@ -1,2 +0,0 @@ -watch_files .envrc flake.nix nix/*.nix -use flake diff --git a/.gitignore b/.gitignore index 5f8278f..2febe43 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,5 @@ output +.venv +venv-install cache __pycache__ -.direnv -plugins -theme -.env diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..3b89742 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "theme"] + path = theme + url = https://git.epha.se/ephase/attila_pelican_theme.git +[submodule "plugins"] + path = plugins + url = https://github.com/getpelican/pelican-plugins diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9e3a249 --- /dev/null +++ b/Makefile @@ -0,0 +1,48 @@ +-include include.mk +# pelican variables +P_OUTPUT?=output +P_OPT?= + +# deploy variables +D_BIN?=rsync +D_OPT?=-avz --delete +D_DST?="blog:$(D_FOLDER)" + +# venv variables + +VENV_SOURCE?=.venv +REQUIREMENT?=requirements.txt +PYTHON_BIN?=python3 +VENV_CMD?=. $(VENV_SOURCE)/bin/activate + +# Pelican part + +.PHONY: build +build: $(VENV_SOURCE)/dep + $(VENV_CMD) && pelican -o $(P_OUTPUT) $(P_OPT) + +.PHONY: deploy +deploy: build + [ -d $(P_OUTPUT) ] && $(D_BIN) $(D_OPT) $(P_OUTPUT)/ $(D_DST) + +.PHONY: clean +clean: + [ -d $(P_OUTPUT) ] && rm -rf $(P_OUTPUT) + +# venv management +$(VENV_SOURCE): + $(PYTHON_BIN) -m venv $(VENV_SOURCE) + +$(REQUIREMENT): + +$(VENV_SOURCE)/dep: $(VENV_SOURCE) $(REQUIREMENT) + touch $(VENV_SOURCE)/dep + $(VENV_CMD) && pip install -r $(REQUIREMENT) + +.PHONY: clean-venv +clean-venv: + [ -d $(VENV_SOURCE) ] && rm -rf $(VENV_SOURCE) + +.PHONY: serve +serve: $(VENV_SOURCE)/dep + $(VENV_CMD) && invoke livereload diff --git a/content/articles/archives/script.sh b/content/articles/archives/script.sh new file mode 100644 index 0000000..bd8a3c4 --- /dev/null +++ b/content/articles/archives/script.sh @@ -0,0 +1 @@ +find . -type f -name '*.md; -exec sed -ie 's\Category: adminsys\Category: sysadmin\g' {} \; diff --git a/flake.lock b/flake.lock deleted file mode 100644 index bf641b5..0000000 --- a/flake.lock +++ /dev/null @@ -1,107 +0,0 @@ -{ - "nodes": { - "flake-parts": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib" - }, - "locked": { - "lastModified": 1735774679, - "narHash": "sha256-soePLBazJk0qQdDVhdbM98vYdssfs3WFedcq+raipRI=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "f2f7418ce0ab4a5309a4596161d154cfc877af66", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1735834308, - "narHash": "sha256-dklw3AXr3OGO4/XT1Tu3Xz9n/we8GctZZ75ZWVqAVhk=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "6df24922a1400241dae323af55f30e4318a6ca65", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "ref": "nixos-unstable", - "type": "indirect" - } - }, - "nixpkgs-lib": { - "locked": { - "lastModified": 1735774519, - "narHash": "sha256-CewEm1o2eVAnoqb6Ml+Qi9Gg/EfNAxbRx1lANGVyoLI=", - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/e9b51731911566bbf7e4895475a87fe06961de0b.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/e9b51731911566bbf7e4895475a87fe06961de0b.tar.gz" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1735554305, - "narHash": "sha256-zExSA1i/b+1NMRhGGLtNfFGXgLtgo+dcuzHzaWA6w3Q=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "0e82ab234249d8eee3e8c91437802b32c74bb3fd", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs", - "systems": "systems", - "treefmt-nix": "treefmt-nix" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "id": "systems", - "type": "indirect" - } - }, - "treefmt-nix": { - "inputs": { - "nixpkgs": "nixpkgs_2" - }, - "locked": { - "lastModified": 1736154270, - "narHash": "sha256-p2r8xhQZ3TYIEKBoiEhllKWQqWNJNoT9v64Vmg4q8Zw=", - "owner": "numtide", - "repo": "treefmt-nix", - "rev": "13c913f5deb3a5c08bb810efd89dc8cb24dd968b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "treefmt-nix", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/flake.nix b/flake.nix deleted file mode 100644 index da59fcd..0000000 --- a/flake.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ - description = "Nix flake for my personal blog"; - - inputs = { - nixpkgs.url = "nixpkgs/nixos-unstable"; - flake-parts.url = "github:hercules-ci/flake-parts"; - treefmt-nix.url = "github:numtide/treefmt-nix"; - }; - - outputs = - inputs@{ - nixpkgs, - flake-parts, - systems, - ... - }: - flake-parts.lib.mkFlake { inherit inputs; } { - systems = [ "x86_64-linux" ]; - imports = [ - inputs.treefmt-nix.flakeModule - ./nix/default.nix - ]; - }; -} diff --git a/lefthook.yaml b/lefthook.yaml deleted file mode 100644 index d4f7054..0000000 --- a/lefthook.yaml +++ /dev/null @@ -1,26 +0,0 @@ ---- -commit-msg: - parallel: true - commands: - - lint:convco: - run: cat {1} | convco check --from-stdin - - lint:typos: - run: cat {1} | typos - - -pre-commit: - parallel: true - commands: - - nixcheck: - glob: "flake.{nix,lock}" - run: nix flake check - - shellcheck: - glob: "*.sh" - run: shellcheck {staged_files} - - shfmt: - glob: "*.sh" - run: shfmt -d -ln bash -i 4 {staged_files} diff --git a/nix/build.nix b/nix/build.nix deleted file mode 100644 index 9eddd16..0000000 --- a/nix/build.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ inputs, ... }: -let - inherit (inputs.flake-parts.lib) mkPerSystemOption; -in -{ - options.perSystem = mkPerSystemOption ( - { - pkgs, - config, - ... - }: - { - packages.default = pkgs.stdenvNoCC.mkDerivation { - name = "xiemeart"; - src = ../.; - nativeBuildInputs = config.buildPackages; - configurePhase = '' - ln -snf ${config.pelicantheme} theme - ln -snf ${config.pelicanplugins} plugins - ''; - buildPhase = '' - ls -la - mkdir -p output - pelican --verbose -o output/ 2>& 1>build.log - ''; - installPhase = '' - mkdir -p $out/ - cp build.log $out/ - cp -r output/* $out/ - ''; - }; - } - ); -} diff --git a/nix/default.nix b/nix/default.nix deleted file mode 100644 index 7507618..0000000 --- a/nix/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ ... }: -{ - imports = [ - ./treefmt.nix - ./packages.nix - ./devshell.nix - ./build.nix - ]; -} diff --git a/nix/devshell.nix b/nix/devshell.nix deleted file mode 100644 index 5a3d0ff..0000000 --- a/nix/devshell.nix +++ /dev/null @@ -1,20 +0,0 @@ -_: { - config.perSystem = - { - config, - inputs', - pkgs, - ... - }: - { - devShells = { - default = pkgs.mkShell { - nativeBuildInputs = config.develPackages; - shellHook = '' - ln -snf ${config.pelicanplugins} plugins - ln -snf ${config.pelicantheme} theme - ''; - }; - }; - }; -} diff --git a/nix/packages.nix b/nix/packages.nix deleted file mode 100644 index d0e13d1..0000000 --- a/nix/packages.nix +++ /dev/null @@ -1,103 +0,0 @@ -{ - lib, - inputs, - ... -}: -let - inherit (lib) mkOption mdDoc types; - inherit (inputs.flake-parts.lib) mkPerSystemOption; -in -{ - options.perSystem = mkPerSystemOption ( - { - pkgs, - config, - ... - }: - { - options = { - buildPackages = mkOption { - description = mdDoc "Python package used in the project"; - type = types.listOf types.package; - default = ( with pkgs.python311Packages; [ - markdown-include - pelican - typogrify - ]); - }; - develPackages = mkOption { - description = mdDoc "Python package used to development"; - type = types.listOf types.package; - default = with pkgs; [ - convco - go-task - lefthook - rsync - shellcheck - shfmt - typos - ] - ++ ( with pkgs.python311Packages; [ - markdown-include - pelican - typogrify - livereload - invoke - ]); - }; - pelicanplugins = mkOption { - type = types.package; - description = mdDoc "Pelican plugins used in my blog"; - default = - with pkgs; - stdenvNoCC.mkDerivation { - name = "pelicanplugins"; - pname = "pelicanplugins"; - version = "1.0.0"; - sourceRoot = "."; - srcs = [ - (pkgs.fetchFromGitHub { - name = "neighbors"; - owner = "pelican-plugins"; - repo = "neighbors"; - rev = "60649ac6f3494d01a37b9c6d3d455f9dc2502d55"; - hash = "sha256-c6etuRqve9xj6NhGRAim2A0ae8xv6mI/yez+suQuZ8U="; - }) - (pkgs.fetchFromGitHub { - name = "markdown-include"; - owner = "pelican-plugins"; - repo = "markdown-include"; - rev = "df0b3e55c45471283ca62d6e157b61a8caa35e37"; - hash = "sha256-y0dIvyEYLbYqkm+6yJOUYI3apzEMJ/N/JUwWTqjdsNg="; - }) - ]; - installPhase = '' - cp -r markdown-include/pelican/plugins/ $out/ - cp -r neighbors/pelican/plugins/neighbors $out/ - ''; - }; - }; - pelicantheme = mkOption { - type = types.package; - description = mdDoc "My personnal Pelican theme"; - default = ( - with pkgs; - stdenvNoCC.mkDerivation { - name = "pelicantheme-atilla"; - pname = "pelicantheme-atilla"; - version = "main"; - src = pkgs.fetchgit { - url = "https://git.epha.se/ephase/attila_pelican_theme"; - rev = "c5923a4be38d9c646a9dc261fb0ba4f24fe5655a"; - hash = "sha256-DaaumjR23pXrACRHX9FssxE56nV7vLRy7HjRclm6rgs="; - }; - installPhase = '' - cp -r $src/ $out - ''; - } - ); - }; - }; - } - ); -} diff --git a/nix/treefmt.nix b/nix/treefmt.nix deleted file mode 100644 index e9641c2..0000000 --- a/nix/treefmt.nix +++ /dev/null @@ -1,18 +0,0 @@ -_: { - config.perSystem = - { - config, - inputs', - pkgs, - ... - }: - { - treefmt = { - programs = { - shfmt.enable = true; - alejandra.enable = true; - nixfmt.enable = true; - }; - }; - }; -} diff --git a/pelicanconf.py b/pelicanconf.py index b029bc1..70db034 100644 --- a/pelicanconf.py +++ b/pelicanconf.py @@ -2,16 +2,6 @@ # -*- coding: utf-8 -*- # from __future__ import unicode_literals -MARKDOWN = { - 'extension_configs': { - 'markdown.extensions.codehilite': {'css_class': 'highlight'}, - 'markdown.extensions.extra': {}, - 'markdown.extensions.meta': {}, - 'markdown.extensions.fenced_code': {}, - }, - 'output_format': 'html5', -} - SITENAME = 'Xieme-Art' SITEURL = 'https://xieme-art.org' SITESUBTITLE = """ @@ -83,7 +73,7 @@ AUTHOR_FEED_RSS = None THEME = 'theme/' PLUGIN_PATHS = ['plugins'] -PLUGINS = ['neighbors', 'md_include'] +PLUGINS = ['neighbors'] # Attila theme HEADER_COVERS_BY_CATEGORY = [] diff --git a/plugins b/plugins new file mode 160000 index 0000000..aef91ac --- /dev/null +++ b/plugins @@ -0,0 +1 @@ +Subproject commit aef91ac09a57ab61518a35b4b11fe711ee74e5e2 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..6a3f3e2 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,21 @@ +blinker==1.6.2 +commonmark==0.9.1 +docutils==0.20.1 +feedgenerator==2.1.0 +invoke==2.1.3 +Jinja2==3.1.2 +livereload==2.6.3 +Markdown==3.4.3 +markdown-it-py==3.0.0 +MarkupSafe==2.1.3 +mdurl==0.1.2 +pelican==4.8.0 +Pygments==2.15.1 +python-dateutil==2.8.2 +pytz==2023.3 +rich==13.4.2 +six==1.16.0 +smartypants==2.0.1 +tornado==6.3.2 +typogrify==2.0.7 +Unidecode==1.3.6 diff --git a/taskfile.yaml b/taskfile.yaml deleted file mode 100644 index e95e9d0..0000000 --- a/taskfile.yaml +++ /dev/null @@ -1,23 +0,0 @@ -version: "3" -set: [errexit, pipefail, nounset] -shopt: [globstar] -dotenv: - - .env -vars: - OUTPUT_PATH: ./output/ - DEPLOY_CMD: rsync - DEPLOY_ARGS: -avz --delete - -tasks: - build: - cmds: - - pelican -o {{.OUTPUT_PATH}} - serve: - cmds: - - invoke livereload - deploy: - deps: - - build - cmds: - - | - {{.DEPLOY_CMD}} {{.DEPLOY_ARGS}} {{.OUTPUT_PATH}} {{.HOSTNAME}}:{{.WWW_PATH}} diff --git a/theme b/theme new file mode 160000 index 0000000..2730c99 --- /dev/null +++ b/theme @@ -0,0 +1 @@ +Subproject commit 2730c99463c7bc3906fb94742240f0796b9370f6