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
3 changes: 3 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ jobs:
WC_CONSUMER_SECRET: ${{ secrets.WC_CONSUMER_SECRET }}
run: composer prod

- name: Verify rendered SEO metadata and technical links
run: npm run test:html

- name: Upload fork preview artifact
if: github.event.pull_request.head.repo.full_name != github.repository
uses: actions/upload-artifact@v4
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"build-assets": "NODE_ENV=local vite build",
"staging": "NODE_ENV=staging vite build",
"prod": "NODE_ENV=production vite build",
"test:js": "node --test tests/js/*.test.mjs"
"test:js": "node --test tests/js/*.test.mjs",
"test:html": "node --test tests/js/*.smoke.mjs"
},
"devDependencies": {
"@tighten/jigsaw-vite-plugin": "^2.0.0",
Expand Down
3 changes: 3 additions & 0 deletions source/_assets/scss/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@
}

.ud-card__actions {
display: flex;
flex-direction: column;
gap: 12px;
padding-top: 16px;
width: 100%;

Expand Down
10 changes: 10 additions & 0 deletions source/_layouts/header.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@
{{ $page->t('All Features →') }}
</a>
</li>
<li>
<a class="dropdown-item ud-nav-submenu-link" href="{{ $headerLocaleUrl('posts/libresign-api-guide') }}">
{{ $page->t('API Integration Guide') }}
</a>
</li>
<li>
<a class="dropdown-item ud-nav-submenu-link" href="https://docs.libresign.coop/" target="_blank" rel="noopener noreferrer">
{{ $page->t('Official Documentation') }}
</a>
</li>
</ul>
</li>
<li class="nav-item">
Expand Down
22 changes: 15 additions & 7 deletions source/_layouts/main.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,48 @@
@php
$localizedSeoTitle = $page->t($page->title);
$localizedSeoDescription = $page->t($page->description);
$absoluteSeoUrl = static function (string $url) use ($page): string {
if (preg_match('~^https?://~i', $url)) {
return $url;
}

return rtrim($page->siteOrigin, '/') . '/' . ltrim($url, '/');
};
$canonicalUrl = $absoluteSeoUrl($page->getUrl());
@endphp
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ $localizedSeoTitle }}</title>

<!-- Primary Meta Tags -->
<link rel="canonical" href="{{ $page->getUrl() }}">
<link rel="canonical" href="{{ $canonicalUrl }}">
<meta name="description" content="{{ $localizedSeoDescription }}">
@if($page->noindex)<meta name="robots" content="noindex, nofollow">@endif
<meta name="keywords" content="LibreSign, electronic signature, digital signature, open source, self-hosted, Nextcloud, document signing, e-sign, privacy, data sovereignty">
<meta name="author" content="LibreSign / LibreCode">

<!-- Hreflang: multilingual support -->
@foreach($page->locales() as $localeCode => $localeName)
<link rel="alternate" hreflang="{{ $localeCode ?: 'en' }}" href="{{ translate_url($page, $localeCode) }}">
<link rel="alternate" hreflang="{{ $localeCode ?: 'en' }}" href="{{ $absoluteSeoUrl(translate_url($page, $localeCode)) }}">
@endforeach
<link rel="alternate" hreflang="x-default" href="{{ translate_url($page, '') }}">
<link rel="alternate" hreflang="x-default" href="{{ $absoluteSeoUrl(translate_url($page, '')) }}">

<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="{{ $page->getUrl() }}">
<meta property="og:url" content="{{ $canonicalUrl }}">
<meta property="og:title" content="{{ $localizedSeoTitle }}">
<meta property="og:description" content="{{ $localizedSeoDescription }}">
<meta property="og:image" content="{{ rtrim($page->baseUrl, '/') }}/assets/images/logo/logo-libresign-large.png">
<meta property="og:image" content="{{ $absoluteSeoUrl(rtrim($page->baseUrl, '/') . '/assets/images/logo/logo-libresign-large.png') }}">
<meta property="og:site_name" content="LibreSign">
<meta property="og:locale" content="{{ str_replace('-', '_', current_path_locale($page) ?: 'en') }}">

<!-- Twitter / X Card -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:url" content="{{ $page->getUrl() }}">
<meta name="twitter:url" content="{{ $canonicalUrl }}">
<meta name="twitter:title" content="{{ $localizedSeoTitle }}">
<meta name="twitter:description" content="{{ $localizedSeoDescription }}">
<meta name="twitter:image" content="{{ rtrim($page->baseUrl, '/') }}/assets/images/logo/logo-libresign-large.png">
<meta name="twitter:image" content="{{ $absoluteSeoUrl(rtrim($page->baseUrl, '/') . '/assets/images/logo/logo-libresign-large.png') }}">
<meta name="twitter:site" content="@libresign">

<!--====== Favicon Icon ======-->
Expand Down
5 changes: 5 additions & 0 deletions source/faq.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ class="ud-faq-btn collapsed"
</div>

<div class="text-center mt-5 pt-2">
<p class="mb-3">{{ $page->t('For installation, access permissions, external signing invitations, and API integration details, consult the technical guides for your installed LibreSign version.') }}</p>
<div class="d-flex justify-content-center flex-wrap gap-3 mb-4">
<a href="{{ locale_url($page, 'posts/libresign-api-guide') }}" class="btn ud-btn-solid-brand">{{ $page->t('API Integration Guide') }}</a>
<a href="https://docs.libresign.coop/" class="btn ud-btn-outline-brand" target="_blank" rel="noopener noreferrer">{{ $page->t('Official Documentation') }}</a>
</div>
<p class="mb-4">{{ $page->t('Still have questions? Our team is ready to help.') }}</p>
<a href="{{ locale_url($page, 'contact-us') }}" class="btn ud-btn-solid-brand">
{{ $page->t('Talk to Our Specialists') }}
Expand Down
16 changes: 11 additions & 5 deletions source/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,17 @@
[
'title' => $page->t('Total Control and Flexibility to Integrate?'),
'icon' => $page->baseUrl . 'assets/images/icon/features/integration-flexibility.svg',
'body' => $page->t('Easily integrate, customize to your needs, and enjoy the freedom of a robust, scalable architecture under your control.'),
'actions' => [[
'href' => locale_url($page, 'tecnical-details'),
'label' => $page->t('Technical Details for IT.'),
]],
'body' => $page->t('Run LibreSign as an open-source Nextcloud app on infrastructure you control, and connect existing systems through its API.'),
'actions' => [
Comment thread
vitormattos marked this conversation as resolved.
Resolved
[
'href' => locale_url($page, 'tecnical-details'),
'label' => $page->t('Technical Details for IT.'),
],
[
'href' => locale_url($page, 'posts/libresign-api-guide'),
'label' => $page->t('API Integration Guide'),
],
],
],
];
@endphp
Expand Down
23 changes: 17 additions & 6 deletions source/tecnical-details.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "LibreSign for IT Teams - Self-Hosted Digital Signature Platform"
description: "Deploy LibreSign on your own infrastructure. Explore API capabilities, Nextcloud integration, digital certificate support, and full control over your data."
title: "LibreSign for IT Teams - Self-Hosted Nextcloud Signature App"
description: "Run LibreSign on a compatible Nextcloud installation, connect external systems through its API, and manage document access on your own infrastructure."
---
@extends('_layouts.main')

Expand Down Expand Up @@ -63,6 +63,17 @@
])

<div class="ud-it-page">
<section class="ud-page-section" aria-labelledby="it-requirements-heading">
<div class="container">
<h2 id="it-requirements-heading">{{ $page->t('Installation and integration requirements') }}</h2>
<p>{{ $page->t('LibreSign is an app for a compatible Nextcloud server, not an independent standalone signing server. API integrations use an authorized Nextcloud account and its installation-specific permissions. Depending on configuration, external recipients can sign through invitations without a Nextcloud account.') }}</p>
<p>{{ $page->t('External applications can keep their own interface and workflows while their backend requests signatures and retrieves signed documents only with appropriate authorization. Consult the documentation for your installed LibreSign version.') }}</p>
<div class="d-flex flex-wrap gap-3 mt-4">
<a href="{{ locale_url($page, 'posts/libresign-api-guide') }}" class="btn ud-btn-solid-brand">{{ $page->t('Read the API Integration Guide') }}</a>
<a href="https://docs.libresign.coop/" class="btn ud-btn-outline-brand" target="_blank" rel="noopener noreferrer">{{ $page->t('Official Documentation') }}</a>
</div>
</div>
</section>
@include('_partials.home.card-grid-section', [
'sectionId' => 'it-pillars',
'sectionClass' => 'ud-it-pillars ud-page-section',
Expand All @@ -71,8 +82,8 @@
'subtitle' => $page->t('Discover the technical pillars that give your team freedom to innovate with confidence, visibility, and governance.'),
'items' => $itPillarItems,
'sectionActions' => [[
'href' => 'https://docs.libresign.coop/developer_manual/api/',
'label' => $page->t('Access API Documentation'),
'href' => 'https://docs.libresign.coop/',
'label' => $page->t('Choose Your Version for API Documentation'),
'class' => 'btn ud-btn-solid-brand',
'target' => '_blank',
]],
Expand All @@ -94,8 +105,8 @@
'class' => 'btn ud-btn-solid-warm',
],
[
'href' => 'https://docs.libresign.coop/admin_manual/',
'label' => $page->t('Read the Admin Documentation'),
'href' => 'https://docs.libresign.coop/',
'label' => $page->t('Choose Your Version for Admin Documentation'),
'class' => 'btn ud-btn-ghost',
'target' => '_blank',
],
Expand Down
58 changes: 58 additions & 0 deletions tests/js/rendered-technical-discovery.smoke.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
import test from 'node:test';

const buildRoot = new URL('../../build_production/', import.meta.url);
const html = (path) => readFileSync(new URL(path, buildRoot), 'utf8');
const tags = (page, name) => [...page.matchAll(new RegExp('<' + name + '\\b[^>]*>', 'gi'))].map((match) => match[0]);
const attribute = (tag, name) => tag?.match(new RegExp('\\b' + name + '="([^"]*)"', 'i'))?.[1] ?? null;
const namedTag = (page, element, attributeName, value) =>
tags(page, element).find((tag) => attribute(tag, attributeName) === value);

test('generated pages have absolute canonical, hreflang and social image URLs', () => {
for (const path of [
'index.html',
'faq/index.html',
'tecnical-details/index.html',
'pt-BR/tecnical-details/index.html',
]) {
const page = html(path);
const canonical = attribute(namedTag(page, 'link', 'rel', 'canonical'), 'href');
assert.match(canonical ?? '', /^https:\/\//, path + ': canonical must be absolute');
const canonicalOrigin = new URL(canonical).origin;

const alternates = tags(page, 'link').filter((tag) =>
attribute(tag, 'rel') === 'alternate' && attribute(tag, 'hreflang'));
assert.ok(alternates.length > 0, path + ': missing hreflang');
for (const alternate of alternates) {
assert.match(attribute(alternate, 'href') ?? '', /^https:\/\//, path + ': hreflang must be absolute');
}

for (const [name, key] of [['og:image', 'property'], ['twitter:image', 'name']]) {
const image = attribute(namedTag(page, 'meta', key, name), 'content');
assert.match(image ?? '', /^https:\/\//, path + ': ' + name + ' must be absolute');
assert.equal(new URL(image).origin, canonicalOrigin, path + ': ' + name + ' must use the site origin');
assert.match(new URL(image).pathname, /\/assets\/images\/logo\/logo-libresign-large\.png$/);
}
}
});

test('rendered technical guide links are styled and external docs open safely', () => {
for (const path of ['index.html', 'faq/index.html', 'tecnical-details/index.html']) {
const anchors = tags(html(path), 'a');
assert.ok(anchors.some((tag) =>
/posts\/libresign-api-guide/.test(attribute(tag, 'href') ?? '') &&
/\bud-btn-solid-brand\b/.test(attribute(tag, 'class') ?? '')
), path + ': missing styled API guide action');
}

for (const path of ['faq/index.html', 'tecnical-details/index.html']) {
const anchors = tags(html(path), 'a');
assert.ok(anchors.some((tag) =>
attribute(tag, 'href') === 'https://docs.libresign.coop/' &&
/\bud-btn-outline-brand\b/.test(attribute(tag, 'class') ?? '') &&
attribute(tag, 'target') === '_blank' &&
attribute(tag, 'rel') === 'noopener noreferrer'
), path + ': missing safely opened documentation action');
}
});
30 changes: 30 additions & 0 deletions tests/js/technical-discovery.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
import test from 'node:test';

const read = (name) => readFileSync(new URL('../../source/' + name, import.meta.url), 'utf8');
const header = read('_layouts/header.blade.php');
const home = read('index.blade.php');
const technical = read('tecnical-details.blade.php');
const faq = read('faq.blade.php');
const layout = read('_layouts/main.blade.php');

test('primary discovery paths reference the API guide and documentation chooser', () => {
for (const [name, source] of [['header', header], ['home', home], ['technical', technical], ['FAQ', faq]]) {
assert.match(source, /posts\/libresign-api-guide/, name + ' lacks an API guide link');
}
for (const [name, source] of [['header', header], ['technical', technical], ['FAQ', faq]]) {
assert.match(source, /https:\/\/docs\.libresign\.coop\//, name + ' lacks a documentation chooser');
}
assert.doesNotMatch(technical, /docs\.libresign\.coop\/(?:developer_manual|admin_manual)\//);
});

test('social image URLs use the origin resolver even with production baseUrl="/"', () => {
assert.match(layout, /property="og:image" content="\{\{\s*\$absoluteSeoUrl\(/);
assert.match(layout, /name="twitter:image" content="\{\{\s*\$absoluteSeoUrl\(/);
});

test('new technical links use the Weblate extraction helper', () => {
assert.match(technical, /id="it-requirements-heading">\{\{\s*\$page->t\(/);
assert.match(faq, /https:\/\/docs\.libresign\.coop\/"[^>]*>\{\{\s*\$page->t\(/);
});
Loading