Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 46 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,33 +181,52 @@ you intend to build the website or email newsletter.

### Building the website

*Before attempting to build the website, ensure Docker is in a running state on your system.*

* Enter the `publishing/` directory:
```sh
cd publishing
```
* Run the Docker build and website local-host command:
```sh
make build && make generate-website && make host-content
```
* View the website locally at default http://localhost:8000, or specific posts
at http://localhost:8000/blog/{YEAR}/{MONTH}/{DAY}/{ISSUE}/

Note: If looking to test the website's search functionality locally, you will need to adjust the [`TESTING_LOCALLY`](https://github.com/rust-lang/this-week-in-rust/blob/dc127f17fcabbf0f058eb3d5a3febba434ddca83/pelicanconf.py#L7)
variable to `True`.
> [!IMPORTANT]
>
> Before attempting to build the website, ensure Docker is in a running state on
> your system.

- Enter the `publishing/` directory:

```sh
cd publishing
```

- Run the Docker build and website local-host command:

```sh
make website
```

- View the website locally at default
[http://localhost:8000](http://localhost:8000), or specific posts at
`http://localhost:8000/blog/{YEAR}/{MONTH}/{DAY}/{ISSUE}/`

> [!NOTE]
>
> If looking to test the website's search functionality locally, you will need
> to adjust the
> [`TESTING_LOCALLY`](https://github.com/rust-lang/this-week-in-rust/blob/dc127f17fcabbf0f058eb3d5a3febba434ddca83/pelicanconf.py#L7)
> variable to `True`.

### Building the newsletter

*Before attempting to build the email newsletter, ensure Docker is in a running state on your system.*

* Enter the `publishing/` directory:
```sh
cd publishing
```
* Run the Docker build and website local-host command:
```sh
make build && make generate-email && make host-content
```
* View the email newsletter formatting of specific posts at
http://localhost:8000/blog/{YEAR}/{MONTH}/{DAY}/{ISSUE}/
> [!IMPORTANT]
>
> Before attempting to build the website, ensure Docker is in a running state on
> your system.

- Enter the `publishing/` directory:

```sh
cd publishing
```

- Run the Docker build and website local-host command:

```sh
make email
```

- View the email newsletter formatting of specific posts at
`http://localhost:8000/blog/{YEAR}/{MONTH}/{DAY}/{ISSUE}/`
31 changes: 21 additions & 10 deletions publishing/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
FROM --platform=linux/amd64 python:3.8.16-slim
FROM python:3.8.16-slim

# Must run from base TWIR directory... makefile takes care of this.
# Must run from base `twir` directory... Makefile takes care of this.
WORKDIR /usr/twir

RUN apt-get update && apt-get install -y curl build-essential
# Install deps and set locales
RUN apt-get update && apt-get install -y curl build-essential locales \
&& sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen \
&& locale-gen en_US.UTF-8 \
&& update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8

# pelican+friends
ENV LANG='en_US.UTF-8'
ENV LC_ALL='en_US.UTF-8'
# Set explicit locale environment variables
ENV LC_ALL=en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8

# PELICAN+FRIENDS
# install python reqs
COPY requirements.txt .
RUN pip3 install -r requirements.txt

# install Stork
RUN curl https://files.stork-search.net/releases/v1.5.0/stork-ubuntu-20-04 -o stork \
&& chmod +x stork \
&& mv ./stork /usr/bin/stork

# sass/juice
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
# install sass/juice
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
RUN apt-get install -y nodejs
RUN npm install -g sass juice

Expand All @@ -25,7 +35,8 @@ COPY plugins plugins
COPY themes themes
COPY pelicanconf.py pelicanconf.py

COPY publishing/*.sh ./
RUN chmod 777 *.sh
# make build && make generate-website && make host-website needs these scripts
COPY publishing/*.sh .
RUN chmod +x *.sh

CMD ["pelican", "--delete-output-directory", "content"]
Empty file modified publishing/run_server.sh
100644 → 100755
Empty file.