블로그 운영 - references

2 분 소요

이 블로그는 Jekyll로 만들어져 있습니다.

Install Jekyll

$ sudo apt-get install ruby ruby-dev build-essential
$ echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc
$ echo 'export GEM_HOME=$HOME/gems' >> ~/.bashrc
$ echo 'export PATH=$HOME/gems/bin:$PATH' >> ~/.bashrc
$ source ~/.bashrc
$ gem update
$ gem update --system
$ gem install jekyll bundler
$ bundle update

Upgrade Jekyll

$ jekyll --version
$ gem list jekyll
$ bundle update jekyll
$ gem update jekyll

Run Jekyll

$ jekyll serve --draft --host 0.0.0.0

References

...
# Analytics
analytics:
  provider               : google-gtag # false (default), "google", "google-universal", "google-gtag", "custom"
  google:
    tracking_id          : UA-111111111-1
...

Type-on-Strap theme

...
 {% include adsense.html %} 
</head>
  • URL을 /:categories/:title/ 형태로 만들기 위해 _config.yml 파일에 아래와 같이 permalink 라인을 추가
...
# PAGINATION
permalink: /:categories/:title/
paginate: 5
paginate_path: "blog/page:num"
...

minimal-mistakes theme

git clone https://github.com/mmistakes/minimal-mistakes.git YourDirectory
cd YourDirectory
rm -rf .editorconfig .gitattributes .github docs/ test/ CHANGELOG.md minimal-mistakes-jekyll.gemspec README.md screenshot-layouts.png screenshot.png    # remove unnecessary files
cat << EOF > Gemfile     # overwrite Gemfile
source "https://rubygems.org"

# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
#     bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!

# gem "github-pages", group: :jekyll_plugins

# To upgrade, run `bundle update`.

gem "jekyll"
gem "minimal-mistakes-jekyll"

# The following plugins are automatically loaded by the theme-gem:
#   gem "jekyll-paginate"
#   gem "jekyll-sitemap"
#   gem "jekyll-gist"
#   gem "jekyll-feed"
#   gem "jekyll-include-cache"
#
# If you have any other plugins, put them here!
group :jekyll_plugins do
end
EOF
bundle install     # install gems then Gemfile.lock is created

Page Redirect (jekyll-redirect-fromn)

Install.

$ vi Gemfile   # add this line
gem "jekyll-redirect-from"
$ bundle

Add the plugin jekyll-redirect-from to your _config.yaml file.

plugins:
  - jekyll-redirect-from

# mimic GitHub Pages with --safe
whitelist:
  - jekyll-redirect-from
^D

Redirect Internally

Add this to your file’s frontmatter.

---
title: Your Post
redirect_from:
  - /old/page/
  - /old2/page2
---

That will create a /old/page/index.html and an /old2/page2 page that redirects to the Your Post page.

Redirect to Other Sites

---
title: Your Post2
redirect_to:
  - https://www.dest.com/
---

That will create a page for Your Post2 to redirect to https://www.supertechcrew.com/.

Search Engine

주요 서치 엔진에 블로그를 등록하면 다른 사람들이 서치를 할 수 있다.

Google

Google Search Console에서 등록한다.

네이버 서치 어드바이저에서 등록한다.

상단의 “웹마스터 도구”를 누르고, 사이트를 입력.

Daum

다음 검색 등록에서 등록한다.

참고사이트

https://devinlife.com/howto%20github%20pages/google-search-console-and-analytics/ https://devinlife.com/howto%20github%20pages/register-search-engine/

카테고리: ,

업데이트: