Skip to content

Commit

Permalink
Merge branch 'master' into fix/go-download-kmp
Browse files Browse the repository at this point in the history
  • Loading branch information
darcywong00 committed Nov 6, 2024
2 parents 31d31cb + 92b2c49 commit 24ad8a8
Show file tree
Hide file tree
Showing 31 changed files with 158 additions and 119 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CI

on:
on:
[pull_request]
jobs:

Expand Down Expand Up @@ -34,7 +34,7 @@ jobs:
run: |
set +e;
set +o pipefail;
npx broken-link-checker http://localhost:8053/_test --ordered --recursive --host-requests 50 -e --filter-level 3 | \
npx broken-link-checker http://localhost:8053/_test --ordered --recursive --host-requests 50 -e --filter-level 3 --exclude '*/donate' | \
grep -E "BROKEN|Getting links from" | \
grep -B 1 "BROKEN"
exit ${PIPESTATUS[0]}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ vendor*
resources/bootstrap.inc.sh
resources/.bootstrap-version
_common/

# State files
_control/debug
13 changes: 12 additions & 1 deletion .htaccess
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# This file is used when running with Apache. Adapted from web.config.
# NOTE: this is not very well tested...

php_value display_errors off
php_value display_startup_errors off
php_value include_path ".:/var/www/html/_includes/"

<IfFile /var/www/html/_control/debug>
php_value display_startup_errors on
php_value display_errors stderr
</IfFile>

# We turn off automatic addition of slashes for directories because it
# interferes with the file extension removal for .php files. At the bottom of
# this file, we have a redirect rule to mimic the same behaviour, _after_ the
Expand Down Expand Up @@ -112,7 +121,7 @@ RewriteRule "^keyboards/countries/(.*)" "/keyboards/index.php?q=c:id:$1" [END]

# Synonym paths

# 10.0 to 15.0
# 10.0 to 15.0
# /1X.0 to /1X landing page
RedirectMatch "^/1([0-5])(\.0)\/?" "/1$1/"

Expand Down Expand Up @@ -207,3 +216,5 @@ RewriteRule "^(.+)/$" "$1/index.php" [END]
# done automatically because we put DirectorySlash off
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule "^(.*)([^/])$" "$1$2/" [R]


3 changes: 0 additions & 3 deletions .user.ini

This file was deleted.

14 changes: 13 additions & 1 deletion _includes/2020/templates/Head.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ static function render($fields = []) {
if(!isset($fields->title)) {
$fields->title = 'Keyman | Type to the world in your language';
}
if(empty($fields->language)) {
$fields->language = 'en'; // Default to English
}
if(!isset($fields->favicon)) {
$fields->favicon = Util::cdn("img/favicon.ico");
}
Expand All @@ -23,10 +26,19 @@ static function render($fields = []) {
$fields->js = [];
}
?><!DOCTYPE html>
<html>
<?php
if (!empty($fields->language)) {
echo "<html lang='$fields->language'>";
} else {
echo "<html>";
}
?>
<head>
<meta charset="utf-8">
<?php
if(isset($fields->description) && !empty($fields->description)) {
echo "<meta name='description' content='" . $fields->description . "'>\n";
}
if(KeymanHosts::Instance()->Tier() == KeymanHosts::TIER_STAGING) {
echo ' <meta name="robots" content="none">';
}
Expand Down
18 changes: 9 additions & 9 deletions _includes/2020/templates/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private static function render_phone_menu(object $fields): void {
<h3>Keyboards</h3>
<form method="get" action="/keyboards" name="fsearch">
<input id="language-search2" type="text" placeholder="Enter language" name="q">
<input id="search-submit2" type="image" src="<?php echo Util::cdn("img/search-button.png"); ?>" value="Search" onclick="if(document.getElementById('language-search2').value==''){return false;}">
<input id="search-submit2" type="image" src="<?php echo Util::cdn("img/search-button.png"); ?>" alt="search button" value="Search" onclick="if(document.getElementById('language-search2').value==''){return false;}">
</form>
</div>
<div class="phone-menu-item">
Expand Down Expand Up @@ -101,7 +101,7 @@ private static function render_top_menu(object $fields): void {

<div id="container" class="page-<?=$fields->pageClass?>">
<div class="header">
<img id="show-phone-menu" src="<?php echo Util::cdn("img/phonehide.png"); ?>" />
<img id="show-phone-menu" src="<?php echo Util::cdn("img/phonehide.png"); ?>" alt="menu toggle" />
<a id="home-link" href="/"><img id="logo" src="<?php echo Util::cdn(KeymanHosts::Instance()->Tier() == KeymanHosts::TIER_PRODUCTION ? "img/logo2.png" : "img/logo2dev.png"); ?>" alt='Keyman Logo' /></a>
<img id="header-bottom" src="<?php echo Util::cdn("img/headerbar.png"); ?>" alt='Header bottom' />
<div id="help">
Expand All @@ -114,12 +114,12 @@ private static function render_top_menu(object $fields): void {
</div>
</form>
<p id="donate"><a href="/donate">Donate</a></p>
<p><a href="<?= KeymanHosts::Instance()->help_keyman_com ?>" target="blank">Support<img src="<?php echo Util::cdn("img/helpIcon.png"); ?>"></a></p>
<p><a href="<?= KeymanHosts::Instance()->help_keyman_com ?>" target="blank">Support<img src="<?php echo Util::cdn("img/helpIcon.png"); ?>" alt="help icon"></a></p>
</div>
</div>
<div id="top-menu-bg"></div>
<div id="top-menu1">
<a href="/"><img id="top-menu-icon" src="<?php echo Util::cdn("img/icon1.png"); ?>" /></a>
<a href="/"><img id="top-menu-icon" src="<?php echo Util::cdn("img/icon1.png"); ?>" alt="Keyman logo" /></a>
<div id='help1'>
<form action="/search/" method="get" role="search">
<div class="search-wrap">
Expand All @@ -129,11 +129,11 @@ private static function render_top_menu(object $fields): void {
</div>
</form>
<a id='help1-donate' href="/donate">Donate</a>
<a href="<?= KeymanHosts::Instance()->help_keyman_com ?>"><img id="top-menu-icon2" src="<?php echo Util::cdn("img/helpIcon.png"); ?>" /></a>
<a href="<?= KeymanHosts::Instance()->help_keyman_com ?>"><img id="top-menu-icon2" src="<?php echo Util::cdn("img/helpIcon.png"); ?>" alt="help icon" /></a>
</div>
<div class="wrapper">
<div class="menu-item" id="keyboards">
<h3>Keyboards<span class="header-triangle"><img src="<?php echo Util::cdn("img/img_trans.png"); ?>" /></span></h3>
<h3>Keyboards<span class="header-triangle"><img src="<?php echo Util::cdn("img/img_trans.png"); ?>" alt="keyboards dropdown" /></span></h3>
<div class="menu-item-dropdown">
<div class="menu-dropdown-inner">
<h4>(2000+ languages)</h4>
Expand Down Expand Up @@ -161,7 +161,7 @@ private static function render_top_menu(object $fields): void {
</div>
</div>
<div class="menu-item" id="products">
<h3>Products<span class="header-triangle"><img src="<?php echo Util::cdn("img/img_trans.png"); ?>" /></span></h3>
<h3>Products<span class="header-triangle"><img src="<?php echo Util::cdn("img/img_trans.png"); ?>" alt="products dropdown" /></span></h3>
<div class="menu-item-dropdown">
<div class="menu-dropdown-inner">
<h4>Core Products</h4>
Expand All @@ -184,7 +184,7 @@ private static function render_top_menu(object $fields): void {
</div>
</div>
<div class="menu-item" id="tavultesoft">
<h3>About<span class="header-triangle"><img src="<?php echo Util::cdn("img/img_trans.png"); ?>" /></span></h3>
<h3>About<span class="header-triangle"><img src="<?php echo Util::cdn("img/img_trans.png"); ?>" alt="About dropdown" /></span></h3>
<div class="menu-item-dropdown">
<div class="menu-dropdown-inner">
<ul>
Expand All @@ -209,7 +209,7 @@ private static function render_top_menu(object $fields): void {
</div>
</div>
</div>
<img id="top-menu-bottom" src="<?php echo Util::cdn("img/headerbar.png"); ?>" />
<img id="top-menu-bottom" src="<?php echo Util::cdn("img/headerbar.png"); ?>" alt="Header bottom" />
</div>
<div id="phone-header-spacer"></div>

Expand Down
1 change: 1 addition & 0 deletions _includes/includes/md/mdhost.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
'title' => $md->PageTitle(),
'css' => ['template.css','prism.css'],
'showMenu' => $md->ShowMenu(),
'description' => $md->PageDescription(),
'js' => ['prism.js']
]);

Expand Down
8 changes: 8 additions & 0 deletions _includes/includes/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ function head($args=[]){
}else{
$title = 'Keyman | Type to the world in your language';
}
if(isset($args['description'])) {
$description = $args['description'];
}
if(isset($args['language'])) {
$language = $args['language'];
}
if(isset($args['css'])){
$css = array();
foreach($args['css'] as $cssFile){
Expand Down Expand Up @@ -80,7 +86,9 @@ function head($args=[]){
// This avoids the global variable plague of earlier templates!
$head = [];
if(isset($title)) $head['title'] = $title;
if(isset($description)) $head['description'] = $description;
if(isset($favicon)) $head['favicon'] = $favicon;
if(isset($language)) $head['language'] = $language;
if(isset($css)) $head['css'] = $css;
if(isset($js)) $head['js'] = $js;
\Keyman\Site\com\keyman\templates\Head::render($head);
Expand Down
2 changes: 1 addition & 1 deletion _includes/includes/ui/download-links.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<a class="language desktop" href="/cheyenne">Cheyenne <span class="pipe">|</span> <span lang="chy" class="lang-example">Tsėhesenėstsestotse</span></a>
<a class="language" href="/dinka">Dinka <span class="pipe">|</span> <span lang="din" class="lang-example">Thuɔŋjäŋ</span></a>
<a class="language desktop" href="/dutch">Dutch <span class="pipe">|</span> <span lang="nl" class="lang-example">Nederlands</span></a>
<a class="language desktop" href="/ancient-egyptian">Egyptian <span class="lang-ital">(Ancient)</span> <span class="pipe">|</span> <span lang="egy" class="lang-example"><img id="hiero" src="<?php echo cdn("img/hiero.png"); ?>" /></span></a>
<a class="language desktop" href="/ancient-egyptian">Egyptian <span class="lang-ital">(Ancient)</span> <span class="pipe">|</span> <span lang="egy" class="lang-example"><img id="hiero" src="<?php echo cdn("img/hiero.png"); ?>" alt="Hieroglyphs example" /></span></a>
<a class="language" href="/farsi">Farsi <span class="pipe">|</span> <span lang="pes" class="lang-example">فارسی</span></a>
<a class="language desktop" href="/french">French <span class="pipe">|</span> <span lang="fr" class="lang-example">Français</span></a>
<a class="language desktop" href="/german">German <span class="pipe">|</span> <span lang="de" class="lang-example">Deutsch</span></a>
Expand Down
8 changes: 8 additions & 0 deletions about/developers/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ I am married, with two adult children, and two cats. I love playing computer ga

My personal website can be found at [markcsinclair.co.uk](https://markcsinclair.co.uk/)

----

![](https://github.com/rc-swag.png?size=240)

### Ross Cruickshank
<br/>
With degrees in Electronics and Information Technology from QUT, I have worked across various roles in software and electronics engineering. This has given me experience in high-availability systems, microcontroller design, and software development. With Keyman, I contribute mostly to the Keyman for Windows product. I am based in Australia and outside of work, I enjoy spending time with my family, mountain biking and road cycling.

## Previous Contributors

More about [previous contributors](./previous)
1 change: 1 addition & 0 deletions android/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// Required
head([
'title' =>'Keyman for Android',
'description' => 'Keyman for Android',
'css' => ['template.css','feature-grid.css','app-store-links.css'],
'showMenu' => true,
'banner' => [
Expand Down
15 changes: 0 additions & 15 deletions applicationHost.xdt

This file was deleted.

4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## START STANDARD SITE BUILD SCRIPT INCLUDE
readonly THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
readonly BOOTSTRAP="$(dirname "$THIS_SCRIPT")/resources/bootstrap.inc.sh"
readonly BOOTSTRAP_VERSION=v0.10
readonly BOOTSTRAP_VERSION=v0.11
[ -f "$BOOTSTRAP" ] && source "$BOOTSTRAP" || source <(curl -fs https://raw.githubusercontent.com/keymanapp/shared-sites/$BOOTSTRAP_VERSION/bootstrap.inc.sh)
## END STANDARD SITE BUILD SCRIPT INCLUDE

Expand Down Expand Up @@ -33,7 +33,7 @@ function test_docker_container() {
echo "---- Testing links ----"
set +e;
set +o pipefail;
npx broken-link-checker http://localhost:8053/_test --recursive --ordered ---host-requests 50 -e --filter-level 3 | \
npx broken-link-checker http://localhost:8053/_test --recursive --ordered ---host-requests 50 -e --filter-level 3 --exclude '*/donate' | \
grep -E "BROKEN|Getting links from" | \
grep -B 1 "BROKEN";

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
"test": "vendor\\bin\\phpunit --testdox",
"check-links": [
"Composer\\Config::disableProcessTimeout",
"npx broken-link-checker http://keyman.com.localhost --ordered --recursive --host-requests 10 -e --filter-level 3"
"npx broken-link-checker http://keyman.com.localhost --ordered --recursive --host-requests 10 -e --filter-level 3 --exclude '*/donate'"
],
"check-docker-links": [
"Composer\\Config::disableProcessTimeout",
"npx broken-link-checker http://localhost:8053 --ordered --recursive --host-requests 10 -e --filter-level 3"
],
"npx broken-link-checker http://localhost:8053 --ordered --recursive --host-requests 10 -e --filter-level 3 --exclude '*/donate'"
],
"lint": "find . -name '*.php' | grep -v '/vendor/' | xargs -n 1 -d '\\n' php -l"
}
}
2 changes: 1 addition & 1 deletion downloads/archive/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
// Required
head([
'title' =>'Download Archives',
'description' => 'Keyman download archive: static activation license keys',
'css' => ['template.css', 'feature-grid.css'],
'showMenu' => true
]);

require_once('./static-keys.php');

// These variables should be progressively added if we update older versions.
// 14.0 onward uses 3 numbers instead of 4
$ver_windows_16 = "16.0.147";
Expand Down
1 change: 1 addition & 0 deletions downloads/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// Required
head([
'title' =>'Keyman Downloads',
'description' => 'Keyman stable downloads',
'css' => ['template.css','index.css','app-store-links.css', 'prism.css'],
'js' => ['prism.js'],
'showMenu' => true
Expand Down
1 change: 1 addition & 0 deletions downloads/pre-release/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// Required
head([
'title' =>'Keyman Pre-release Versions',
'description' => 'Keyman pre-release versions: alpha, beta',
'css' => ['template.css','index.css', 'app-store-links.css','prism.css'],
'showMenu' => true
]);
Expand Down
Loading

0 comments on commit 24ad8a8

Please sign in to comment.