Browse Source

Dynamic copyright

master
Lukas Bestle 1 year ago
parent
commit
95e0ff6178
4 changed files with 22 additions and 3 deletions
  1. 1
    1
      content/site.de.txt
  2. 1
    1
      content/site.en.txt
  3. 1
    1
      site/patterns
  4. 19
    0
      site/plugins/copyright.php

+ 1
- 1
content/site.de.txt View File

@@ -6,4 +6,4 @@ Description: codesignd ist Lukas Bestle, ein Backend-Web-Entwickler und Mitglied
6 6
 
7 7
 ----
8 8
 
9
-Copyright: © 2015-2017 Lukas Bestle
9
+Copyright: © (copyright: 2015) Lukas Bestle

+ 1
- 1
content/site.en.txt View File

@@ -6,4 +6,4 @@ Description: codesignd is Lukas Bestle, a backend web developer and member of th
6 6
 
7 7
 ----
8 8
 
9
-Copyright: © 2015-2017 Lukas Bestle
9
+Copyright: © (copyright: 2015) Lukas Bestle

+ 1
- 1
site/patterns

@@ -1 +1 @@
1
-Subproject commit 32645c0414b9750145ec1d6fbd9a60d449c0d27f
1
+Subproject commit a42ea124cc0094fdbaff1350b1dc0490a1924cf5

+ 19
- 0
site/plugins/copyright.php View File

@@ -0,0 +1,19 @@
1
+<?php
2
+
3
+/**
4
+ * copyright Kirbytag
5
+ * 
6
+ * Usage: (copyright: <Copyright begin year>)
7
+ */
8
+kirby()->set('tag', 'copyright', [
9
+	'html' => function($tag) {
10
+		$begin   = $tag->attr('copyright');
11
+		$current = date('Y');
12
+		
13
+		if($begin === $current) {
14
+			return $current;
15
+		} else {
16
+			return $begin . '–' . $current;
17
+		}
18
+	}
19
+]);

Loading…
Cancel
Save