Skip to content

Commit a2cedb3

Browse files
authored
Merge pull request #145 from darsnack/franklin
Port website to Franklin.jl
2 parents 4be8e6c + f4a7b0d commit a2cedb3

File tree

231 files changed

+1206
-10726
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

231 files changed

+1206
-10726
lines changed

.github/workflows/CleanPreview.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# from https://github.com/CliMA/ClimaTimeSteppers.jl
2+
name: Doc Preview Cleanup
3+
4+
on:
5+
pull_request:
6+
types: [closed]
7+
8+
jobs:
9+
doc-preview-cleanup:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout gh-pages branch
13+
uses: actions/checkout@v2
14+
with:
15+
ref: gh-pages
16+
- name: Delete preview and history + push changes
17+
run: |
18+
if [ -d "previews/PR$PRNUM" ]; then
19+
git config user.name "Documenter.jl"
20+
git config user.email "documenter@juliadocs.github.io"
21+
git rm -rf "previews/PR$PRNUM"
22+
git commit -m "delete preview"
23+
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
24+
git push --force origin gh-pages-new:gh-pages
25+
fi
26+
env:
27+
PRNUM: ${{ github.event.number }}

.github/workflows/Comment.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: PR Comment # Write a comment in the PR with a link to the preview of the given website
2+
on:
3+
pull_request:
4+
types: [opened, reopened]
5+
jobs:
6+
pr_comment:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Create PR comment
10+
if: github.event_name == 'pull_request' && github.repository == github.event.pull_request.head.repo.full_name # if this is a pull request build AND the pull request is NOT made from a fork
11+
uses: thollander/actions-comment-pull-request@71efef56b184328c7ef1f213577c3a90edaa4aff
12+
with:
13+
message: 'Once the build has completed, you can preview your PR at this URL: https://fluxml.ai/previews/PR${{ github.event.number }}/'
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/Deploy.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Build and Deploy
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
build-and-deploy:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
with:
16+
persist-credentials: false
17+
# NOTE: Python is necessary for the pre-rendering (minification) step
18+
- name: Install python
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: '3.8'
22+
# NOTE: Here you can install dependencies such as matplotlib if you use
23+
# packages such as PyPlot.
24+
# - run: pip install matplotlib
25+
- name: Install Julia
26+
uses: julia-actions/setup-julia@v1
27+
# NOTE
28+
# The steps below ensure that NodeJS and Franklin are loaded then it
29+
# installs highlight.js which is needed for the prerendering step
30+
# (code highlighting + katex prerendering).
31+
# Then the environment is activated and instantiated to install all
32+
# Julia packages which may be required to successfully build your site.
33+
# The last line should be `optimize()` though you may want to give it
34+
# specific arguments, see the documentation or ?optimize in the REPL.
35+
- run: julia -e '
36+
using Pkg; Pkg.add(["NodeJS", "Franklin"]);
37+
using NodeJS; run(`$(npm_cmd()) install highlight.js`);
38+
using Franklin;
39+
Pkg.activate("."); Pkg.instantiate();
40+
optimize()'
41+
- name: Fix URLs for PR preview deployment (pull request previews)
42+
if: github.event_name == 'pull_request'
43+
run: |
44+
echo "PREVIEW_FRANKLIN_WEBSITE_URL=https://fluxml.ai/previews/PR${{ github.event.number }}/" >> $GITHUB_ENV
45+
echo "PREVIEW_FRANKLIN_PREPATH=previews/PR${{ github.event.number }}" >> $GITHUB_ENV
46+
- name: Deploy (preview)
47+
if: github.event_name == 'pull_request' && github.repository == github.event.pull_request.head.repo.full_name # if this build is a PR build and the PR is NOT from a fork
48+
uses: JamesIves/github-pages-deploy-action@releases/v4
49+
with:
50+
branch: gh-pages # The branch where the PRs previews are stored
51+
folder: __site
52+
token: ${{ secrets.GITHUB_TOKEN }}
53+
target-folder: "previews/PR${{ github.event.number }}" # The website preview is going to be stored in a subfolder
54+
- name: Deploy (main)
55+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
56+
uses: JamesIves/github-pages-deploy-action@releases/v4
57+
with:
58+
token: ${{ secrets.GITHUB_TOKEN }}
59+
branch: gh-pages # Replace here the branch where your website is deployed
60+
folder: __site
61+
clean-exclude: |
62+
previews/*

.gitignore

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
_site
2-
.sass-cache
3-
.jekyll-metadata
4-
Gemfile.lock
5-
6-
vendor
7-
bin
1+
__site/
2+
.DS_Store
3+
franklin
4+
franklin.pub
5+
node_modules/
6+
Manifest.toml

404.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
---
2-
layout: page
3-
---
4-
1+
~~~
52
<style type="text/css" media="screen">
63
h1 {
74
padding: 30px 0;
@@ -13,8 +10,11 @@ layout: page
1310
text-align: center;
1411
}
1512
</style>
13+
~~~
1614

17-
# 404
15+
~~~
16+
<h1>404</h1>
17+
~~~
1818

1919
**Page not found :(**
2020

CNAME

Lines changed: 0 additions & 1 deletion
This file was deleted.

Gemfile

Lines changed: 0 additions & 33 deletions
This file was deleted.

Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[deps]
2+
Franklin = "713c75ef-9fc9-4b05-94a9-213340da978e"
3+
NodeJS = "2bd173c7-0d6d-553b-b6af-13a54713934c"

0 commit comments

Comments
 (0)