Skip to content

Commit

Permalink
Mostly complete the jekyll chapter.
Browse files Browse the repository at this point in the history
  • Loading branch information
MTecknology committed Aug 3, 2024
1 parent 39490f1 commit ed931dc
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 6 deletions.
84 changes: 78 additions & 6 deletions basic/jekyll.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,81 @@
Website with Jekyll
===================

- Note how "basic website" just produces individual pages that can each look different.
Explain how static site generators are used to generate lots of pages with identical appearance
- There are many Static Site Generators out there and they each have various pros/cons.
- One option that works very well with GitHub is Jekyll
- Tutorial: Convert 3-page site to using jekyll (or is it already?)
- Links to other resources
There are **many** :ref:`Static Site Generators (SSGs) <static-site>` out there.
GitHub has some "magic" integration with ``Jekyll``, making this the easiest
path forward.

Convert Site
------------

``Jekyll`` requires that a ``_config.yml`` file exist within the git repository.
This :ref:`YAML file <yml>` will require two values:

1. ``title``: Our example used ``DemoSite``, so we will keep this value
2. ``theme``: GitHub provides a `limited set of themes
<https://pages.github.com/themes/>`__ that require no extra effort to use

Using these values, create ``_config.yml`` similar to the following:

.. code-block:: yaml
title: DemoSite
theme: jekyll-theme-cayman
Rename ``index.html`` to ``index.md`` and update it with the following content:

.. code-block:: markdown
---
title: Home Page
---
Hello, World!
-------------
This **bold** exists within paragraph tags.
Check out [Page #2](/second)
Similarly, rename ``second.html`` to ``second.md`` and update it with:

.. code-block:: markdown
---
title: Second Page
---
Page Number Two
----------------
This is a second page [with a link](/) to the Home page.
Finally, review these changes in ``GitHub Desktop``, create a quality ``commit
message``, and ``push`` the changes to GitHub

.. image:: /static/images/basic/jekyll_conversion.webp
:align: center

After a short period of time, GitHub will build the new version of your
:ref:`website <websites>`. You will now be able to observe that Jekyll combined
our Markdown documents with a "theme" and generated two HTML pages.

.. image:: /static/images/basic/hello_jekyll.webp
:align: center

Change Theme
------------

The ``minima`` theme is built into jekyll, and so it naturally provides access
to the most features. Changing to this new theme is as easy as updating the
single line in our configuration file to say ``theme: minima``.

.. image:: /static/images/basic/themechange_diff.webp
:align: center

After a quality commit, push, and coffee break ...

.. image:: /static/images/basic/themechange_view.webp
:align: center

Surprise! This theme even comes with a navigational menu. :)
Binary file added static/images/basic/hello_jekyll.webp
Binary file not shown.
Binary file added static/images/basic/jekyll_conversion.webp
Binary file not shown.
Binary file added static/images/basic/themechange_diff.webp
Binary file not shown.
Binary file added static/images/basic/themechange_view.webp
Binary file not shown.

0 comments on commit ed931dc

Please sign in to comment.