Skip to content

Commit

Permalink
Fetch template updates
Browse files Browse the repository at this point in the history
- Include updates and fixes from (alshedivat/al-folio#2613) to (alshedivat/al-folio#2826)
- Update till commit c5d484e on Dec 3, 2024
  • Loading branch information
HangJung97 committed Dec 3, 2024
1 parent 97c58d2 commit 840d83b
Show file tree
Hide file tree
Showing 57 changed files with 23,117 additions and 42,124 deletions.
9 changes: 5 additions & 4 deletions .github/ISSUE_TEMPLATE/1_bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ body:
value: >
Before you go any further. Is this really a **🐛 bug**?
If it's a question about how al-folio works, have a look at our [documentation](https://github.com/alshedivat/al-folio/blob/master/README.md),
[frequently asked questions](https://github.com/alshedivat/al-folio/blob/master/FAQ.md),
If it's a question about how al-folio works, have a look at our [documentation](https://github.com/alshedivat/al-folio/blob/main/README.md),
[frequently asked questions](https://github.com/alshedivat/al-folio/blob/main/FAQ.md),
[past questions](https://github.com/alshedivat/al-folio/discussions/categories/q-a),
or [ask a question](https://github.com/alshedivat/al-folio/discussions/new?category=q-a).
Expand All @@ -20,7 +20,7 @@ body:
Please check if somebody else has already filed the same issue.
If you find a similar issue, please add a 👍 reaction or comment on the original post.
options:
- label: I read through [FAQ](https://github.com/alshedivat/al-folio/blob/master/FAQ.md) and searched through the [past issues](https://github.com/alshedivat/al-folio/issues), none of which addressed my issue.
- label: I read through [FAQ](https://github.com/alshedivat/al-folio/blob/main/FAQ.md) and searched through the [past issues](https://github.com/alshedivat/al-folio/issues), none of which addressed my issue.
required: true
- label: Yes, I have checked that this issue isn't already filed.
required: true
Expand Down Expand Up @@ -81,7 +81,8 @@ body:
description: select all environments where you have experienced this issue
multiple: true
options:
- "Running locally with Docker"
- "Running locally with Docker (docker compose)"
- "Running locally with Docker (devcontainer)"
- "Running locally without Docker"
- "Deployed site"
validations:
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/2_feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ body:
value: >
Before you go any further, are you sure that this feature is not already implemented?
If it's a question about how al-folio works, have a look at our [documentation](https://github.com/alshedivat/al-folio/blob/master/README.md),
[frequently asked questions](https://github.com/alshedivat/al-folio/blob/master/FAQ.md),
If it's a question about how al-folio works, have a look at our [documentation](https://github.com/alshedivat/al-folio/blob/main/README.md),
[frequently asked questions](https://github.com/alshedivat/al-folio/blob/main/FAQ.md),
[past questions](https://github.com/alshedivat/al-folio/discussions/categories/q-a),
or [ask a question](https://github.com/alshedivat/al-folio/discussions/new?category=q-a).
Expand All @@ -20,7 +20,7 @@ body:
Please check if somebody else has already filed the same 🚀 feature request.
If you find a similar feature request, please add a 👍 reaction or comment on the original post.
options:
- label: I read through [FAQ](https://github.com/alshedivat/al-folio/blob/master/FAQ.md) and searched through the [past issues](https://github.com/alshedivat/al-folio/issues), none of which addressed my feature request.
- label: I read through [FAQ](https://github.com/alshedivat/al-folio/blob/main/FAQ.md) and searched through the [past issues](https://github.com/alshedivat/al-folio/issues), none of which addressed my feature request.
required: true
- label: Yes, I have checked that this feature request isn't already filed.
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ contact_links:
url: https://github.com/alshedivat/al-folio/discussions/categories/q-a
about: Ask and answer al-folio related questions.
- name: 📖 Read the documentation
url: https://github.com/alshedivat/al-folio/blob/master/README.md
url: https://github.com/alshedivat/al-folio/blob/main/README.md
about: Please consult the documentation before opening any issues!
4 changes: 2 additions & 2 deletions .github/workflows/broken-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ jobs:
- uses: actions/checkout@v4

- name: Link Checker 🔗
uses: lycheeverse/lychee-action@v1.9.0
uses: lycheeverse/lychee-action@v2.1.0
with:
fail: true
# removed md files that include liquid tags
args: --user-agent 'curl/7.54' --exclude-path README.md --exclude-path _pages/404.md --exclude-path _pages/blog.md --exclude-path _posts/2018-12-22-distill.md --exclude-path _pages/cv.md --exclude-path _news/ --exclude https://www.jpa.gov.my/ --verbose --no-progress './**/*.md' './**/*.html'
args: --user-agent 'curl/7.54' --exclude-path README.md --exclude-path _pages/404.md --exclude-path _pages/blog.md --exclude-path _pages/cv.md --exclude-path _news/ --exclude-path _posts/2018-12-22-distill.md --exclude-path _posts/2023-04-24-videos.md --verbose --no-progress './**/*.md' './**/*.html'
11 changes: 8 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,16 @@ jobs:
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Setup Ruby
- name: Setup Ruby 💎
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2.2"
ruby-version: "3.3.5"
bundler-cache: true
- name: Setup Python 🐍
uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: "pip" # caching pip dependencies
- name: Update _config.yml ⚙️
uses: fjogeleit/yaml-update-action@main
with:
Expand All @@ -81,7 +86,7 @@ jobs:
value: ${{ github.repository }}
- name: Install and Build 🔧
run: |
pip3 install --upgrade jupyter
pip3 install --upgrade nbconvert
export JEKYLL_ENV=production
bundle exec jekyll build
- name: Purge unused CSS 🧹
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/lighthouse-badger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ name: "Lighthouse Badger"
# INPUTS as Secrets (env) for not manually triggered workflows
env:
URLS: https://alshedivat.github.io/al-folio/
TOKEN_NAME: ${{ secrets.LIGHTHOUSE_BADGER_TOKEN }}
# If any of the following env is blank, a default value is used instead
REPO_BRANCH: "${{ github.repository }} master" # target repository & branch e.g. 'dummy/mytargetrepo main'
MOBILE_LIGHTHOUSE_PARAMS: "--only-categories=performance,accessibility,best-practices,seo --throttling.cpuSlowdownMultiplier=2"
Expand Down Expand Up @@ -50,7 +49,7 @@ jobs:
- uses: actions/checkout@v4
with:
repository: ${{ env.REPOSITORY }}
token: ${{ secrets[github.event.inputs.token_name] || secrets[env.TOKEN_NAME] }}
token: ${{ secrets.LIGHTHOUSE_BADGER_TOKEN }}
ref: ${{ env.BRANCH }}
- uses: actions/checkout@v4
with:
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/prettier-html.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Prettify gh-pages

on:
workflow_dispatch:

jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages

- name: Find and Remove </source> Tags
run: find . -type f -name "*.html" -exec sed -i 's/<\/source>//g' {} +

- name: Set up Node.js
uses: actions/setup-node@v4

- name: Install Prettier
run: npm install -g prettier

- name: Check for Prettier
run: npx prettier --version || echo "Prettier not found"

- name: Run Prettier on HTML files
run: npx prettier --write '**/*.html'

- name: Commit and push changes
run: |
git config user.name "github-actions"
git config user.email "actions@github.com"
git add .
git commit -m "Formatted HTML files" || echo "No changes to commit"
git push
39 changes: 39 additions & 0 deletions .github/workflows/schedule-posts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish posts scheduled for today

on:
schedule:
# Run every day at 23:30 UTC or manually run
- cron: "30 23 * * *"
workflow_dispatch:

jobs:
publish_scheduled:
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@v4
with:
ref: main

- name: Get the date for today
id: date
run: echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV

- name: Check for scheduled posts and move to posts
run: |
echo "Today is $TODAY"
shopt -s nullglob
for file in _scheduled/${TODAY}-*.md; do
echo "Found scheduled: $file"
mv "$file" "_posts/"
echo "Moved $file to _posts/"
done
- name: Commit and push changes
run: |
git config user.name "github-actions"
git config user.email "actions@github.com"
git add _posts/
git add _scheduled/
git commit -m "Posted Scheduled Drafts on $TODAY" || echo "No changes to commit"
git push
3 changes: 3 additions & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
linkedin.com
reddit.com
jpa.gov.my
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ assets/plotly/demo.html
lighthouse_results/**
_posts/2015-10-20-math.md
_sass/font-awesome/*.scss
_sass/tabler-icons/*.scss
32 changes: 30 additions & 2 deletions CUSTOMIZE.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ scholar:
first_name: [Albert, A.]
```
If the entry matches one form of the last names and the first names, it will be underlined. Keep meta-information about your co-authors in [\_data/coauthors.yml](_data/coauthors.yml) and Jekyll will insert links to their webpages automatically. The co-author data format is as follows,
If the entry matches one form of the last names and the first names, it will be underlined. Keep meta-information about your co-authors in [\_data/coauthors.yml](_data/coauthors.yml) and Jekyll will insert links to their webpages automatically. The co-author data format is as follows, with the last names lower cased and without accents as the key:
```yaml
"adams":
Expand All @@ -115,7 +115,7 @@ If the entry matches one form of the last names and the first names, it will be
url: https://en.wikipedia.org/wiki/Carl_Philipp_Emanuel_Bach
```
If the entry matches one of the combinations of the last names and the first names, it will be highlighted and linked to the url provided.
If the entry matches one of the combinations of the last names and the first names, it will be highlighted and linked to the url provided. Note that the keys **MUST BE** lower cased and **MUST NOT** contain accents. This is because the keys are used to match the last names in the BibTeX entries, considering possible variations.
### Buttons (through custom bibtex keywords)
Expand Down Expand Up @@ -169,3 +169,31 @@ Due to the necessary permissions (PAT and others mentioned above), it is recomme
## Customizing fonts, spacing, and more

You can customize the fonts, spacing, and more by editing [\_sass/\_base.scss](_sass/_base.scss). The easiest way to try in advance the changes is by using [chrome dev tools](https://developer.chrome.com/docs/devtools/css) or [firefox dev tools](https://firefox-source-docs.mozilla.org/devtools-user/). In there you can click in the element and find all the attributes that are set for that element and where are they. For more information on how to use this, check [chrome](https://developer.chrome.com/docs/devtools/css) and [firefox](https://firefox-source-docs.mozilla.org/devtools-user/page_inspector/how_to/examine_and_edit_css/index.html) how-tos, and [this tutorial](https://www.youtube.com/watch?v=l0sgiwJyEu4).

## Scheduled Posts

`al-folio` contains a workflow which automatically publishes all posts scheduled at a specific day, at the end of the day (23:30). By default the action is disabled, and to enable it you need to go to `.github/workflows/` and find the file called `schedule-posts.txt`. This is the workflow file. For GitHub to recognize it as one (or to enable the action), you need to rename it to `schedule-posts.yml`.

In order to use this you need to save all of your "Completed" blog posts which are scheduled to be uploaded on a specific date, in a folder named `_scheduled/` in the root directory.

> Incomplete posts should be saved in `_drafts/`

### Name Format

In this folder you need to store your file in the same format as you would in `_posts/`

> Example file name: `2024-08-26-This file will be uploaded on 26 August.md`

### Important Notes

- The scheduler uploads posts everyday at 🕛 23:30 UTC
- It will only upload posts at 23:30 UTC of their respective scheduled days, It's not uploaded in 23:59 in case there are a lot of files as the scheduler must finish before 00:00
- It will only upload files which follow the pattern `yyyy-mm-dd-title.md`
- This means that only markdown files will be posted
- It means that any markdown which do not follow this pattern will not be posted
- The scheduler works by moving posts from the `_scheduled/` directory to `_posts/`, it will not post to folders like `_projects/` or `_news/`
- The date in the name of the file is the day that file will be uploaded on
- `2024-08-27-file1.md` will not be posted before or after 27-August-2024 (Scheduler only works for posts scheduled on the present day)
- `2025-08-27-file2.md` will be posted exactly on 27-August-2025
- `File3.md` will not be posted at all
- `2026-02-31-file4.md` is supposed to be posted on 31-February-2026, but there is no 31st in February hence this file will never be posted either
66 changes: 50 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,41 +1,75 @@
FROM ruby:latest

# uncomment these if you are having this issue with the build:
# /usr/local/bundle/gems/jekyll-4.3.4/lib/jekyll/site.rb:509:in `initialize': Permission denied @ rb_sysopen - /srv/jekyll/.jekyll-cache/.gitignore (Errno::EACCES)
# ARG GROUPID=901
# ARG GROUPNAME=ruby
# ARG USERID=901
# ARG USERNAME=jekyll

ENV DEBIAN_FRONTEND noninteractive

Label MAINTAINER Amir Pourmand
LABEL authors="Amir Pourmand,George Araújo" \
description="Docker image for al-folio academic template" \
maintainer="Amir Pourmand"

RUN apt-get update -y && apt-get install -y --no-install-recommends \
locales \
imagemagick \
build-essential \
zlib1g-dev \
jupyter-nbconvert \
inotify-tools procps && \
apt-get clean && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
# uncomment these if you are having this issue with the build:
# /usr/local/bundle/gems/jekyll-4.3.4/lib/jekyll/site.rb:509:in `initialize': Permission denied @ rb_sysopen - /srv/jekyll/.jekyll-cache/.gitignore (Errno::EACCES)
# add a non-root user to the image with a specific group and user id to avoid permission issues
# RUN groupadd -r $GROUPNAME -g $GROUPID && \
# useradd -u $USERID -m -g $GROUPNAME $USERNAME

# install system dependencies
RUN apt-get update -y && \
apt-get install -y --no-install-recommends \
build-essential \
curl \
imagemagick \
inotify-tools \
locales \
nodejs \
procps \
python3-pip \
zlib1g-dev && \
pip --no-cache-dir install --upgrade --break-system-packages nbconvert

# clean up
RUN apt-get clean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* /tmp/*

# set the locale
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
locale-gen


ENV LANG=en_US.UTF-8 \
# set environment variables
ENV EXECJS_RUNTIME=Node \
JEKYLL_ENV=production \
LANG=en_US.UTF-8 \
LANGUAGE=en_US:en \
LC_ALL=en_US.UTF-8 \
JEKYLL_ENV=production
LC_ALL=en_US.UTF-8

# create a directory for the jekyll site
RUN mkdir /srv/jekyll

# copy the Gemfile and Gemfile.lock to the image
ADD Gemfile.lock /srv/jekyll
ADD Gemfile /srv/jekyll

# set the working directory
WORKDIR /srv/jekyll

# install jekyll and dependencies
RUN gem install jekyll bundler

RUN gem install --no-document jekyll bundler
RUN bundle install --no-cache
# && rm -rf /var/lib/gems/3.1.0/cache

EXPOSE 8080

COPY bin/entry_point.sh /tmp/entry_point.sh

# uncomment this if you are having this issue with the build:
# /usr/local/bundle/gems/jekyll-4.3.4/lib/jekyll/site.rb:509:in `initialize': Permission denied @ rb_sysopen - /srv/jekyll/.jekyll-cache/.gitignore (Errno::EACCES)
# set the ownership of the jekyll site directory to the non-root user
# USER $USERNAME

CMD ["/tmp/entry_point.sh"]
Loading

0 comments on commit 840d83b

Please sign in to comment.