ref: github.io setting reference Moving from velog.io/@naem1023 to naem1023.github.io. Customization, local posting, and the ability to deploy on a personal server if needed — these advantages seemed better than Velog’s simplicity.
Installation
# install ruby, jekyll, bundler# Ubuntusudo apt install ruby ruby-dev build-essential
# m1 macbrew install ruby rbenvrbenv install 3.1.2rbenv global 3.1.2
# install jekyll, bundlergem install jekyll bundlerbundle update --bundlerbundle add webrickbundle install --redownload
# set zshrcecho 'eval "$(rbenv init - zsh)"' >> ~/.zshrcecho 'export PATH="/usr/local/opt/ruby/bin:/usr/local/lib/ruby/gems/3.0.0/bin:$PATH"' >> ~/.zshrc
# setup jekyll theme and deploygit clone {git address of jekyll theme}mv ./minimal-mistakes {name of my github.io repository}cd {{name of my github.io repository}}git remote remove origingit remote add origin {link of my github.io repository}git push -u origin masterTesting
# Serve in local environmentbundle exec jekyll serveYFM (YAML Front Matter)
- Specifies post metadata in markdown format.
- Written in YAML.
- Placed at the top of the markdown file as follows:
---title: "velog to github.io"excerpt: "excerpt"toc: truetoc_sticky: truetoc_label: "Page table of contents" # default: On this pageheader: teaser: /assets/images/bio-photo-keyboard-teaser.jpg
categories: - Blog buildingtags: - Bloglast_modified_at: 2022-04-06T08:06:00-05:00---YFM info can be accessed through double curly bracese.g., {{ page.title }}, {{ page.last_modified_at }}toc (table of contents) lets you display a list of H1-H6 headers on the right side of the page.
_config.yml
Contains Jekyll’s operational settings. While other files auto-reflect changes during the Jekyll server run, _config.yml changes only take effect on rebuild.
_config.yml content can be used like this:
<{{ site.url }}{{ site.baseurl }}/blog/>When built with Jekyll, the above renders as <{{ site.url }}{{ site.baseurl }}/blog/>.
Comments
You can add a comment service by modifying the comments section in _config.yml. Planning to use utterances. ref: utterances setting blog
Open Graph Image
You can configure the Open Graph Protocol.
og_image : "path"og_description : ""og_title : ""Site Author
Information displayed in the left sidebar. Note that URLs should be written without quotes.
# Site Authorauthor: name : "Hobbyist developer" avatar : "/assets/images/bio-photo-keyboard.jpg" bio : "A developer who codes for salary at work and for fun at home" location : "South Korea" email : links: - label: "Email" icon: "fas fa-fw fa-envelope-square" url: mailto:devinlifeidea@gmail.com - label: "Website" icon: "fas fa-fw fa-link" url: "https://devinlife.com"Outputting
Settings for how the blog is displayed. The paginate value controls how many recent posts appear on the first page. Exceeding that number shows page numbers.
_posts, _pages
_posts contains date-based posts. _pages is for non-date-based posts. You can write posts that appear at specific URLs within the site.
Settings defined for _posts and _pages in _config.yml become the defaults for markdown posts. Redefining YFM in individual posts overrides those defaults.
Category, Tag
You can configure URLs and types for categories and tags.
Menu Bar
Editable via _data/navigation.yml.
Categories, Tag
Separate pages for categories and tags need to be created via Pages. Create pages with ‘/categories’ and ‘/tag’ as permalinks. Any URL works as long as it’s the base URL configured in _config.yml. Categories and tags have author profile set to false by default, so I changed it to true.
Category
If Categories contains all blog categories, individual category pages should show posts for that single category. Create pages with permalink as a sub-URL of categories.
---title: "About building blog"permalink: /categories/bloglayout: categoryauthor_profile: truetaxonomy: blog-building---The taxonomy field specifies which category to display.
Comments
Make sure to set comments to true in _config.yml. I struggled with this for a while…
defaults: # _posts - scope: path: "" type: posts values: comments: trueI used utterances. Since it uses GitHub issues, if it’s a forked repo you must verify that issue creation is enabled. Unlike permalinks, the repo name must be enclosed in quotes.
repository: # GitHub username/repo-name e.g. "mmistakes/minimal-mistakes"
comments: provider: "utterances" utterances: theme: "github-light" # "github-dark" issue_term: "pathname"If issue_term is “pathname”, comments map to GitHub issues based on the URL path. If the post title changes and the URL path changes, the comments disappear.
Font
You can change the font by editing scss files.
# In _sass/minimal-mistakes/_variables.scss, modify User Font$sans-serif: -apple-system, BlinkMacSystemFont, {User Font}
# Add the following to assets/css/main.scss@import url('https://fonts.googleapis.com/css?family=Noto+Sans+KR');
# Change font size in _sass/minimal-mistakes/_reset.scss
html { box-sizing: border-box; background-color: $background-color; font-size: 14px;
@include breakpoint($medium) { font-size: 14px; }
@include breakpoint($large) { font-size: 16px; }
@include breakpoint($x-large) { font-size: 18px; }
-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%;}Date Display
Modifying _config.yml as follows removes the reading time and shows the posting date instead. Settings placed here automatically apply to all posts’ YFM. ref: Reference github comment
# Defaultsdefaults: # _posts - scope: path: "" type: posts values: layout: single author_profile: true read_time: false comments: true share: true related: true show_date: true