Skip to content

hhollandmoritz/hhollandmoritz.github.io

Repository files navigation

My version of the website can be found here:

My Site

1: Workflow for updating development branch and pushing it to github:

  1. To change the development (non-compiled) version of the website, first make sure you are working in the development branch.
$ git checkout development

The first time you make changes during a session, you'll also want to run:

$ bundle install

to make sure all the ruby gems are installed and up to date.

  1. Then make any changes to your files.

Optional

Use the command below to preview your changes locally.

$ bundle exec jekyll serve
  1. Finally, add and commit those changes and push them to the development branch on github.
$ git commit -a -m "my update message"
$ git push
  1. Optional: reset to development branch for easy editing next time you need to update:
git checkout development

Workflow for updating website on github:

  1. If writing a Rmarkdown post, run the R2Jekyll.R script to convert the draft post to a jekyll-friendly version.
cd _drafts
./R2Jekyll.R mypost.Rmd
  1. Update the the tags with the tag_generator.py Create a tag page for any tags that you have never used before and then run the tag genrator as below:
python3 tag_generator.py
  1. Fix the security flaws NOTE: Currently jekyll-scholar depends on a version of bibtex-ruby that has a security flaw. The newer version of jekyll-scholar does not have this flaw, however this version of jekyll-scholar depends on jekyll 4. While github-pages depends on jekyll 3.5.8. It seems like the upgrade for github pages will not come soon. Therefore, until that fix before launching the website you need to manually change the bibtex-ruby requirment in Gemfile.lock like this:

  2. Remove the versions from each of the bibtex-ruby lines in the Gemfile.Lock

  3. Run bundle update bibtex-ruby

    • note this resulted in an error could not find gem "bibtex-ruby" Did you mean bibtex-ruby?, but it still managed to update properly.
  4. Use bundle exec jekyll serve to check that the update didn't screw up the publications section.

  5. Proceed with the deployment.

More information can be found here:

If all else fails, you can rename Gemfile.lock temporarily and rebuild it using the following code:

bundle install

  1. Deploy the site from the development branch to the gh-pages branch
$ git checkout development # changes you to development branch
$ ./bin/deploy -s development -d gh-pages # this builds the functional gh-pages website version from the guides on the development branch

a) Change to the gh-pages branch and merge the master to the gh-pages branch. Then resolve any merge conflicts here first (or decide they don't matter and that you can force the branch merge). To learn more about the "ours" strategy go here.

$ git checkout gh-pages
$ git merge -s ours master # merges master branch into the current branch (i.e. gh-pages) with strategy "ours"; i.e. preferentially keep files from gh-pages - this is what we want since we will effectively be overwriting mastaer with gh-pages each time. 

b) change to the master branch, and merge the gh-pages branch to the master branch. There should be no merge conflicts if you completed step 2a.

$ git checkout master
$ git merge gh-pages
  1. push the changes to the master branch to github
$ git push

Troubleshooting Ruby headaches

Dependency issues

  • If you are receiving dependency notifications on Github about site security, you can update the dependencies in jekyll this way:
git checkout development
bundle update
  • If that doesn't solve the problem, try adding the update to the Gemfile directly and then running:
bundle install

Updated ruby version

If you recently updated your ruby version, you may find it hard to update your gem file. You may get an error like this:

nokogiri-1.11.7-x86_64-linux requires ruby version < 3.1.dev, >= 2.5, which is incompatible with the current version,
ruby 3.2.2p53

To solve the problem, bundle needs to rebuild all the packages with the new ruby version, so change the name of your Gemfile.lock and rerun bundle install.

mv Gemfile.lock Gemfile.lock.old
bundle install

Then check to make sure you can generate the preview of the website before deleting the old Gemfile.lock

Other Editing Notes

CV file

  • To edit the CV page, add the new CV to the "/assets/pdf/" directory and specify it's path in the CV_file option in the _config.yml file.

Drafts

  • To create a blog post, you can design it in the _drafts folder first. Then when it is ready for real time, move it to the _posts folder and rename it the publication date first. Then the draft will be published.

To preview a draft post use this command:

bundle exec jekyll serve --drafts
  • I have also created a new folder called under_construction inside the _drafts folder. Inside this folder are pages that I'm still working on that are not yet ready for publication in the Teaching and Projects pages. Unfortunately, at this point I haven't been able to figure out how to stop their contents from being displayed in bundle exec jekyll serve --drafts. C'est la vie....

Determining how it looks on mobile devices

On firefox you can use Ctrl + Shift + M to mimic a mobile device to see how it will look. Editing the files in the _sass folder can help adjust the appearence of pages.

Find more information about this theme and the readme here:

https://github.com/alshedivat/al-folio