Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	composer.json
  • Loading branch information
bnomei committed Feb 9, 2020
2 parents c2ac97c + c3bd1cb commit 9515d20
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .github/FUNDING.yml
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: bnomei # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
6 changes: 4 additions & 2 deletions readme.md
Expand Up @@ -39,19 +39,21 @@ This plugin is free but if you use it in a commercial project please consider to
In any template or your `header` snippet call the page method right after the tags that should come first.

```diff
<!DOCTYPE html>
- <html>
+ <html <?= site()->attrLang() ?>>
<body>
<head>
- <meta charset="utf-8">
- <meta http-equiv="x-ua-compatible" content="ie=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1 shrink-to-fit=no">
- <base href="<?= site()->url() ?>'">'
- <title><?= $page->title() ?></title>
+ <?= $page->htmlhead() ?>
+ <?= $page->metatags() ?>
+ <?= $page->metaTags(['og', 'twitter', 'json-ld']) ?>
```

> TIP: $page->metatags() is from [pedroborges/kirby-meta-tags](https://github.com/pedroborges/kirby-meta-tags) which you will probably install for OpenGraph, Twitter and JSON-ld. But you will have to set the `title` and `base` option to `null` since htmlhead provides these as well.
> TIP: `$page->metaTags()` is from [pedroborges/kirby-meta-tags](https://github.com/pedroborges/kirby-meta-tags) which you will probably install for OpenGraph, Twitter and JSON-ld. But you will have to either set the `title` and `base` option to `null` in its config or specify which tags to render and omit `title` and `base`.
You can also override any defaults in forwarding the **new or additional** data to the page method.
```php
Expand Down
3 changes: 3 additions & 0 deletions snippets/htmlhead/link-css.php
@@ -1,6 +1,9 @@
<?php
$files = $files ?? [];
foreach ($files as $dep) {
if (strlen(trim($dep)) === 0) {
continue;
}
$options = [];
if (strpos($dep, '|') !== false) {
list($dep, $integrity) = explode('|', $dep);
Expand Down
3 changes: 3 additions & 0 deletions snippets/htmlhead/script-js.php
@@ -1,6 +1,9 @@
<?php
$files = $files ?? [];
foreach ($files as $dep) {
if (strlen(trim($dep)) === 0) {
continue;
}
$options = [];
if (strpos($dep, '|') !== false) {
list($dep, $integrity) = explode('|', $dep);
Expand Down

0 comments on commit 9515d20

Please sign in to comment.