pelican-plugins / search

Pelican plugin that adds site search capability
47 stars 9 forks source link

`search.toml` file is not being generated #16

Closed Bobspadger closed 2 months ago

Bobspadger commented 1 year ago

I have installed the plugin, using Flex theme. I cannot see any search.toml, or instructions on how to generate it.

Issue

Trying to generate my theme, with the search enabled, and I get errors regarding no search.toml file - it is similar to https://github.com/pelican-plugins/search/issues/3 and it appears all I need is a search.toml file. However, I can't see any definitive / suggested configurations for pelican.

If you could point me in the correct direction that would be superb!

Thanks

justinmayer commented 1 year ago

Hi Alex. The search.toml file is generated by the plugin automatically.. The error you describe seems to indicate some other problem that is preventing Stork from generating that file. Perhaps running with --debug, as mentioned in the How to Get Help section of the docs?

s-hell commented 2 months ago

I'm not sure but maybe i have the same problem. Running make devserver i get the error:

Search plugin reported Error: No files specified in config file

Running pelican with debug options i get:


           INFO     Writing /home/USER/git/folder/homepage2/output/categories.html                                  writers.py:223
           CRITICAL Exception: Search plugin reported Error: No files specified in config file                            __init__.py:666

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/USER/.local/pipx/venvs/pelican/lib/python3.12/site-packages/pelican/plugins/search/se │
│ arch.py:70 in build_search_index                                                                 │
│                                                                                                  │
│    67 │   │   if not which("stork"):                                                             │
│    68 │   │   │   raise Exception("Stork must be installed and available on $PATH.")             │
│    69 │   │   try:                                                                               │
│ ❱  70 │   │   │   output = subprocess.run(                                                       │
│    71 │   │   │   │   [                                                                          │
│    72 │   │   │   │   │   "stork",                                                               │
│    73 │   │   │   │   │   "build",                                                               │
│                                                                                                  │
│ /usr/lib/python3.12/subprocess.py:571 in run                                                     │
│                                                                                                  │
│    568 │   │   │   raise                                                                         │
│    569 │   │   retcode = process.poll()                                                          │
│    570 │   │   if check and retcode:                                                             │
│ ❱  571 │   │   │   raise CalledProcessError(retcode, process.args,                               │
│    572 │   │   │   │   │   │   │   │   │    output=stdout, stderr=stderr)                        │
│    573 │   return CompletedProcess(process.args, retcode, stdout, stderr)                        │
│    574                                                                                           │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
CalledProcessError: Command '['stork', 'build', '--input', 'output/search.toml', '--output', 'output/search-index.st']' returned non-zero
exit status 1.

The error is little bit wired, because stork is installed normally to /usr/local/bin

justinmayer commented 2 months ago

@s-hell: Maybe Pipx has some kind of isolation that is preventing /usr/local/bin/stork from being accessible from $PATH? I can't replicate that error in a regular (non-Pipx) virtual environment context, but if you discover something that warrants adjustment in the Search plugin, please comment on this issue and I'll re-open it.