fix: simplify analytics setup
This commit is contained in:
@@ -66,7 +66,5 @@ jobs:
|
||||
username: ${{ secrets.SSH_USERNAME }}
|
||||
key: ${{ secrets.SSH_KEY }}
|
||||
script: |
|
||||
export GOOGLE_ANALYTICS_TAG="${{ secrets.GOOGLE_ANALYTICS_TAG }}"
|
||||
chmod +x blog.stevanfreeborn.com/deploy.ps1
|
||||
sudo pwsh ./blog.stevanfreeborn.com/deploy.ps1 ${{ needs.build.outputs.version }}
|
||||
unset GOOGLE_ANALYTICS_TAG
|
||||
+1
-2
@@ -8,8 +8,7 @@ function StartContainer {
|
||||
|
||||
$containerName = "blog.stevanfreeborn.com.$containerColor"
|
||||
$postDirEnv = "FilePostServiceOptions__PostsDirectory=wwwroot/posts"
|
||||
$googleTagEnv = "GoogleAnalyticsTag=$env:GOOGLE_ANALYTICS_TAG"
|
||||
$containerId = docker run -d -p 8080 --name $containerName --env $postDirEnv --env $googleTagEnv $dockerTag
|
||||
$containerId = docker run -d -p 8080 --name $containerName --env $postDirEnv $dockerTag
|
||||
|
||||
if ($LASTEXITCODE -ne 0)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Blazor-Analytics" Version="3.12.0" />
|
||||
<PackageReference Include="Markdig" Version="0.36.2" />
|
||||
<PackageReference Include="System.ServiceModel.Syndication" Version="8.0.0" />
|
||||
<PackageReference Include="TestableIO.System.IO.Abstractions.Wrappers" Version="21.0.2" />
|
||||
|
||||
@@ -13,12 +13,18 @@
|
||||
|
||||
<body>
|
||||
<Routes />
|
||||
<NavigationTracker />
|
||||
<script src="https://cdn.jsdelivr.net/npm/anchor-js/anchor.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.11/dist/clipboard.min.js"></script>
|
||||
<script src="https://www.googletagmanager.com/gtag/js?id=G-5JM0TZTRHF"></script>
|
||||
<script src="prism.js"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', 'G-5JM0TZTRHF');
|
||||
</script>
|
||||
<script src="_framework/blazor.web.js"></script>
|
||||
<script src="_content/Blazor-Analytics/blazor-analytics.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -9,5 +9,3 @@
|
||||
@using Blog
|
||||
@using Blog.Components
|
||||
@using Blog.Components.Utils
|
||||
@using Blazor.Analytics
|
||||
@using Blazor.Analytics.Components
|
||||
@@ -1,5 +1,3 @@
|
||||
using Blazor.Analytics;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
builder.Services.ConfigureOptions<FilePostServiceOptionsSetup>();
|
||||
@@ -8,9 +6,6 @@ builder.Services.AddScoped<IPostService, FilePostService>();
|
||||
|
||||
builder.Services.AddRazorComponents();
|
||||
|
||||
var googleTag = builder.Configuration["GoogleAnalyticsTag"];
|
||||
builder.Services.AddGoogleAnalytics(googleTag);
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
if (app.Environment.IsProduction())
|
||||
|
||||
Reference in New Issue
Block a user