chrisrhymes / bulma-clean-theme

A clean and modern Jekyll theme based on Bulma
http://www.csrhymes.com/bulma-clean-theme/
MIT License
388 stars 491 forks source link

successful build and deploy from a subfolder with Github Actions workflow #137

Closed HoffiMuc closed 1 year ago

HoffiMuc commented 1 year ago

Hi, after 2h of fiddeling around I succeded to use Github Actions workflow to build and deploy (in this case jekyll github pages theme 'bulma-clean-theme") using Github Actions workflow:

image



Maybe this might help others that run into the same "problems":

jekyll new docs # so the <REPOROOT>/docs/ folder is the folder of you repo you wanna use for jekyll

in docs/_config.yaml

baseurl: "/<yourGithubProjectName>" # for github pages
#baseurl: "" # for local testing
# Build settings
#theme: bulma-clean-theme # for local testing
remote_theme: chrisrhymes/bulma-clean-theme # for github pages
plugins:
  - jekyll-feed
  - jekyll-remote-theme

in .github/workflows/jekyll-gh-pages.yml: (add docs/ to source: and leave destination as is)

      - name: Build with Jekyll
        uses: actions/jekyll-build-pages@v1
        with:
          source: ./docs/
          destination: ./_site

in docs/Gemfile

# gem "minima", "~> 2.5"
gem "bulma-clean-theme", "~> 0.13"

BEWARE: of prefixing all your relative links, e.g.:

[subpage1]({{ site.baseurl }}{% link subpage1.md %})

that's it.

HoffiMuc commented 1 year ago

But as often, I was a bit "hasty" as with the configuration above: YES, it will pick up the bulma-clean-theme

BUT

All the markdown links do NOT HAVE THE BASEURL (above's <yourGithubProjectName>) after the https://yourOrg.github.io/<yourGithubProjectName>/yourLinkedPage.html

if anybody wants to have a look, I tried it out in a deprecated project here: https://github.com/hoffipublic/Deps

ADDENDUM: ok I fixed that problem and edited my issue above (inline), by adding site.baseurl to each an any relative markdown link:

[subpage1]({{ site.baseurl }}{% link subpage1.md %})

also make sure your links are relative ... also for hero images:


---
hero_image: assets/img/Chassis.jpg
---
chrisrhymes commented 1 year ago

Hi @HoffiMuc thanks for the info on deploying using GitHub pages. If you don't mind I might make a blog post about it at some point using your example.

Glad you managed to resolve your issue with the links and the baseurl in markdown. I can only assume this is an issue with how Jekyll works.

HoffiMuc commented 1 year ago

sure! go ahead.

A very "worthy" blog post also would contain on how to get "non github listed plugins" to run on github pages (in safe mode) ... tried it with gem "jekyll-drawio" and gem "jekyll-plantuml" (as I don't want to have big binary images in my git repo), but finally had to give up. Maybe your experience in this can help others.

Another "enhancement" feature (don't know if easy or not, as I am a noob):

Turning page headings into html anchors so that you can directly link to subsections.

cheers.