Hakyll stork search

Posted on October 2, 2012
Tags: hacksoft

Hakyll Setup Series

  1. Setup Mathjax
  2. Setup PlantUML
  3. Setup autobuild Hakyll site Git action CI
  4. Very Simple Hakyll Pandoc Filtering Example
  5. Add Railroad Syntax to Hakyll
  6. Table Of Content in Hakyll
  7. Hakyll Access on LAN server
[input]
url_prefix = "$root$/"
files = [
$for(posts)$
{path = "$path$", url = "$url$", title = "$title$"},
$endfor$
]
    create ["searchindex.toml"] $ do
        route idRoute
        compile $ do
            posts <- recentFirst =<< loadAll ("posts/*" .||. "posts/*/*.md" .||. "posts/*/*.markdown") 
            let indexCtx =
                    listField "posts" postCtx (return posts) <>
                    constField "title" "Home"                <>
                    constField "root" root                   <>
                    defaultContext

            makeItem ""
                >>= loadAndApplyTemplate "templates/search.toml" indexCtx

for rhel:

#on RHEL
./stork-amazon-linux build --input "./docs/searchindex.toml" --output "./docs/storksearch.st"

for debian:

./stork-ubuntu-20-04 build --input "./docs/searchindex.toml" --output "./docs/storksearch.st"  

1 Makefile

alternatively use a Makefile

run:
	stack exec -- site watch --host "0.0.0.0" 
build:
	stack exec site build
stbuild: build 
	./stork-ubuntu-20-04 build --input "./docs/searchindex.toml" --output "./docs/storksearch.st"
stbuildrhel: build
	./stork-amazon-linux build --input "./docs/searchindex.toml" --output "./docs/storksearch.st"

2 git merge conflict

typically you get a git merge conflict if you update your search index and want to merge to remote github.
You want to take the local new stork search so do this.

Attempt a gitmerge with vscode, then you should see this with git status

On branch main
Your branch and 'origin/main' have diverged,
and have 1 and 1 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
        both modified:   docs/storksearch.st
git checkout --ours /home/rhel/userjy.github.io/docs/storksearch.st
git add .

then vscode should allow you to sync