728x90 반응형 2020/10/202 github page 에 테마 설치 1. icarusn 모듈 설치 먼저 로컬에 있는 blog 소스가 있는 폴더 안에서 git submodule 을 추가해준다. 내가 설치하려고 하는 테마는 icarus 라는 테마인데 설치 방법은 여러가지가 있다. Document를 보니 git submodule 을 추가하는 방법도 있고 npm 으로 설치하는방법도 있다. git submodule add https://github.com/ppoffice/hexo-theme-icarus.git themes/icarus 이렇게 하면 blog 하위에 themes 폴더 안에 icarus 라는 항목이 생긴다. 또는 npm install -S hexo-theme-icarus 나는 submodule 을 추가 하는 방법을 사용했다. 2. 설정파일 변경 _config.yml 파.. 2020. 10. 20. Python 으로 파일 내용 변경 하기 잠깐 필요에 의해서 만든 소스 def changeStringInFile(filePath, orgValue, newValue): with open(filePath, "r+") as file_object: fileContents = file_object.read() newFileContents = fileContents.replace(orgValue, newValue) file_object.seek(0) file_object.write(newFileContents) file_object.close() 파일을 오픈 한 후에 orgValue 를 찾아서 newValue 로 변경을 한다. 변경을 한 후 열었던 파일에 다시 덮어쓴다. 다시 write 할 때에 기존 파일 뒤에 append 되는것을 막기 위해서 seek.. 2020. 10. 20. 이전 1 다음 728x90 반응형