Jekyll is a simple, blogging, static site generator

Jekyll is a simple, blogging, static site generator

2022-11-10 0 803
Resource Number 47826 Last Updated 2025-02-21
¥ 0USD Upgrade VIP
Download Now Matters needing attention
Can't download? Please contact customer service to submit a link error!
Value-added Service: Installation Guide Environment Configuration Secondary Development Template Modification Source Code Installation

The Jekyll recommended in this issue is a simple, blog-enabled, static site generator that is ideal for individual, project, or organizational sites.

Jekyll is a simple, blogging, static site generator插图

Think of it as a file-based CMS, less complex. Jekyll takes your content, renders Markdown and Liquid templates, and spits out a complete static website, ready to be served by Apache, Nginx, or another Web server.

Fast start

< Prerequisites Permalink

Jekyll requires the following:

  • Ruby version 2.5.0 or higher
  • RubyGems
  • GCC and Make

Installation instructions

1 Install all prerequisites.

2 Install jekyll and bundler gems.

gem install jekyll bundler

3 Create a new Jekyll site in./myblog.

jekyll new myblog

4 Switch to the new directory.

cd myblog

5 Build the site and make it available on your local server.

bundle exec jekyll serve

6 Navigate to http://localhost:4000

Command Line usage

Jekyll gem enables jekyll you can use executable files in the terminal.

The jekyll program has several commands, but the structure is always:

jekyll command  [argument] [option] [argument_to_option]

Examples:
jekyll new site/ --blank
jekyll serve --config  _alternative_config.yml

Typically, you will use the jekyll serve for local development and when the jekyll build needs to generate a site for production.

Here are some of the most common commands:

  • jekyll new PATH- Creates a new Jekyll site in the specified path with a default gem-based theme. Directories are created as needed.
  • jekyll new PATH –blank — Creates a new blank Jekyll site scaffold on the specified path.
  • jekyll build or jekyll b- Build your website at once./_site (by default).
  • jekyll serve or jekyll s- Build your site whenever the source file changes and makes it available locally.
  • jekyll clean- Deletes all generated files: destination folder, metadata file, Sass, and Jekyll cache.
  • jekyll help- Displays help, optionally for a given subcommand, such as jekyll help build.
  • jekyll new-theme- Creates a new Jekyll theme scaffold.
  • jekyll doctor- Outputs any deprecation or configuration issues.

Rendering process

For any Jekyll site, the build session consists of discrete stages in the following sequence – set up the plug-in, read the source file, run the generator, render the template , and finally write the file to disk .

While the above stages are self-explanatory, one stage worth dissecting is the render stage .

The rendering phase can be further divided into three optional phases. Each rendered file passes through one or more of these stages, depending on the file’s content string, front-end content, and extension. These stages are similar to an assembly line, where the output of one stage is the input of subsequent stages:

  • Explain the Liquid expression in the file
    This phase evaluates the Liquid expression in the current file. By default, the interpretation is very shallow – because any Liquid expression in the resulting output will not be interpreted further. In addition, any Liquid expressions in the front of the file remain unchanged.
  • Release converter
    This phase calls the converter that maps to the current file extension and converts the input string. This is when Markdown converts to HTML and Sass/Scss converts to CSS or CoffeeScript converts to JavaScript and so on. Since this stage is determined by the file’s extension, the Markdown or sas.html in the file will remain unchanged.
  • Fill layout
    By this stage, the source file is considered rendered and it will not be revisited. However, depending on the extension of the file, and therefore on what was previously done, determine whether the output string is taken from the previous stage and put into the layout. While the output of a Sass file or CoffeeScript file is never put into a layout, regular text output can go either way depending on whether the layout has been allocated through the front end.

Page

Pages are the most basic building blocks of content. They are useful for stand-alone content (content that is not date-based or is not a group of content, such as staff or recipes).

The easiest way to add a page is to add an HTML file with an appropriate file name in the root directory. You can also write pages in Markdown using extensions that.md converts to HTML at build time. For a site with a home page, about page, and contact page, the root directory and associated URL might look like this:

.
├── about.md    # =>  http://example.com/about.html
├── index.html    # =>  http://example.com/
└── contact.html  # =>  http://example.com/contact.html

If you have a lot of pages, you can organize them into subfolders. When your site is built, the same subfolder that is used to group the pages in the project source will exist in that folder. However, when a page has a different permalinking set up on the front end, the subfolder at_site changes accordingly.

.
├── about.md          # =>  http://example.com/about.html
├── documentation     # folder containing pages
│   └── doc1.md       # =>  http://example.com/documentation/doc1.html
├── design            # folder containing pages
│   └── draft.md      # =>  http://example.com/design/draft.html

Subject

Jekyll has an extensive theme system that allows you to customize presentations for your site using community-maintained templates and styles. Jekyll themes specify plug-ins and package assets, layouts, inclusions, and style sheets in a way that can be overridden by your website content.

< Learn about gem based topics

When you create a new Jekyll site (by running jekyll new < PATH> Command), Jekyll installs a site that uses a gem-based theme called Minima.

For GEM-based themes, certain directories of the site (such as the assets, _data, _layouts, _includes, and _sass directories) are stored in the theme’s gem, hidden from your immediate view. However, during the construction of Jekyll, all the necessary directories will be read and processed.

For Minima, you’ll only see the following files in the Jekyll site directory:

.
├── Gemfile
├── Gemfile.lock
├── _config.yml
├── _posts
│   └── 2016-12-04-welcome-to-jekyll.markdown
├── about.markdown
└── index.markdown

Bundler uses the Gemfile and gemfile.lock files to keep track of the gem and gem versions needed to build the Jekyll site.

Gem-based themes make it easier for theme developers to provide updates to anyone who has a theme gem. When there is an update, the title developer pushes the update to RubyGems.

If you have theme gems, you can (if you wish) run bundle update to update all the gems in your project. Or you can run bundle update < THEME> replace THEME> For the theme name, such as minima, only the theme gem is updated. Any new files or updates (such as stylesheets or inclusions) made by theme developers are automatically pulled into your project.

The goal of a gem based theme is to let you get all the benefits of a strong, constantly updated theme without having all the theme files get in your way and overcomplicate your main concern: creating content.

Overwrite topic Default

Jekyll theme sets default data, layout, inclusion, and style sheet. However, you can override any theme default with your own site content.

To replace the layout or inclusion in a theme, make a copy in your _layouts or _includes directory of the specific file you want to modify, or create the file from scratch and give it the same name as the file you want to overwrite.

For example, if the theme you have chosen has a page layout, you can override the layout of the theme by creating your own page layout _layouts (i.e. _layouts/page.html) in the directory.

To find a file on your computer for a certain topic:

  • Runbundle info –path followed by the name of the theme gem, for example bundle info — the default theme of path minimaJekyll.
  • This will return the location of the gem based theme file. Minima theme files, for instance, may in the/usr/local/lib/ruby/gems/server/gems/Minima – 2.5.1 macOS.
  • Open the subject’s directory in Finder or Explorer:
# On MacOS
open $(bundle info --path minima)

# On Windows
# First get the gem's installation path:
#
#   bundle info --path minima
#   =>  C: / Ruby26 - x64 / lib/ruby/gems / 3.1.1 / gems/minima - 2.5.1 < / span >
#
# then invoke explorer with above path, substituting `/` with `\`
explorer C:\Ruby26-x64\lib\ruby\gems\3.1.1\gems\minima-2.5.1

# On Linux
xdg-open $(bundle info --path minima)

will open a Finder or Explorer window showing the subject’s files and directories. The Minima theme gem contains the following files:

.
├── LICENSE.txt
├── README.md
├── _includes
│   ├── disqus_comments.html
│   ├── footer.html
│   ├── google-analytics.html
│   ├── head.html
│   ├── header.html
│   ├── icon-github.html
│   ├── icon-github.svg
│   ├── icon-twitter.html
│   └── icon-twitter.svg
├── _layouts
│   ├── default.html
│   ├── home.html
│   ├── page.html
│   └── post.html
├── _sass
│   ├── minima
│   │   ├── _base.scss
│   │   ├── _layout.scss
│   │   └── _syntax-highlighting.scss
│   └── minima.scss
└── assets
└── main.scss

With a clear understanding of the theme file, you can now overwrite any theme file by creating a file with a similar name in the Jekyll site directory.

—END—

Open Source protocol: Apache2.0

资源下载此资源为免费资源立即下载
Telegram:@John_Software

Disclaimer: This article is published by a third party and represents the views of the author only and has nothing to do with this website. This site does not make any guarantee or commitment to the authenticity, completeness and timeliness of this article and all or part of its content, please readers for reference only, and please verify the relevant content. The publication or republication of articles by this website for the purpose of conveying more information does not mean that it endorses its views or confirms its description, nor does it mean that this website is responsible for its authenticity.

Ictcoder Free source code Jekyll is a simple, blogging, static site generator https://ictcoder.com/kyym/jekyll-is-a-simple-blogging-static-site-generator.html

Share free open-source source code

Q&A
  • 1, automatic: after taking the photo, click the (download) link to download; 2. Manual: After taking the photo, contact the seller to issue it or contact the official to find the developer to ship.
View details
  • 1, the default transaction cycle of the source code: manual delivery of goods for 1-3 days, and the user payment amount will enter the platform guarantee until the completion of the transaction or 3-7 days can be issued, in case of disputes indefinitely extend the collection amount until the dispute is resolved or refunded!
View details
  • 1. Heptalon will permanently archive the process of trading between the two parties and the snapshots of the traded goods to ensure that the transaction is true, effective and safe! 2, Seven PAWS can not guarantee such as "permanent package update", "permanent technical support" and other similar transactions after the merchant commitment, please identify the buyer; 3, in the source code at the same time there is a website demonstration and picture demonstration, and the site is inconsistent with the diagram, the default according to the diagram as the dispute evaluation basis (except for special statements or agreement); 4, in the absence of "no legitimate basis for refund", the commodity written "once sold, no support for refund" and other similar statements, shall be deemed invalid; 5, before the shooting, the transaction content agreed by the two parties on QQ can also be the basis for dispute judgment (agreement and description of the conflict, the agreement shall prevail); 6, because the chat record can be used as the basis for dispute judgment, so when the two sides contact, only communicate with the other party on the QQ and mobile phone number left on the systemhere, in case the other party does not recognize self-commitment. 7, although the probability of disputes is very small, but be sure to retain such important information as chat records, mobile phone messages, etc., in case of disputes, it is convenient for seven PAWS to intervene in rapid processing.
View details
  • 1. As a third-party intermediary platform, Qichou protects the security of the transaction and the rights and interests of both buyers and sellers according to the transaction contract (commodity description, content agreed before the transaction); 2, non-platform online trading projects, any consequences have nothing to do with mutual site; No matter the seller for any reason to require offline transactions, please contact the management report.
View details

Related Article

make a comment
No comments available at the moment
Official customer service team

To solve your worries - 24 hours online professional service