website: remove unused root path on building website (#3248)

We no longer use the `--root` option of `build_website.py` since we have
moved to jqlang.org (from jqlang.github.io/jq where the root was `/jq`).
We don't need the option on local development either since `http.server`
has the `-d` option to specify the directory to serve from.
This commit is contained in:
itchyny authored and GitHub committed 2025-02-06 22:42:27 +09:00
1 parent e33578a53e
commit fa6a2ff688
7 files changed
+20 -28

No files matched your search

-7
View File
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
import argparse
import glob
import itertools
from jinja2 import Environment, FileSystemLoader, select_autoescape, pass_context
@@ -11,10 +10,6 @@ import re
import shutil
import yaml
parser = argparse.ArgumentParser()
parser.add_argument('--root', default='')
args = parser.parse_args()
env = Environment(
loader=FileSystemLoader('templates'),
autoescape=select_autoescape(['html.j2']),
@@ -27,8 +22,6 @@ def load_yml_file(fn):
env.globals['url'] = 'https://jqlang.org'
env.globals['root'] = args.root
env.filters['search_id'] = lambda input: input.replace(r'`', '')
env.filters['section_id'] = lambda input: re.sub(
r'[^-a-zA-Z0-9_]', '', input.replace(' ', '-')).lower()