Skip to content

Commit

Permalink
Merge pull request #32 from cabidop/fix-github-action
Browse files Browse the repository at this point in the history
Updated Github Action runs
  • Loading branch information
angusmcleod authored Jul 30, 2024
2 parents ee9d865 + 4500e70 commit 2f20e3b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/discourse-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ on:
branches:
- main
pull_request:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:

jobs:
ci:
uses: discourse/.github/.github/workflows/discourse-plugin.yml@v1
with:
core_ref: v3.2.3
10 changes: 6 additions & 4 deletions app/controllers/landing_pages/landing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ def show
if !SiteSetting.landing_redirect_to_homepages || visit_from_crawler?
render inline: @page.body, layout: "landing"
else
redirect_to path("/#{SiteSetting.landing_redirect_to_homepages_root_path}/#{request.path.split("/").last}")
homepages_root_path =
"/#{SiteSetting.landing_redirect_to_homepages_root_path}/#{request.path.split("/").last}"
redirect_to path(homepages_root_path)
end
end
else
Expand All @@ -55,9 +57,9 @@ def path(p)
end

def visit_from_crawler?
request.user_agent && (request.media_type.blank? || request.media_type.include?("html")) &&
!%w[json rss].include?(params[:format]) &&
CrawlerDetection.crawler?(request.user_agent, request.headers["HTTP_VIA"])
request.user_agent && (request.media_type.blank? || request.media_type.include?("html")) &&
!%w[json rss].include?(params[:format]) &&
CrawlerDetection.crawler?(request.user_agent, request.headers["HTTP_VIA"])
end

def contact
Expand Down

0 comments on commit 2f20e3b

Please sign in to comment.