Skip to content

Commit

Permalink
Merge branch 'al-folio-main'
Browse files Browse the repository at this point in the history
  • Loading branch information
george-gca committed Mar 14, 2024
2 parents bab1a65 + c788a30 commit 7cf3696
Show file tree
Hide file tree
Showing 27 changed files with 42,173 additions and 76 deletions.
4 changes: 3 additions & 1 deletion CUSTOMIZE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Customize

Here we will give you some tips on how to customize the website. Note that throughout the [README.md](README.md) and [CUSTOMIZE.md](CUSTOMIZE.md) files, the default language is English (LANG = en-us). You must have an equivalent file or path for each language you have defined in [\_config.yml](_config.yml). For example, if you have defined `languages: ["en-us", "pt-br"]`, you must have 2 versions of the file `_data/LANG/cv.yml`: [\_data/en-us/cv.yml](_data/en-us/cv.yml) and [\_data/pt-br/cv.yml](_data/pt-br/cv.yml).
Here we will give you some tips on how to customize the website. One important thing to note is that **ALL** the changes you make should be done on the **main** branch of your repository. The `gh-pages` branch is automatically overwritten every time you make a change to the main branch.

Note that throughout the [README.md](README.md) and [CUSTOMIZE.md](CUSTOMIZE.md) files, the default language is English (LANG = en-us). You must have an equivalent file or path for each language you have defined in [\_config.yml](_config.yml). For example, if you have defined `languages: ["en-us", "pt-br"]`, you must have 2 versions of the file `_data/LANG/cv.yml`: [\_data/en-us/cv.yml](_data/en-us/cv.yml) and [\_data/pt-br/cv.yml](_data/pt-br/cv.yml).

## Project structure

Expand Down
18 changes: 9 additions & 9 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ The recommended approach for using **al-folio** is to first create your own site

1. Create a new repository using this template. For this, click on [Use this template -> Create a new repository](https://github.com/new?template_name=multi-language-al-folio&template_owner=george-gca) above the file list. If you plan to upload your site to `<your-github-username>.github.io`, note that the name of your repository :warning: **MUST BE** :warning: `<your-github-username>.github.io` or `<your-github-orgname>.github.io`, as stated in the [GitHub pages docs](https://docs.github.com/en/pages/getting-started-with-github-pages/about-github-pages#types-of-github-pages-sites).
2. In this new repository, go to `Settings -> Actions -> General -> Workflow permissions` and give `Read and write permissions` to GitHub Actions.
3. Open file `_config.yml`, set `url` to `https://<your-github-username>.github.io` and leave `baseurl` **empty**.
3. Open file `_config.yml`, set `url` to `https://<your-github-username>.github.io` and leave `baseurl` **empty** (do NOT delete it).
4. Finally, in the repository page go to `Settings -> Pages -> Build and deployment`, make sure that `Source` is set to `Deploy from a branch` and set the branch to `gh-pages` (NOT to master).
5. Wait until the GitHub actions finish, then simply navigate to `https://<your-github-username>.github.io` in your browser. At this point you should see a copy of the theme's [demo website](https://george-gca.github.io/multi-language-al-folio/).
5. Wait until the GitHub actions finish (check your repository **Actions** tab), then simply navigate to `https://<your-github-username>.github.io` in your browser. At this point you should see a copy of the theme's [demo website](https://george-gca.github.io/multi-language-al-folio/).

After everything is set up, you can download the repository to your machine and start customizing it. To do so, run the following commands:

Expand Down Expand Up @@ -91,30 +91,30 @@ To see the template running, open your browser and go to `http://localhost:4000`
## Deployment

Deploying your website to [GitHub Pages](https://pages.github.com/) is the most popular option.
Starting version [v0.3.5](https://github.com/alshedivat/al-folio/releases/tag/v0.3.5), **al-folio** will automatically re-deploy your webpage each time you push new changes to your repository! :sparkles:
Starting version [v0.3.5](https://github.com/alshedivat/al-folio/releases/tag/v0.3.5), **al-folio** will automatically re-deploy your webpage each time you push new changes to your repository **main branch**! :sparkles:

### For personal and organization webpages

1. The name of your repository **MUST BE** `<your-github-username>.github.io` or `<your-github-orgname>.github.io`.
2. In `_config.yml`, set `url` to `https://<your-github-username>.github.io` and leave `baseurl` empty.
3. Set up automatic deployment of your webpage (see instructions below).
4. Make changes, commit, and push!
4. Make changes to your main branch, commit, and push!
5. After deployment, the webpage will become available at `<your-github-username>.github.io`.

### For project pages

1. In `_config.yml`, set `url` to `https://<your-github-username>.github.io` and `baseurl` to `/<your-repository-name>/`.
2. Set up automatic deployment of your webpage (see instructions below).
3. Make changes, commit, and push!
3. Make changes to your main branch, commit, and push!
4. After deployment, the webpage will become available at `<your-github-username>.github.io/<your-repository-name>/`.

### Enabling automatic deployment

1. Click on **Actions** tab and **Enable GitHub Actions**; do not worry about creating any workflows as everything has already been set for you.
2. Go to `Settings -> Actions -> General -> Workflow permissions`, and give `Read and write permissions` to GitHub Actions
3. Make any other changes to your webpage, commit, and push. This will automatically trigger the **Deploy** action.
4. Wait for a few minutes and let the action complete. You can see the progress in the **Actions** tab. If completed successfully, in addition to the `master` branch, your repository should now have a newly built `gh-pages` branch.
5. Finally, in the **Settings** of your repository, in the Pages section, set the branch to `gh-pages` (**NOT** to `master`). For more details, see [Configuring a publishing source for your GitHub Pages site](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#choosing-a-publishing-source).
3. Make any other changes to your webpage, commit, and push to your main branch. This will automatically trigger the **Deploy** action.
4. Wait for a few minutes and let the action complete. You can see the progress in the **Actions** tab. If completed successfully, in addition to the `main` branch, your repository should now have a newly built `gh-pages` branch. **Do NOT touch this branch!**
5. Finally, in the **Settings** of your repository, in the Pages section, set the branch to `gh-pages` (**NOT** to `main`). For more details, see [Configuring a publishing source for your GitHub Pages site](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#choosing-a-publishing-source).

If you keep your site on another branch, open `.github/workflows/deploy.yml` **on the branch you keep your website on** and change `on->push->branches` and `on->pull\_request->branches` to the branch you keep your website on. This will trigger the action on pulls/pushes on that branch. The action will then deploy the website on the branch it was triggered from.

Expand All @@ -141,7 +141,7 @@ $ purgecss -c purgecss.config.js

which will replace the css files in the `_site/assets/css/` folder with the purged css files.

**Note:** Make sure to correctly set the `url` and `baseurl` fields in `_config.yml` before building the webpage. If you are deploying your webpage to `your-domain.com/your-project/`, you must set `url: your-domain.com` and `baseurl: /your-project/`. If you are deploying directly to `your-domain.com`, leave `baseurl` blank.
**Note:** Make sure to correctly set the `url` and `baseurl` fields in `_config.yml` before building the webpage. If you are deploying your webpage to `your-domain.com/your-project/`, you must set `url: your-domain.com` and `baseurl: /your-project/`. If you are deploying directly to `your-domain.com`, leave `baseurl` blank, **do not delete it**.

### Deployment to a separate repository (advanced users only)

Expand Down
2 changes: 1 addition & 1 deletion _includes/giscus.liquid
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div id="giscus_thread" style="max-width: {{ site.max_width }}; margin: 0 auto;">
{% if site.giscus.repo %}
<script>
let giscusTheme = localStorage.getItem('theme');
let giscusTheme = determineComputedTheme();
let giscusAttributes = {
src: 'https://giscus.app/client.js',
'data-repo': '{{ site.giscus.repo }}',
Expand Down
5 changes: 4 additions & 1 deletion _includes/head.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
<link rel="canonical" href="{{ page.url | replace:'index.html','' | absolute_url }}">

<!-- Dark Mode -->
<script src="{{ '/assets/js/theme.js' | relative_url | bust_file_cache }}"></script>
{% if site.enable_darkmode %}
<link
defer
Expand All @@ -59,7 +60,9 @@
media="none"
id="highlight_theme_dark"
>
<script src="{{ '/assets/js/theme.js' | relative_url | bust_file_cache }}"></script>
<script>
initTheme();
</script>
{% endif %}

<!-- GeoJSON support via Leaflet -->
Expand Down
5 changes: 3 additions & 2 deletions _includes/header.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,9 @@
<!-- Toogle theme mode -->
<li class="toggle-container">
<button id="light-toggle" title="Change theme">
<i class="fa-solid fa-moon"></i>
<i class="fa-solid fa-sun"></i>
<i class="ti ti-sun-moon" id="light-toggle-system"></i>
<i class="ti ti-moon-filled" id="light-toggle-dark"></i>
<i class="ti ti-sun-filled" id="light-toggle-light"></i>
</button>
</li>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion _includes/scripts/diff2html.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
crossorigin="anonymous"
></script>
<script>
let theme = localStorage.getItem('theme');
let theme = determineComputedTheme();
/* Create echarts chart as another node and hide the code block, appending the echarts node after it
this is done to enable retrieving the code again when changing theme between light/dark */
Expand Down
2 changes: 1 addition & 1 deletion _includes/scripts/echarts.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
></script>
{% endif %}
<script>
let theme = localStorage.getItem('theme');
let theme = determineComputedTheme();
/* Create echarts chart as another node and hide the code block, appending the echarts node after it
this is done to enable retrieving the code again when changing theme between light/dark */
Expand Down
2 changes: 1 addition & 1 deletion _includes/scripts/mermaid.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
></script>
{% endif %}
<script>
let theme = localStorage.getItem('theme');
let theme = determineComputedTheme();
/* Create mermaid diagram as another node and hide the code block, appending the mermaid node after it
this is done to enable retrieving the code again when changing theme between light/dark */
Expand Down
2 changes: 1 addition & 1 deletion _includes/scripts/vega.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
></script>

<script>
let theme = localStorage.getItem('theme');
let theme = determineComputedTheme();
/* Create vega lite chart as another node and hide the code block, appending the vega lite node after it
this is done to enable retrieving the code again when changing theme between light/dark */
Expand Down
44 changes: 36 additions & 8 deletions _sass/_themes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,20 @@
--global-danger-block-text: #600;
--global-danger-block-title: #c00;

.fa-sun {
display: none;
}
.fa-moon {
#light-toggle-system {
padding-left: 10px;
padding-top: 12px;
display: block;
}

#light-toggle-dark {
display: none;
}

#light-toggle-light {
display: none;
}

.repo-img-light {
display: block;
}
Expand Down Expand Up @@ -75,19 +80,42 @@ html[data-theme="dark"] {
--global-danger-block-text: #600;
--global-danger-block-title: #c00;

.fa-sun {
.repo-img-light {
display: none;
}
.repo-img-dark {
display: block;
}
}

html[data-theme-setting="dark"] {
#light-toggle-system {
display: none;
}

#light-toggle-dark {
padding-left: 10px;
padding-top: 12px;
display: block;
}
.fa-moon {

#light-toggle-light {
display: none;
}
}

.repo-img-light {
html[data-theme-setting="light"] {
#light-toggle-system {
display: none;
}
.repo-img-dark {

#light-toggle-dark {
display: none;
}

#light-toggle-light {
padding-left: 10px;
padding-top: 12px;
display: block;
}
}
3 changes: 3 additions & 0 deletions _sass/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ $code-bg-color-dark: #2c3237 !default;

// Font awesome location
$fa-font-path: "../webfonts";

// Tabler icons location
$ti-font-path: "../fonts";
Loading

0 comments on commit 7cf3696

Please sign in to comment.