If you want a tidy static site that does not look like it was stitched together by a panicked hedgehog then build a proper Jekyll theme. This guide walks through creating layouts, using Liquid templates, organizing assets and preparing your theme for GitHub Pages deployment. Technical bits stay accurate and useful. The snark is optional but recommended.
Start with a predictable folder structure. The usual suspects are:
Keeping templates small and reusable prevents copy paste chaos and makes maintenance bearable.
Place HTML templates in the _layouts folder. A common file is default.html which wraps page content with document head and footer markup. Use Liquid tags to inject page content and site data using expressions like
You need Java 7 and the JAVA_HOME variable set for some stubborn legacy build or a tool that refuses to move on. This guide gets you the JDK, shows how to install it on Windows and Linux, walks through setting JAVA_HOME and verifies the setup from the command line. Yes this still matters in the year of newer Java versions.
Download the JDK from the Oracle archive or use a trusted package repository. If a modern Java is acceptable pick that instead to save yourself future pain. On Linux the system package manager is the easiest option when available.
Run the installer and follow the wizard like a functioning human. If you prefer scripts you can install the MSI or unpack an archive and then set environment variables with the command shown later. A common installation path looks like
C\Program Files\Java\jdk1.7.0_xx
Use your distro package manager or extract a tarball into a predictable location. Example for Debian style systems
sudo apt-get install openjdk-7-jdk
If you manually unpacked a tarball move the JDK folder to a stable path such as /usr/lib/jvm
so tools can rely on it.
Open System Properties and Advanced Environment Variables and add a new system variable named JAVA_HOME with the path to your JDK. For scripted installs use the setx command shown here
setx JAVA_HOME "C\Program Files\Java\jdk1.7.0_xx"
Important note that the new value only appears in new shells. Close and reopen any command prompt windows or restart your IDE to make it notice the change.
Edit your shell profile such as ~/.bashrc
or a system profile script and add an export line. Example
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
Save and reload the profile with a new shell or with source ~/.bashrc
if you must avoid a reboot. Yes you will still have to reopen terminals.
Confirm the JDK is usable and that the environment variable points at the right place. Run these commands in the appropriate shell
java -version
# on Linux
echo $JAVA_HOME
# on Windows in cmd
echo %JAVA_HOME%
If java -version
prints a Java 7 runtime and the echo output shows the JDK path you are golden. If not double check the path and remember Windows paths differ from Linux paths. Mixing them is a fast path to confusion.
This guide covered obtaining the JDK installing it on Windows and Linux setting JAVA_HOME and verifying the setup. Follow the platform specific steps and keep your paths sensible unless you enjoy debugging path related drama.
and Your awesome title. That makes your theme flexible and lets you change a header in one place instead of a hundred places.Navigation, social links and footers belong in _includes. Then call them from layouts with include statements so you avoid duplicating HTML. Smaller templates mean faster debugging and fewer late night regrets.
Keep CSS and JavaScript in an assets folder and reference files with relative paths. That helps the theme work when moved between repos or used as a gem based theme. Avoid absolute paths that will break when the site is deployed under a baseurl.
Every page or post needs a front matter block to select a layout and set page specific variables. The front matter is that small YAML block at the top of a file. Edit _config.yml to set global options such as baseurl and other flags that control behavior. Test different settings locally before committing to avoid surprises on the live site.
Run the site locally with the jekyll serve command to preview changes. Local testing saves the embarrassment of broken pages on the public site. When you are happy push changes to the branch configured for GitHub Pages. GitHub Pages will build the site and your theme will appear if the repo and branch settings match what GitHub Pages expects.
Follow those steps and you get a reusable Jekyll theme that plays nicely with GitHub Pages. You will also avoid the kind of layout rot that haunts abandoned projects. Now go make something that does not embarrass your future self.
I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!
This is a dedicated watch page for a single video.