Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,21 @@ jobs:
curl -L -o MiniPdf.Web/MiniPdf.Web.Client/wwwroot/fonts/NotoSansSC-Regular.ttf \
"https://github.com/google/fonts/raw/main/ofl/notosanssc/NotoSansSC%5Bwght%5D.ttf"

- name: Resolve MiniPdf NuGet version
id: minipdf-version
shell: pwsh
run: |
$index = Invoke-RestMethod 'https://api.nuget.org/v3-flatcontainer/minipdf/index.json'
$version = $index.versions |
Where-Object { $_ -notmatch '-' } |
Select-Object -Last 1
if (-not $version) {
throw 'Could not resolve the latest stable MiniPdf version from NuGet.'
}
"version=$version" >> $env:GITHUB_OUTPUT
Comment on lines +45 to +52

- name: Publish Blazor WASM
run: dotnet publish MiniPdf.Web/MiniPdf.Web.Client/MiniPdf.Web.Client.csproj -c Release -o publish
run: dotnet publish MiniPdf.Web/MiniPdf.Web.Client/MiniPdf.Web.Client.csproj -c Release -o publish -p:Version=${{ steps.minipdf-version.outputs.version }}

- name: Remove pre-compressed files (GitHub Pages does not support content negotiation)
run: find publish/wwwroot -name '*.br' -o -name '*.gz' | xargs rm -f
Expand Down
8 changes: 8 additions & 0 deletions MiniPdf.Web/MiniPdf.Web.Client/Pages/Converter.razor
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<line x1="9" y1="15" x2="15" y2="15"/>
</svg>
<h1>MiniPdf</h1>
<a class="package-version" href="https://www.nuget.org/packages/MiniPdf/@MiniPdfVersion" target="_blank" rel="noopener noreferrer">NuGet v@(MiniPdfVersion)</a>
</div>
<p class="subtitle">@L.T("Subtitle") &mdash; @L.T("PoweredBy") <a href="https://github.com/mini-software/MiniPdf" target="_blank">MiniPdf</a></p>

Expand Down Expand Up @@ -307,6 +308,13 @@
private const string ApiStatusUrl = ApiBaseUrl + "/api/status";
private const string ApiStatsUrl = ApiBaseUrl + "/api/stats";
private const string DefaultFontCacheKey = "NotoSansSC-Regular.ttf";
private static readonly string MiniPdfVersion =
typeof(MiniSoftware.MiniPdf).Assembly
.GetCustomAttributes(typeof(System.Reflection.AssemblyInformationalVersionAttribute), false)
.OfType<System.Reflection.AssemblyInformationalVersionAttribute>()
.FirstOrDefault()?.InformationalVersion.Split('+')[0]
?? typeof(MiniSoftware.MiniPdf).Assembly.GetName().Version?.ToString(3)
?? "unknown";

private IBrowserFile? selectedFile;
private bool isConverting;
Expand Down
18 changes: 18 additions & 0 deletions MiniPdf.Web/MiniPdf.Web.Client/wwwroot/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,24 @@ h1:focus { outline: none; }
letter-spacing: -.02em;
}

.package-version {
padding: .2rem .45rem;
border: 1px solid var(--border);
border-radius: 6px;
color: var(--text-secondary);
font-size: .68rem;
font-weight: 600;
line-height: 1;
text-decoration: none;
transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.package-version:hover {
border-color: var(--accent);
background: var(--accent-light);
color: var(--accent);
}

.subtitle {
color: var(--text-secondary);
font-size: .9rem;
Expand Down
Loading