Skip to content

Commit 1dcebd1

Browse files
committed
2 parents 66e2f20 + 7aa6181 commit 1dcebd1

File tree

4 files changed

+42
-2
lines changed

4 files changed

+42
-2
lines changed

Dockerfile

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Base image: Ruby with necessary dependencies for Jekyll
2+
FROM ruby:3.2
3+
4+
# Install dependencies
5+
RUN apt-get update && apt-get install -y \
6+
build-essential \
7+
nodejs \
8+
&& rm -rf /var/lib/apt/lists/*
9+
10+
# Set the working directory inside the container
11+
WORKDIR /usr/src/app
12+
13+
# Copy Gemfile and Gemfile.lock into the container (necessary for `bundle install`)
14+
COPY Gemfile Gemfile.lock ./
15+
16+
# Install bundler and dependencies
17+
RUN gem install bundler:2.3.26 && bundle install
18+
19+
# Expose port 4000 for Jekyll server
20+
EXPOSE 4000
21+
22+
# Command to serve the Jekyll site
23+
CMD ["bundle", "exec", "jekyll", "serve", "--host", "0.0.0.0", "--watch"]
24+

README.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
See more info at https://academicpages.github.io/
1515

16-
## Running Locally
16+
## Running locally
1717

1818
When you are initially working your website, it is very useful to be able to preview the changes locally before pushing them to GitHub. To work locally you will need to:
1919

@@ -35,6 +35,21 @@ When you are initially working your website, it is very useful to be able to pre
3535

3636
If you are running on Linux it may be necessary to install some additional dependencies prior to being able to run locally: `sudo apt install build-essential gcc make`
3737

38+
## Using Docker
39+
40+
Working from a different OS, or just want to avoid installing dependencies? You can use the provided `Dockerfile` to build a container that will run the site for you if you have [Docker](https://www.docker.com/) installed.
41+
42+
Start by build the container:
43+
44+
```bash
45+
docker build -t jekyll-site .
46+
```
47+
48+
Next, run the container:
49+
```bash
50+
docker run -p 4000:4000 --rm -v $(pwd):/usr/src/app jekyll-site
51+
```
52+
3853
# Maintenance
3954

4055
Bug reports and feature requests to the template should be [submitted via GitHub](https://github.com/academicpages/academicpages.github.io/issues/new/choose). For questions concerning how to style the template, please feel free to start a [new discussion on GitHub](https://github.com/academicpages/academicpages.github.io/discussions).

_includes/comments.html

+2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ <h4 class="page__comments-title">{{ site.data.ui-text[site.locale].comments_labe
7676
{% endif %}
7777
</section>
7878
{% when "custom" %}
79+
<h4 class="page__comments-title">{{ comments_label }}</h4>
7980
<section id="comments"></section>
81+
{% include /comments-providers/scripts.html %}
8082
{% endcase %}
8183
</div>

_includes/scripts.html

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
<script src="{{ base_path }}/assets/js/main.min.js"></script>
22

33
{% include analytics.html %}
4-
{% include /comments-providers/scripts.html %}

0 commit comments

Comments
 (0)