From 21fb916c9078878e772d3ab1a971f70c6beba914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=B1=E5=91=B1=E5=91=B1?= Date: Tue, 16 Apr 2024 15:06:45 +0800 Subject: [PATCH 1/6] site page add public build --- app/models/page.rb | 2 +- app/views/admins/page_themes/_form_modal.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/page.rb b/app/models/page.rb index 1c606760e..2b7206c22 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -28,7 +28,7 @@ class Page < ApplicationRecord belongs_to :project # language_frame 前端语言框架 - enum language_frame: { hugo: 0, jekyll: 1, hexo: 2} + enum language_frame: { hugo: 0, jekyll: 1, hexo: 2, public: 3} after_create do PageService.genernate_user(user_id) diff --git a/app/views/admins/page_themes/_form_modal.html.erb b/app/views/admins/page_themes/_form_modal.html.erb index 3d0a97588..78e5dcbec 100644 --- a/app/views/admins/page_themes/_form_modal.html.erb +++ b/app/views/admins/page_themes/_form_modal.html.erb @@ -14,7 +14,7 @@ - <% state_options = [['hugo', "hugo"], ['jeklly', "jeklly"],['hexo',"hexo"]] %> + <% state_options = [['hugo', "hugo"], ['jeklly', "jeklly"],['hexo',"hexo"],['public',"public"]] %> <%= select_tag('page_theme[language_frame]', options_for_select(state_options), class: 'form-control') %> <% end%> From d5fb8587ee520fc5ada55ece440f5ebc4c41b03b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=B1=E5=91=B1=E5=91=B1?= Date: Tue, 16 Apr 2024 15:18:15 +0800 Subject: [PATCH 2/6] change public to static_file --- app/models/page.rb | 2 +- app/models/page_theme.rb | 2 +- app/views/admins/page_themes/_form_modal.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/page.rb b/app/models/page.rb index 2b7206c22..7496a54f2 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -28,7 +28,7 @@ class Page < ApplicationRecord belongs_to :project # language_frame 前端语言框架 - enum language_frame: { hugo: 0, jekyll: 1, hexo: 2, public: 3} + enum language_frame: { hugo: 0, jekyll: 1, hexo: 2, static_file: 3} after_create do PageService.genernate_user(user_id) diff --git a/app/models/page_theme.rb b/app/models/page_theme.rb index bce3d5f70..f229cdb9b 100644 --- a/app/models/page_theme.rb +++ b/app/models/page_theme.rb @@ -13,7 +13,7 @@ # class PageTheme < ApplicationRecord - enum language_frame: { hugo: 0, jeklly: 1, hexo: 2} + enum language_frame: { hugo: 0, jeklly: 1, hexo: 2, static_file:3} validates :name, presence: {message: "主题名不能为空"}, uniqueness: {message: "主题名已存在",scope: :language_frame},length: {maximum: 255} def image diff --git a/app/views/admins/page_themes/_form_modal.html.erb b/app/views/admins/page_themes/_form_modal.html.erb index 78e5dcbec..5e88ac365 100644 --- a/app/views/admins/page_themes/_form_modal.html.erb +++ b/app/views/admins/page_themes/_form_modal.html.erb @@ -14,7 +14,7 @@ - <% state_options = [['hugo', "hugo"], ['jeklly', "jeklly"],['hexo',"hexo"],['public',"public"]] %> + <% state_options = [['hugo', "hugo"], ['jeklly', "jeklly"],['hexo',"hexo"],['static_file',"static_file"]] %> <%= select_tag('page_theme[language_frame]', options_for_select(state_options), class: 'form-control') %> <% end%> From a1941fb594334af1d821f0faac0064972bd006fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=B1=E5=91=B1=E5=91=B1?= Date: Tue, 16 Apr 2024 15:32:36 +0800 Subject: [PATCH 3/6] update thems --- app/views/admins/page_themes/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admins/page_themes/index.html.erb b/app/views/admins/page_themes/index.html.erb index 4b4392d88..842f2d934 100644 --- a/app/views/admins/page_themes/index.html.erb +++ b/app/views/admins/page_themes/index.html.erb @@ -6,7 +6,7 @@ <%= form_tag(admins_page_themes_path, method: :get, class: 'form-inline search-form flex-1', remote: true) do %>
- <% state_options = [['全部',nil], ['hugo', 0], ['jeklly', 1],['hexo',2]] %> + <% state_options = [['全部',nil], ['hugo', 0], ['jeklly', 1],['hexo',2],['static_file',3]] %> <%= select_tag(:language_frame, options_for_select(state_options), class: 'form-control') %>
<%= submit_tag('搜索', class: 'btn btn-primary ml-3', 'data-disable-with': '搜索中...') %> From d37ce50c4035857599a0d8b2de27f22812852666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=B1=E5=91=B1=E5=91=B1?= Date: Wed, 17 Apr 2024 09:12:54 +0800 Subject: [PATCH 4/6] rename page site category name --- app/models/page.rb | 2 +- app/models/page_theme.rb | 2 +- app/views/admins/page_themes/_form_modal.html.erb | 2 +- app/views/admins/page_themes/index.html.erb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/page.rb b/app/models/page.rb index 7496a54f2..4b55c99b6 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -28,7 +28,7 @@ class Page < ApplicationRecord belongs_to :project # language_frame 前端语言框架 - enum language_frame: { hugo: 0, jekyll: 1, hexo: 2, static_file: 3} + enum language_frame: { hugo: 0, jekyll: 1, hexo: 2, files: 3} after_create do PageService.genernate_user(user_id) diff --git a/app/models/page_theme.rb b/app/models/page_theme.rb index f229cdb9b..e5830d06c 100644 --- a/app/models/page_theme.rb +++ b/app/models/page_theme.rb @@ -13,7 +13,7 @@ # class PageTheme < ApplicationRecord - enum language_frame: { hugo: 0, jeklly: 1, hexo: 2, static_file:3} + enum language_frame: { hugo: 0, jeklly: 1, hexo: 2, files:3} validates :name, presence: {message: "主题名不能为空"}, uniqueness: {message: "主题名已存在",scope: :language_frame},length: {maximum: 255} def image diff --git a/app/views/admins/page_themes/_form_modal.html.erb b/app/views/admins/page_themes/_form_modal.html.erb index 5e88ac365..5a89bf2bd 100644 --- a/app/views/admins/page_themes/_form_modal.html.erb +++ b/app/views/admins/page_themes/_form_modal.html.erb @@ -14,7 +14,7 @@ - <% state_options = [['hugo', "hugo"], ['jeklly', "jeklly"],['hexo',"hexo"],['static_file',"static_file"]] %> + <% state_options = [['hugo', "hugo"], ['jeklly', "jeklly"],['hexo',"hexo"],['files',"files"]] %> <%= select_tag('page_theme[language_frame]', options_for_select(state_options), class: 'form-control') %> <% end%> diff --git a/app/views/admins/page_themes/index.html.erb b/app/views/admins/page_themes/index.html.erb index 842f2d934..91dd0e34e 100644 --- a/app/views/admins/page_themes/index.html.erb +++ b/app/views/admins/page_themes/index.html.erb @@ -6,7 +6,7 @@ <%= form_tag(admins_page_themes_path, method: :get, class: 'form-inline search-form flex-1', remote: true) do %>
- <% state_options = [['全部',nil], ['hugo', 0], ['jeklly', 1],['hexo',2],['static_file',3]] %> + <% state_options = [['全部',nil], ['hugo', 0], ['jeklly', 1],['hexo',2],['files',3]] %> <%= select_tag(:language_frame, options_for_select(state_options), class: 'form-control') %>
<%= submit_tag('搜索', class: 'btn btn-primary ml-3', 'data-disable-with': '搜索中...') %> From 74d7875552ab116ddff2d8e3765101d6b1b98426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=B1=E5=91=B1=E5=91=B1?= Date: Wed, 17 Apr 2024 09:34:07 +0800 Subject: [PATCH 5/6] update scrip --- app/services/page_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/page_service.rb b/app/services/page_service.rb index 5c166e82c..ab3de37de 100644 --- a/app/services/page_service.rb +++ b/app/services/page_service.rb @@ -47,7 +47,7 @@ class PageService repo_link = project.repository.url repo = project.repository.identifier branch = branch - script_path =page.build_script_path + script_path = branch == "static_files" ? "files_build" : page.build_script_path if script_path.present? uri = URI.parse("http://gitlink.#{@deploy_domain}/gitlink_execute_script?key=#{@deploy_key}&script_path=#{script_path}&project_dir=#{project_dir}&repo=#{repo}&repo_link=#{repo_link}&branch=#{branch}&owner=#{owner}") response = Net::HTTP.get_response(uri) From 9654cc280e8c28be2956a5f0aebeffd40ac1d673 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=B1=E5=91=B1=E5=91=B1?= Date: Wed, 17 Apr 2024 10:19:48 +0800 Subject: [PATCH 6/6] change static_files to gh-pages --- app/services/page_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/page_service.rb b/app/services/page_service.rb index ab3de37de..c85fa394c 100644 --- a/app/services/page_service.rb +++ b/app/services/page_service.rb @@ -47,7 +47,7 @@ class PageService repo_link = project.repository.url repo = project.repository.identifier branch = branch - script_path = branch == "static_files" ? "files_build" : page.build_script_path + script_path = branch == "gh-pages" ? "files_build" : page.build_script_path if script_path.present? uri = URI.parse("http://gitlink.#{@deploy_domain}/gitlink_execute_script?key=#{@deploy_key}&script_path=#{script_path}&project_dir=#{project_dir}&repo=#{repo}&repo_link=#{repo_link}&branch=#{branch}&owner=#{owner}") response = Net::HTTP.get_response(uri)