-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add nix flake to generate website with pelican
- Loading branch information
Showing
8 changed files
with
166 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Build and Deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # Adjust this as needed | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Nix | ||
uses: cachix/install-nix-action@v16 | ||
with: | ||
nix_path: nixpkgs=channel:nixos-unstable | ||
|
||
- name: Build site | ||
run: nix build .#defaultPackage.${{ matrix.system }} --print-build-logs | ||
|
||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Title: My First Post | ||
Date: 2023-01-01 | ||
Category: Test | ||
|
||
This is the content of my first post. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Title: My Second Post | ||
Date: 2023-01-02 | ||
Category: Test | ||
|
||
This is the content of my second post. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
description = "A flake to build a Pelican static site"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
}; | ||
|
||
outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
pkgs = import nixpkgs { inherit system; }; | ||
in { | ||
devShell = pkgs.mkShell { | ||
buildInputs = [ | ||
pkgs.python310 | ||
pkgs.python310Packages.pelican | ||
pkgs.python310Packages.markdown | ||
]; | ||
}; | ||
|
||
defaultPackage = pkgs.writeShellScriptBin "build-site" '' | ||
export PATH=$PATH:${pkgs.python310Packages.pelican}/bin | ||
pelican content -o output -s pelicanconf.py | ||
''; | ||
}); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
AUTHOR = 'Sergei Volkov' | ||
SITENAME = 'My Pelican Site' | ||
SITEURL = '' | ||
|
||
PATH = 'content' | ||
|
||
TIMEZONE = 'Europe/Berlin' | ||
|
||
DEFAULT_LANG = 'en' | ||
|
||
# Feed generation is usually not desired when developing | ||
FEED_ALL_ATOM = None | ||
CATEGORY_FEED_ATOM = None | ||
TRANSLATION_FEED_ATOM = None | ||
AUTHOR_FEED_ATOM = None | ||
AUTHOR_FEED_RSS = None | ||
|
||
# Blogroll | ||
LINKS = (('Pelican', 'https://getpelican.com/'),) | ||
|
||
# Social widget | ||
#SOCIAL = (('You can add links in your config file', '#'),) | ||
|
||
DEFAULT_PAGINATION = 10 | ||
|
||
# Uncomment following line if you want document-relative URLs when developing | ||
#RELATIVE_URLS = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import os | ||
import pelicanconf | ||
|
||
#SITEURL = 'https://taranarmo.github.io/' | ||
RELATIVE_URLS = False | ||
|
||
FEED_ALL_ATOM = 'feeds/all.atom.xml' | ||
CATEGORY_FEED_ATOM = 'feeds/{slug}.atom.xml' | ||
|
||
DELETE_OUTPUT_DIRECTORY = True | ||
|
||
# Following items are often useful when publishing | ||
|
||
#DISQUS_SITENAME = "" | ||
#GOOGLE_ANALYTICS = "" |