Skip to content

Commit 1d269fc

Browse files
Only use search plugins for website styling (#4077)
1 parent 0236e85 commit 1d269fc

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

pelicanconf.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@
33
from __future__ import unicode_literals
44
import os
55

6+
# Adjust `TESTING_LOCALLY` if testing search functionality locally.
7+
TESTING_LOCALLY = False
8+
USE_EMAIL_THEME = True if os.environ.get('USE_EMAIL_THEME') == '1' else False
9+
610
AUTHOR = u'TWiR Contributors'
711
SITENAME = u"This Week in Rust"
8-
SITEURL = 'https://this-week-in-rust.org'
12+
SITEURL = 'https://this-week-in-rust.org' if not TESTING_LOCALLY else 'http://localhost:8000'
913

1014
SOURCE_URL = 'https://github.com/rust-lang/this-week-in-rust'
1115

12-
if '1' == os.environ.get('TWIR_NEWSLETTER_THEME'):
16+
if USE_EMAIL_THEME:
1317
THEME = 'themes/newsletter'
1418
else:
1519
THEME = 'themes/rusted'
@@ -48,9 +52,12 @@
4852
"""
4953
}
5054

51-
SEARCH_HTML_SELECTOR = "article"
52-
53-
PLUGINS = ['webassets', 'search']
55+
# Don't add search functionality for email.
56+
if USE_EMAIL_THEME:
57+
PLUGINS = ['webassets']
58+
else:
59+
PLUGINS = ['webassets', 'search']
60+
SEARCH_HTML_SELECTOR = "article"
5461

5562
MARKDOWN = {
5663
'extension_configs': {

publishing/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#
2020
# 2. This workflow will generate the desired email template, landing
2121
# the end contents in the local "output/" directory. This is the
22-
# equivalent of running `TWIR_NEWSLETTER_THEME=1 pelican --delete-output-directory content`
22+
# equivalent of running `USE_EMAIL_THEME=1 pelican --delete-output-directory content`
2323
# from a properly instantantiated environment.
2424
#
2525
# $ make build && make generate-email && make host-content
@@ -38,7 +38,7 @@
3838
# TODO: The BLOG_DOWNLOAD is only needed because one dockerfile will have to communicate
3939
# with another, and I don't want to deal with building out the networking logic... yet...
4040
# CHANGE ME! vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
41-
BLOG_DOWNLOAD=http://127.0.0.1:8000/blog/2023/01/25/this-week-in-rust-479/
41+
BLOG_DOWNLOAD=http://127.0.0.1:8000/blog/2022/11/16/this-week-in-rust-469/
4242

4343
website-workflow: build clean generate-website host-content
4444

@@ -58,7 +58,7 @@ generate-website: clean
5858

5959
generate-email: clean
6060
docker run -it \
61-
-e TWIR_NEWSLETTER_THEME=1 \
61+
-e USE_EMAIL_THEME=1 \
6262
-v $(shell pwd)/output:/usr/twir/output \
6363
twir:latest
6464

0 commit comments

Comments
 (0)