Skip to content

Commit

Permalink
Get rid of the def macro
Browse files Browse the repository at this point in the history
  • Loading branch information
Saransh-cpp committed Oct 11, 2022
1 parent 30a3ab9 commit cf02fdf
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 deletions.
32 changes: 20 additions & 12 deletions docs/workflow/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,18 @@ Finally, we want to deploy the main website and the PR preview on different bran

Now to avoid problems with the subfolder structure of our website we need to make a small change to our `config.md` file.
Change the following lines
```julia
@def prepath = "myprepath" # This is possibly "" for your case
@def website_url = "mywebsite.github.io"
```markdown
+++
prepath = "myprepath" # This is possibly "" for your case
website_url = "mywebsite.github.io"
+++
```
to
```julia
@def prepath = get(ENV, "PREVIEW_FRANKLIN_PREPATH", "myprepath") # In the third argument put the prepath you normally use
@def website_url = get(ENV, "PREVIEW_FRANKLIN_WEBSITE_URL", "mywebsite.github.io") # Just put the website name
```markdown
+++
@prepath = get(ENV, "PREVIEW_FRANKLIN_PREPATH", "myprepath") # In the third argument put the prepath you normally use
@website_url = get(ENV, "PREVIEW_FRANKLIN_WEBSITE_URL", "mywebsite.github.io") # Just put the website name
+++
```

Now for the final step, you will need to visualize the obtained previews.
Expand Down Expand Up @@ -290,14 +294,18 @@ Finally, we want to deploy the main website and the PR preview on the same branc
Now to avoid problems with the subfolder structure of our website we need to make a small change to our `config.md` file.
Change the following lines

```julia
@def prepath = "myprepath" # This is possibly "" for your case
@def website_url = "mywebsite.github.io"
```markdown
+++
prepath = "myprepath" # This is possibly "" for your case
website_url = "mywebsite.github.io"
+++
```
to
```julia
@def prepath = get(ENV, "PREVIEW_FRANKLIN_PREPATH", "myprepath") # In the third argument put the prepath you normally use
@def website_url = get(ENV, "PREVIEW_FRANKLIN_WEBSITE_URL", "mywebsite.github.io") # Just put the website name
```markdown
+++
prepath = get(ENV, "PREVIEW_FRANKLIN_PREPATH", "myprepath") # In the third argument put the prepath you normally use
website_url = get(ENV, "PREVIEW_FRANKLIN_WEBSITE_URL", "mywebsite.github.io") # Just put the website name
+++
```

Once everything is set up you will be able to visualize your PR preview on `{github username}.github.io/previews/PR{number of your PR}`.
Expand Down
6 changes: 4 additions & 2 deletions docs/workflow/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,10 @@ See `?publish` for more information.

In any case, before deploying, if you're working on a _project website_ i.e. a website whose root URL will look like `username.gitlab.io/project/` then you should add the following line in your `config.md` file:

```julia
@def prepath = "project"
```markdown
+++
prepath = "project"
+++
```

the `publish` function will then ensure that all links are fixed before deploying your website.
Expand Down

0 comments on commit cf02fdf

Please sign in to comment.