I'm trying to create a static website. I want to be able to do some simple preprocessing, such as including one page within another, without the use of PHP or JavaScript.
Jekyll seemed perfect for this, especially given its support on GitHub pages.
However, after trying a few themes and trying to tweak them into what I'd like, I found myself fighting the themes which made them more of a hindrance than helpful. As a result, I decided to try and work without them and just use Jekyll as a fancy preprocessor and plugin platform (for things such as jekyll-redirect-from).
Much to my surprise, I couldn't find any information on how to do this, on how and where to place what files to generate a useable site. It feels like this should be incredibly simple to do, but the only route I've found so far is to create my own theme. This seems like overkill to me.
How can I create a Jekyll site without using a theme? Where can I find information on what files I need, where, what needs to be in them and so on?
However, you can override any of the theme defaults with your own site content. To replace layouts or includes in your theme, make a copy in your _layouts or _includes directory of the specific file you wish to modify, or create the file from scratch giving it the same name as the file you wish to override.
Remote themes are specified by the remote_theme key in the site's config. For public GitHub, remote themes must be in the form of OWNER/REPOSITORY , and must represent a public GitHub-hosted Jekyll theme. See the Jekyll documentation for more information on authoring a theme.
For some sites with thousands of pages, Hugo is a must because of its build speed. For others, Jekyll can be a must because of a few plugins with specific functionalities not found in Hugo. But for the majority of us, it comes down to personal preference. So, you can't really go wrong with either Jekyll or Hugo.
Jekyll is a static site generator. It takes text written in your favorite markup language and uses layouts to create a static website. You can tweak the site's look and feel, URLs, the data displayed on the page, and more.
You can invoke the jekyll new
command with the --blank
option as documented in the command line usage section of the docs.
That way Jekyll generates a basic project with empty folders and files.
Now start by creating your own layout in _layouts/my-fancy-layout.html
:
<!DOCTYPE html>
<html>
<head>
<title>My Fancy Title</title>
</head>
<body>
<p>Here comes my fancy content: </p>
{{ content }}
</body>
</html>
Next add some content to your index.html
and tell it to use your layout:
---
layout: my-fancy-layout
---
<h1>Hello, World!</h1>
This is your basic Jekyll site with your custom layout :)
Further steps are:
_include
directory and include them in all your layouts
page.name
and page.title
in your layoutBy the way, I created my personal website that way and it works like a charm.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With