Commit 77fd6db6 authored by Carl Schwan's avatar Carl Schwan 🚴
Browse files

Port to Hugo

parent bf54fdc2
# SPDX-FileCopyrightText: 2020 Carl Schwan <carl@carlschwan.eu>
#
# SPDX-License-Identifier: CC0-1.0
# In all environments, the following files are loaded if they exist,
# the latter taking precedence over the former:
#
# * .env contains default values for the environment variables needed by the app
# * .env.local uncommitted file with local overrides
# * .env.$APP_ENV committed environment-specific defaults
# * .env.$APP_ENV.local uncommitted environment-specific overrides
#
# Real environment variables win over .env files.
#
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
#
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
###> symfony/framework-bundle ###
APP_ENV=prod
APP_SECRET=4780c8d41d6711b49373a38df3446598
#TRUSTED_PROXIES=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
#TRUSTED_HOSTS='^(localhost|example\.com)$'
###< symfony/framework-bundle ###
......@@ -16,6 +16,9 @@ kde-org-applications-extractor/
.idea
locales
index.json.back
public
content/applications
resources
###> symfony/phpunit-bridge ###
.phpunit
......
# SPDX-FileCopyrightText: (C) 2020 Carl Schwan
#
# SPDX-License-Identifier: LGPL-2.1-or-later
image: opensuse/tumbleweed
cache:
paths:
- vendor/
before_script:
- zypper --non-interactive install php7 php7-dom php7-intl php7-iconv php7-ctype php7-tokenizer php7-mbstring php7-curl php7-xmlwriter php7-pdo unzip php-composer
- composer install
test:app:
script:
- bin/phpunit
const search = document.getElementById('search');
if (search) {
search.addEventListener('input', function(e) {
const apps = document.querySelectorAll('.app');
const regex = new RegExp(e.target.value, 'i');
apps.forEach(function(app) {
const imgTitleContainsRegex = app.querySelector('img').title.search(regex) !== -1;
const descriptionContainsRegex = app.querySelector('p').innerText.search(regex) !== -1;
if (imgTitleContainsRegex || descriptionContainsRegex) {
// app name is in search
if (app.classList.contains('d-none')) {
app.classList.remove('d-none');
}
} else if (!app.classList.contains('d-none')) {
app.classList.add('d-none');
}
});
const categories = document.querySelectorAll('.category');
categories.forEach(function(category) {
const hasVisibleApps = category.querySelectorAll('.applications .app:not(.d-none)').length > 0;
const hasVisibleAddons = category.querySelectorAll('.addons .app:not(.d-none)').length > 0;
const appsTitle = category.querySelector('.applications-title');
if (appsTitle) {
if (hasVisibleApps && appsTitle.classList.contains('d-none')) {
appsTitle.classList.remove('d-none');
} else if (!hasVisibleApps && !appsTitle.classList.contains('d-none')) {
appsTitle.classList.add('d-none');
}
}
const addonsTitle = category.querySelector('.addons-title');
if (addonsTitle) {
if (addonsTitle && hasVisibleAddons && addonsTitle.classList.contains('d-none')) {
addonsTitle.classList.remove('d-none');
} else if (addonsTitle && !hasVisibleAddons && !addonsTitle.classList.contains('d-none')) {
addonsTitle.classList.add('d-none');
}
}
if ((hasVisibleApps || hasVisibleAddons) && category.classList.contains('d-none')) {
category.classList.remove('d-none');
} else if (!(hasVisibleApps || hasVisibleAddons) && !category.classList.contains('d-none')) {
category.classList.add('d-none');
}
});
});
}
const unmaintainedCollapsible = document.getElementById('unmaintained-collapse-link');
if (unmaintainedCollapsible) {
var observerCollapse = new MutationObserver(function(mutations) {
for (let mutation of mutations) {
if (mutation.type === 'attributes') {
const icon = unmaintainedCollapsible.querySelector('i');
if (!mutation.oldValue) {
icon.classList.add('icon_expand-all');
icon.classList.remove('icon_collapse-all');
} else if (mutation.oldValue === "collapsed") {
icon.classList.add('icon_collapse-all');
icon.classList.remove('icon_expand-all');
}
}
}
});
observerCollapse.observe(unmaintainedCollapsible, {
attributes: true,
attributeFilter: ['class'],
attributeOldValue: true,
childList: false,
characterData: false
});
}
/*
* SPDX-FileCopyrightText: 2020 (c) Carl Schwan <carl@carlschwan.eu>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
/**
* Used for kde.org/applications
*/
/* Application pages */
@import "components/swiper";
h1 a:after {
margin: 0px 5px;
color: #6F8181;
content: ">";
font-family: "glyph";
font-size: 60%;
vertical-align: middle;
}
.app-icon {
float: left;
}
.app-screenshot {
clear: left;
text-align: center;
}
.infobox:not(:first-child) {
padding-top: 15px;
}
#infobox-return img, .header-image {
margin: 0 5px 0 0 !important;
padding: 0 !important;
border: 0 !important;
background-image: none !important;
}
.app-category, .international-site {
display: table-cell;
float: left;
max-width: 240px;
width: 240px;
height: 60px;
max-height: 60px !important;
text-align: left;
}
.app-category img, .international-site img {
margin: 0 10px 0 0 !important;
float: left;
}
.app-category a, .international-site a {
font-size: 12pt;
font-weight: 700;
text-decoration: none;
}
.app-screenshot {
max-width: 100%;
}
.international-site {
height: auto !important;
}
.sidebar {
color: #444;
float: right;
min-height: 200px;
padding: 15px;
border-left: 1px solid #CCC;
font-size: 10pt;
text-align: left;
margin-top: -10px;
}
.application-header {
background-color: rgba(61, 174, 233, 0.1);
}
.application-header h1 {
margin-top: 5px;
}
.unmaintained-header {
background-color: #c0392b;
}
.unmaintained-header p {
color: white;
margin-bottom: 0px;
}
.border-top {
border-top: 1px solid #CCC;
padding-top: 10px;
}
@media (max-width: 768px) {
.sidebar {
border-left: 0 solid black;
border-top: 1px solid #CCC;
}
}
#!/usr/bin/env python3
# SPDX-FileCopyrightText: 2020 Carl Schwan <carl@carlschwan.eu>
#
# SPDX-License-Identifier: MIT
import os
import sys
import polib
if len(sys.argv) < 1:
print("Not enough arguments")
sys.exit()
pot = polib.pofile(sys.argv[1], check_for_duplicates=True)
for entry in pot:
entry.msgstr = ""
pot.save()
#!/usr/bin/env php
<?php
// SPDX-FileCopyrightText: 2020 Carl Schwan <carl@carlschwan.eu>
//
//SPDX-License-Identifier: CC0-1.0
use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\ErrorHandler\Debug;
if (!in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
echo 'Warning: The console should be invoked via the CLI version of PHP, not the '.PHP_SAPI.' SAPI'.PHP_EOL;
}
set_time_limit(0);
require dirname(__DIR__).'/vendor/autoload.php';
if (!class_exists(Application::class)) {
throw new LogicException('You need to add "symfony/framework-bundle" as a Composer dependency.');
}
$input = new ArgvInput();
if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) {
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);
}
if ($input->hasParameterOption('--no-debug', true)) {
putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
}
require dirname(__DIR__).'/config/bootstrap.php';
if ($_SERVER['APP_DEBUG']) {
umask(0000);
if (class_exists(Debug::class)) {
Debug::enable();
}
}
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$application = new Application($kernel);
$application->run($input);
#!/usr/bin/env php
<?php
// SPDX-FileCopyrightText: 2020 Carl Schwan <carl@carlschwan.eu>
//
// SPDX-License-Identifier: CC0-1.0
if (!file_exists(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
exit(1);
}
if (false === getenv('SYMFONY_PHPUNIT_DIR')) {
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
}
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';
{
"type": "project",
"license": "AGPL-3.0-or-later",
"require": {
"php": "^7.2.30",
"ext-ctype": "*",
"ext-dom": "*",
"ext-iconv": "*",
"ext-intl": "*",
"ext-json": "*",
"ext-tokenizer": "*",
"doctrine/annotations": "^1.8",
"ognarb/web-server-bundle": "dev-master",
"symfony/apache-pack": "^1.0",
"symfony/asset": "5.0.*",
"symfony/console": "5.0.*",
"symfony/debug-bundle": "5.0.*",
"symfony/dotenv": "^5.0",
"symfony/flex": "^1.3.1",
"symfony/framework-bundle": "5.0.*",
"symfony/maker-bundle": "^1.14",
"symfony/monolog-bundle": "^3.5",
"symfony/test-pack": "^1.0",
"symfony/translation": "5.0.*",
"symfony/twig-pack": "^1.0",
"symfony/yaml": "5.0.*",
"twig/intl-extra": "^3.0"
},
"require-dev": {
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true,
"platform": {
"php": "7.2.30"
}
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"paragonie/random_compat": "2.*",
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php72": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": "true",
"require": "5.0.*"
}
},
"repositories": [
{
"type": "vcs",
"url": "https://gitlab.com/ognarb/web-server-bundle"
}
]
}
SPDX-FileCopyrightText: 2020 Carl Schwan <carl@carlschwan.eu>
SPDX-License-Identifier: CC0-1.0
\ No newline at end of file
This diff is collapsed.
SPDX-FileCopyrightText: 2020 Carl Schwan <carl@carlschwan.eu>
SPDX-License-Identifier: CC0-1.0
\ No newline at end of file
This diff is collapsed.
<?php
// SPDX-FileCopyrightText: 2020 Carl Schwan <carl@carlschwan.eu>
//
// SPDX-License-Identifier: CC0-1.0
use Symfony\Component\Dotenv\Dotenv;
require dirname(__DIR__).'/vendor/autoload.php';
// Load cached env vars if the .env.local.php file exists
// Run "composer dump-env prod" to create it (requires symfony/flex >=1.2)
if (is_array($env = @include dirname(__DIR__).'/.env.local.php') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) {
foreach ($env as $k => $v) {
$_ENV[$k] = $_ENV[$k] ?? (isset($_SERVER[$k]) && 0 !== strpos($k, 'HTTP_') ? $_SERVER[$k] : $v);
}
} elseif (!class_exists(Dotenv::class)) {
throw new RuntimeException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.');
} else {
// load all the .env files
(new Dotenv(false))->loadEnv(dirname(__DIR__).'/.env');
}
$_SERVER += $_ENV;
$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev';
$_SERVER['APP_DEBUG'] = $_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV'];
$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], FILTER_VALIDATE_BOOLEAN) ? '1' : '0';
<?php
return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
Symfony\Bundle\WebServerBundle\WebServerBundle::class => ['all' => true],
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
];
module:
imports:
- path: invent.kde.org/websites/aether-sass
- path: github.com/thednp/bootstrap.native
replacements: invent.kde.org/websites/aether-sass -> ../../aether-sass
# SPDX-FileCopyrightText: 2020 Carl Schwan <carl@carlschwan.eu>
#
# SPDX-License-Identifier: CC0-1.0
framework:
cache:
# Unique name of your app: used to compute stable namespaces for cache keys.
#prefix_seed: your_vendor_name/app_name
# The "app" cache stores to the filesystem by default.
# The data in this cache should persist between deploys.
# Other options include:
# Redis
#app: cache.adapter.redis
#default_redis_provider: redis://localhost
# APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)
#app: cache.adapter.apcu
# Namespaced pools use the above "app" backend by default
#pools:
#my.dedicated.cache: null
\ No newline at end of file
debug:
# Forwards VarDumper Data clones to a centralized server allowing to inspect dumps on CLI or in your browser.
# See the "server:dump" command to start a new server.
dump_destination: "tcp://%env(VAR_DUMPER_SERVER)%"
monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
channels: ["!event"]
# uncomment to get logging in your browser
# you may have to allow bigger header sizes in your Web server configuration
#firephp:
# type: firephp
# level: info
#chromephp:
# type: chromephp
# level: info
console:
type: console
process_psr_3_messages: false
channels: ["!event", "!doctrine", "!console"]
# SPDX-FileCopyrightText: 2020 Carl Schwan <carl@carlschwan.eu>
#
# SPDX-License-Identifier: CC0-1.0
framework:
secret: '%env(APP_SECRET)%'
#csrf_protection: true
#http_method_override: true
# Enables session support. Note that the session will ONLY be started if you read or write from it.
# Remove or comment this section to explicitly disable session support.
session:
handler_id: null
cookie_secure: auto
cookie_samesite: lax
#esi: true
#fragments: true
php_errors:
log: true
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment