Get updates from the template
Your site has two kinds of files:
- Template files make the site work. They are the same in every site:
_layouts/,_includes/,_sass/,assets/css/,assets/js/,assets/fonts/,search.html,search.json,glossary.html,404.html,topics/index.html,Gemfile, andscripts/. - Your files hold your settings and your writing:
_config.yml,_data/,_topics/,docs/,index.md,about/,assets/brand/,README.md,CNAME(a custom domain, if you have one), and the license and notice files (LICENSE,LICENSE-CONTENT,NOTICE).
When the template gets better, you can copy the new template files into your site. The update script keeps all of your files as they are.
Do not change template files in your own site. The next update replaces them. If a setting is missing, ask for it in the template repository instead.
Set up (once)
Open a terminal in your site folder. Then run these commands:
git remote add upstream https://github.com/briannarimm/pll-static-pub.git
git remote set-url --push upstream DISABLED
The first command tells Git where the template is. The second command makes sure you can never push your site to the template by mistake.
To check, run git remote -v. The upstream push address must be DISABLED.
Get an update
- Commit or save all your work.
-
Run the update script:
sh scripts/update-from-template.sh - Read
CHANGELOG.md. If the update adds new settings, add them to your files in_data. If you do not add them, the site uses the default value. - Preview the site with
bundle exec jekyll serve. Check the home page, a topic page, and the menus. -
If the site looks right, commit:
git commit -m "Update from template"To cancel the update instead, run
git merge --abort.
The first time you run the script, Git may say the histories are unrelated. The script handles this.
If you prefer to do it by hand
- Run
git fetch upstream. - Compare the template files:
git diff HEAD upstream/main -- _layouts _includes _sass assets/js assets/css. - Copy the files you want with
git checkout upstream/main -- PATH, for examplegit checkout upstream/main -- _includes/sidebar.html.