File tree Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change 3
3
from __future__ import unicode_literals
4
4
import os
5
5
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
+
6
10
AUTHOR = u'TWiR Contributors'
7
11
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'
9
13
10
14
SOURCE_URL = 'https://github.com/rust-lang/this-week-in-rust'
11
15
12
- if '1' == os . environ . get ( 'TWIR_NEWSLETTER_THEME' ) :
16
+ if USE_EMAIL_THEME :
13
17
THEME = 'themes/newsletter'
14
18
else :
15
19
THEME = 'themes/rusted'
48
52
"""
49
53
}
50
54
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"
54
61
55
62
MARKDOWN = {
56
63
'extension_configs' : {
Original file line number Diff line number Diff line change 19
19
#
20
20
# 2. This workflow will generate the desired email template, landing
21
21
# 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`
23
23
# from a properly instantantiated environment.
24
24
#
25
25
# $ make build && make generate-email && make host-content
38
38
# TODO: The BLOG_DOWNLOAD is only needed because one dockerfile will have to communicate
39
39
# with another, and I don't want to deal with building out the networking logic... yet...
40
40
# 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 /
42
42
43
43
website-workflow : build clean generate-website host-content
44
44
@@ -58,7 +58,7 @@ generate-website: clean
58
58
59
59
generate-email : clean
60
60
docker run -it \
61
- -e TWIR_NEWSLETTER_THEME =1 \
61
+ -e USE_EMAIL_THEME =1 \
62
62
-v $(shell pwd) /output:/usr/twir/output \
63
63
twir:latest
64
64
You can’t perform that action at this time.
0 commit comments