Skip to content

Commit

Permalink
feat: update search support for python3
Browse files Browse the repository at this point in the history
  • Loading branch information
azmelanar committed Apr 29, 2024
1 parent 1d1f783 commit d5331d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions create_search_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def walker(path):

# Takes html page and outputs json object
def parser(page):
soup = BeautifulSoup(open(page, 'r'))
soup = BeautifulSoup(open(page, 'r'), 'html.parser')
node = {}
try:
node['title'] = soup.title.get_text(' ', strip=True).replace(' ', ' ').replace('^', '^')
Expand Down Expand Up @@ -71,4 +71,4 @@ def sitemaper(nodes):
jsoner(nodes)
sitemaper(nodes)
else:
print 'Error: place this script in hugo site root'
print('Error: place this script in hugo site root')
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
beautifulsoup4==4.3.2
html5lib==1.0b8
beautifulsoup4==4.12.3
html5lib==1.1

0 comments on commit d5331d8

Please sign in to comment.