How to save the customized theme before applying another theme?

Hi

I am using the cupper theme with some modifications. I installed the original theme as a submodule and saved the data in root/themes/cupper-hugo-theme; the customized one is applied in a way of overriding, that is, I copied the original structure of cupper-hugo-theme into the root directory and modified them.

Now, I am about to install and move to another theme. Ultimately, I want to save both themes and want to be able to switch within them using the theme variable in the config.yaml.

Before adding another theme, I want to save the current theme (modified cupper). I conceive that I can do it by the following steps:

  1. pack the current theme in a new folder (i.e. cupper-hugo-theme-modified)
  2. save the cupper-hugo-theme-modified folder in root/themes folder
  3. install a new theme in the root/themes folder
  4. copy the structure of the newly installed theme into the root directory and customize it

, but I cannot try it, wondering it may provoke irreversible errors (sorry for not providing any codes in this query).

Will my plan work? or is there any other avenue?

Thanks in advance.

This is handled using a Version Control System, such as git. Then you can do things like move code around.

Thank you for your reply, but could you explain more? I can not understand the way what you told.

안녕하세요 훈택님
제가 이해한게 맞다면, 두개의 테마를 themes 폴더에 가지고 계시고 config에서 theme값을 변경해서 테마를 손쉽게 변경하고 싶으신거네요?

저는 하나의 사이트에 하나의 테마만 쓰는게 좋아보이는데 왜냐하면 각 테마마다 쓰는 설정값도 다르고, 쓰이는 shortcode또한 다르기 때문에, 단순히 config.toml 파일에서 theme값만 변경해준다고 모든게 마법처럼 해결되는게 아니라서요.

테마들 한번 구경가보세요. 각 테마마다 쓰는 config.toml 파일이랑 params.toml 파일값이 다 다릅니다.

물론 방법이 아예 없는건 아닌데요, 다음처럼 해보시겠어요?

  1. themes 폴더는 그냥 변경하지 않은, 오리지날만 버전으로 유지하시고요
  2. config.toml 파일에 서 해당 theme의 컨텐츠 폴더, 레이아웃 폴더 등등을 직접 명시해주세요. contentDir, dataDir, ‘layoutDir’, ‘publishDir’, ‘staticDir’, ‘themesDir’ 등등,

물론 저는 왜 이렇게 하시려는지 아해가 잘 안가지만, 테마를 변경하실 때 마다 theme의 값 뿐만 아니라 위처럼 dir 값도 일일이 변경해주셔야되요

안녕하세요 zzo님. 답변 감사합니다.
제 상상은 상상에 불과했다니 아쉽네요.

말씀하신 것처럼 좀 복잡해지기도 하니 테마 하나로 유지하는 게 나아 보이네요.
좋은 테마 만들어주셔서 감사합니다. Zzo 테마 관련해서 궁금한 거 있으면 또 질문드릴 것 같습니다.

안녕하세요 훈택님!

검색 대상을 게시글 제목뿐만 아니라 내용까지 확장할 수 있을까요?

네. 테마를 최신버전으로 업데이트 하면 내용까지 검색될거에요. search 라이브러리로 fuse.js를 사용하고 있는데 내용의 전체는 검색하지 않고 앞의 일부분만 검색하더라구요. 일단 업데이트 후에 테스트해보세요.

404 not found 에러

혹시 파일 이름을 소문자로 바꿔보시겠어요?
Paper_Review_2020.mdpaper_review_2020.md

제가 GitPage를 안써봐서 잘은 모르겠지만 대소문자를 구분하나봐요

제가 확인해보니까 마크다운 파일이 많지만 content내용을 못읽는거 같아요
라이브러리로 fuse.js 쓰고있는데, 이 라이브러리가 그런식으로 설계 되어있는듯…

지금 오픈소스로 나온 search 라이브러리로는 저게 가장 유명하고 한글도 지원되는건데

content까지 검색하려면 아마 검색 라이브러리를 직접 만들어야 할 수도 있을거 같아요(제가 만들수 있다고 확신은 못하겠어요 ㅠㅠ)

아마 title과 description 부분이 검색되면 일단 그렇게 쓰시고 content는 제가 좀 더 생각해볼게요

2020년 2월 23일 (일) 오전 12:28, Hoontaek Lee via HUGO gohugo@discoursemail.com님이 작성: