Skip to content

Commit

Permalink
Merge pull request #97 from openzim/do_not_index_user_pages
Browse files Browse the repository at this point in the history
Do not add user pages to search index
  • Loading branch information
benoit74 authored Mar 2, 2024
2 parents 1983d98 + a4bf9cb commit c0d0301
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "0.3.0"
rev: v0.3.0
hooks:
- id: ruff
- repo: https://github.com/RobertCraigie/pyright-python
Expand Down
4 changes: 2 additions & 2 deletions src/ifixit2zim/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,15 +360,15 @@ def cleanup_rendered_content(self, content, rel_prefix="../"):
def convert_title_to_filename(self, title):
return re.sub(r"\s", "_", title)

def add_html_item(self, path, title, content):
def add_html_item(self, path, title, content, *, is_front=True):
with self.lock:
logger.debug(f"Adding item in ZIM at path '{path}'")
self.creator.add_item_for(
path=path,
title=title,
content=content,
mimetype="text/html",
is_front=True,
is_front=is_front,
)

def add_redirect(self, path, target_path):
Expand Down
1 change: 1 addition & 0 deletions src/ifixit2zim/scraper_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def process_one_item(self, _, item_data, item_content):
path=normal_path,
title=user_content["username"],
content=user_rendered,
is_front=False,
)

for other_user_title in self.user_id_to_titles[userid]:
Expand Down

0 comments on commit c0d0301

Please sign in to comment.