Skip to content

Commit

Permalink
Rename site config file from config.yaml to basildon.yaml
Browse files Browse the repository at this point in the history
Closes #80
  • Loading branch information
samwilson authored Nov 20, 2024
1 parent b61e80a commit fe3f131
Show file tree
Hide file tree
Showing 8 changed files with 169 additions and 140 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ tests/test_site/output/
.idea/
*.code-workspace
.phpunit.result.cache
*config.local.yaml
*basildon.local.yaml
.netlify/
package.json
293 changes: 161 additions & 132 deletions composer.lock

Large diffs are not rendered by default.

File renamed without changes.
2 changes: 1 addition & 1 deletion docs/content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This documentation is also available as [a PDF](basildon-docs.pdf).

## Quick start

Prerequisites: [PHP](https://www.php.net/) (version 7.3 or higher) and [Composer](https://getcomposer.org/).
Prerequisites: [PHP](https://www.php.net/) (version 7.4 or higher) and [Composer](https://getcomposer.org/).

1. `composer create-project samwilson/basildon-skeleton mysite`
2. `cd mysite`
Expand Down
4 changes: 2 additions & 2 deletions docs/content/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ these are explained on this page.
1. `commons(file_name)` – Get information about a [Wikimedia Commons](https://commons.wikimedia.org/) file.
2. `flickr(photo_id)` – Get information about a [Flickr](https://www.flickr.com/) photo.
To use this, you need to set the `flickr.api_key` and `flickr.api_secret` values
in your site's `config.local.yaml` file.
in your site's `basildon.local.yaml` file.
3. `qrcode(text)` – Returns an asset-directory path to a QR code SVG file,
such as `/assets/8a482ae2afb51a1de85b7eb9087f7cc2.svg`.
For example: `<img src="{{ page.link(qrcode('string')) }}" />`
Expand All @@ -36,7 +36,7 @@ these are explained on this page.
5. `wikidata_query(sparql)` — Returns the result of the Sparql query from Wikidata.
See the example in [/example/templates/tag.html.twig](https://github.com/samwilson/basildon/blob/main/example/templates/tag.html.twig).
6. `commons_query(sparql)` — Returns the result of a Sparql query on Wikimedia Commons.
This requires an authentication token to be added to `config.yaml`.
This requires an authentication token to be added to `basildon.yaml`.
Instructions for retrieving this token can be found [on Commons](https://commons.wikimedia.org/wiki/Commons:SPARQL_query_service/API_endpoint),
and an example for how to use the function is in [/example/templates/shortcodes/commons_depicts_count.html.twig](https://github.com/samwilson/basildon/blob/main/example/templates/shortcodes/commons_depicts_count.html.twig).
7. `wikipedia(lang, title)` — Returns an HTML extract of the given article.
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions src/Site.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,16 @@ public function getConfig(): object
return $this->config;
}

// Load config.yaml
$configFile = $this->getDir() . '/config.yaml';
// Load basildon.yaml
$configFile = $this->getDir() . '/basildon.yaml';
if (!file_exists($configFile)) {
$this->config = new stdClass();
return $this->config;
}
$config = file_get_contents($configFile);

// Also load config.local.yaml
$configLocal = $this->getDir() . '/config.local.yaml';
// Also load basildon.local.yaml
$configLocal = $this->getDir() . '/basildon.local.yaml';
if (file_exists($configLocal)) {
$config .= file_get_contents($configLocal);
}
Expand Down
File renamed without changes.

0 comments on commit fe3f131

Please sign in to comment.