Skip to content

Instantly share code, notes, and snippets.

@Curookie
Last active June 18, 2018 12:16
Show Gist options
  • Save Curookie/df131fca19738e5d20420e3bcda27943 to your computer and use it in GitHub Desktop.
Save Curookie/df131fca19738e5d20420e3bcda27943 to your computer and use it in GitHub Desktop.
gitHub에서 repo만들기, public으로 만들거면[==돈 안내고 만들거면] 이름은 반드시 [자기아이디].github.io readme생성하지 않기
git bash 설치 git bash 들어가서 git 이메일, SSH 설정후
nvm 설치
npm 설치
hexo 설치 npm install hexo-cli -g
폴더(홈페이지 프로젝트 폴더가 될 것) 만들고 들어가서 hexo init > npm install
_config.yml 들어가서 저런식으로 수정 및 추가
ex)
# Site
title: Curookie's Infagic Blog
subtitle: 쿠루키의 인포직 블로그
description: MR Developer, Infagic Smith
keywords:
author: JJ WON
language: ko
timezone: Asia/Seoul
...
# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: next
...
# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
type: git
repo: https://github.com/[자기아이디]/[자기아이디].github.io.git
branch: master
...
#search는 플러그인 옵션임, 미리 추가해야하는 항목
search:
path: search.xml
field: post
format: html
limit: 10000
# Markdown-it config 이것 또한 markdown+ 추가할 할목
## Docs: https://github.com/celsomiranda/hexo-renderer-markdown-it/wiki
markdown:
render:
html: true
xhtmlOut: false
# Ex: A line breaks will be <br />
breaks: true
# Parser produces `<br>` tags every time there is a line break in the source document.
linkify: true
# Returns text links as proper links inlined with the paragraph.
typographer: false
# Substitution of common typographical elements will take place.
# quotes: '“”‘’'
plugins:
- markdown-it-abbr
- markdown-it-footnote
- markdown-it-ins
- markdown-it-sub
- markdown-it-sup
anchors:
# Minimum level for ID creation. (Ex. h2 to h6)
level: 1
# A suffix that is prepended to the number given if the ID is repeated.
collisionSuffix: 'v'
# If `true`, creates an anchor tag with a permalink besides the heading.
permalink: false
# Class used for the permalink anchor tag.
permalinkClass: header-anchor
# The symbol used to make the permalink
permalinkSymbol: ¶
next 테마 설치
git clone https://github.com/theme-next/hexo-theme-next themes/next
각종 플러그인 설치
필수
1) 깃 허브로 전송하는 플러그인 npm install hexo-deployer-git --save
2) 블로그 내 검색 기능 npm install hexo-generator-searchdb --save
3) 다양한 마크다운[markdown] 가능하게 함 npm un hexo-renderer-marked --save > npm i hexo-renderer-markdown-it --save
옵션
1) 사진 이쁘게 보는 뷰어 rm -rf themes/next/source/lib/fancybox > git clone https://github.com/theme-next/theme-next-fancybox3 themes/next/source/lib/fancybox
2)
temes/next의 _config.yml 수정
# ---------------------------------------------------------------
# Menu Settings
# ---------------------------------------------------------------
# When running the site in a subdirectory (e.g. domain.tld/blog), remove the leading slash from link value (/archives -> archives).
# Usage: `Key: /link/ || icon`
# Key is the name of menu item. If translate for this menu will find in languages - this translate will be loaded; if not - Key name will be used. Key is case-senstive.
# Value before `||` delimeter is the target link.
# Value after `||` delimeter is the name of FontAwesome icon. If icon (with or without delimeter) is not specified, question icon will be loaded.
menu:
home: / || home
#about: /about/ || user
tags: /tags/ || tags
categories: /categories/ || th
archives: /archives/ || archive
#schedule: /schedule/ || calendar
#sitemap: /sitemap.xml || sitemap
#commonweal: /404/ || heartbeat
...
# ---------------------------------------------------------------
# Scheme Settings
# ---------------------------------------------------------------
# Schemes
#scheme: Muse
#scheme: Mist
#scheme: Pisces
scheme: Gemini
...
sidebar:
# Sidebar Position, available value: left | right (only for Pisces | Gemini).
#position: left
position: right
...
# Back to top in sidebar (only for Pisces | Gemini).
b2t: true
# Scroll percent label in b2t button.
scrollpercent: true
...
# Automatically saving scroll position on each post/page in cookies.
save_scroll: true
...
# Declare license on posts
post_copyright:
enable: true
license: <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" rel="external nofollow" target="_blank">CC BY-NC-SA 4.0</a>
...
# Code Highlight theme
# Available values: normal | night | night eighties | night blue | night bright
# https://github.com/chriskempson/tomorrow-theme
highlight_theme: night
# Enable "cheers" for archive page.
cheers_enabled: false
...
# Disqus
disqus:
enable: true
//!! 댓글 시스템이다 shortname 부분은 Disqus홈페이지 들어가서 가입해서 shortname 적어두면 된다.
shortname: [Disqus에서 적으면 됨]
count: true
lazyload: false
...
# Local search
# Dependencies: https://github.com/theme-next/hexo-generator-searchdb
local_search:
enable: true
# if auto, trigger search by changing input
# if manual, trigger search by pressing enter key or search button
trigger: auto
# show top n results per article, show all results by setting to -1
top_n_per_article: 1
# unescape html strings to the readable one
unescape: false
포스팅할 포멧 설정 작업 scaffolds의 post.md에 내용 추가
---
title: {{ title }}
date: {{ date }}
category:
-
tags:
-
---
페이지 버그 수정작업 hexo new page tags > hexo new page categories 명령어 후 source/tags와 source/categories안의 index.md에 내용 추가
tags 안의 index.md에서 type:, comments: 두 줄만 추가
---
title: tags
date: 2018-05-30 17:46:14
type: "tags"
comments: false
---
tags 안의 index.md에서 type:, comments: 두 줄만 추가
---
title: categories
date: 2018-05-30 17:46:25
type: "categories"
comments: false
---
깃으로 전송하기 앞으로 온라인 상으로 포스팅할 때는 이 명령어만 치면 됨
hexo clean && hexo deploy -g //모든 db와 public파일을 다 지우고 다시 생성해 깃으로 전송하는 명령어
끝.
포스팅하는 방법은 hexo new post [포스트명]으로 글 생성할 수 있고
글을 수정/삭제/복제/백업하기 위해선 [블로그 프로젝트 폴더]/source/_posts에 들어가 있다. 저기 폴더가 내용인 것 수정 후 바로 위의 깃 전송 명령어를 써주면 된다.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment