Browse Source

docs(feature/telegram-iv): add support for iv 2.0

Josh Habdas 8 months ago
parent
commit
142963b05d
Signed by: Josh Habdas <jhabdas@protonmail.com> GPG Key ID: B148B31154C75A74

+ 20
- 5
docs/content/feature/telegram-iv.id.md View File

@@ -3,12 +3,15 @@ title = "Instant Views"
3 3
 description = "Preview secara instant konten anda di Telegram."
4 4
 categories = ["social"]
5 5
 tags = ["author", "templating"]
6
-feature = ["related content"]
6
+features = ["related content"]
7 7
 +++
8 8
 
9 9
 After Dark menyediakan panduan templat untuk mengaktifkan Telegram Instant Views untuk postingan. Gunakan itu untuk membuat {{< external href="https://instantview.telegram.org/my/" text="Instant View Template" />}} di situs telegram:
10 10
 
11 11
 ```yaml
12
+# menggunakan 2.0
13
+~version: "2.0"
14
+
12 15
 # aktifkan untuk item di bagian postingan
13 16
 ?path: /post/.+
14 17
 
@@ -16,17 +19,29 @@ After Dark menyediakan panduan templat untuk mengaktifkan Telegram Instant Views
16 19
 title: //*[@itemprop="headline"]
17 20
 body: //*[@itemprop="articleBody"]
18 21
 
22
+# add optional site name and subtitle
23
+subtitle: //*[@itemprop="description"][normalize-space()]
24
+site_name: //*[@itemprop="url"][@href="/"]
25
+
26
+# if author exists, define name and url
27
+?exists: //*[@itemprop="author"]
28
+author: //*[@itemprop="author"]
29
+author_url: //*[@itemprop="url"]/@href
30
+
31
+# add optional telegram channel
32
+channel: //*[@name="telegram:channel"]/@content
33
+
19 34
 # jika cover ada, tentukan gambar
20
-?exists: //head/meta[@property="og:image"]/@content
21
-cover: //head/meta[@property="og:image"]/@content
35
+?exists: //article/meta[@itemprop="image"]/@content
36
+cover: //article/header/figure[@itemprop="image"]
22 37
 image_url: $cover/self::img/@src
23 38
 
24
-# penulis dan data tanggal postingan diekstraksi secara otomatis
39
+# data tanggal postingan diekstraksi secara otomatis
25 40
 ```
26 41
 
27 42
 Preview hasilnya di situs Telegram :
28 43
 
29
-![Telegram Instant View screenshot](/images/instant-view-fs8.png "Example Telegram Instant View for After Dark")
44
+![Telegram Instant View screenshot](/images/feature-instant-view-fs8.png "Example Telegram Instant View for After Dark")
30 45
 
31 46
 Selain itu, jika situs anda memiliki saluran telegram, anda dapat menentukannya dengan mengatur seperti yang berikut ini di konfigurasi situs anda:
32 47
 

+ 19
- 4
docs/content/feature/telegram-iv.md View File

@@ -9,6 +9,9 @@ features = ["related content"]
9 9
 After Dark provides a template guide to enable Telegram Instant Views for posts. Use it to create an {{< external href="https://instantview.telegram.org/my/" text="Instant View Template" />}} on the Telegram site:
10 10
 
11 11
 ```yaml
12
+# use 2.0
13
+~version: "2.0"
14
+
12 15
 # enable for items in the post section
13 16
 ?path: /post/.+
14 17
 
@@ -16,17 +19,29 @@ After Dark provides a template guide to enable Telegram Instant Views for posts.
16 19
 title: //*[@itemprop="headline"]
17 20
 body: //*[@itemprop="articleBody"]
18 21
 
22
+# add optional site name and subtitle
23
+subtitle: //*[@itemprop="description"][normalize-space()]
24
+site_name: //*[@itemprop="url"][@href="/"]
25
+
26
+# if author exists, define name and url
27
+?exists: //*[@itemprop="author"]
28
+author: //*[@itemprop="author"]
29
+author_url: //*[@itemprop="url"]/@href
30
+
31
+# add optional telegram channel
32
+channel: //*[@name="telegram:channel"]/@content
33
+
19 34
 # if cover exists, define images
20
-?exists: //head/meta[@property="og:image"]/@content
21
-cover: //head/meta[@property="og:image"]/@content
35
+?exists: //article/meta[@itemprop="image"]/@content
36
+cover: //article/header/figure[@itemprop="image"]
22 37
 image_url: $cover/self::img/@src
23 38
 
24
-# author and post date extracted automatically
39
+# post date extracted automatically
25 40
 ```
26 41
 
27 42
 Preview your results on the Telegram site:
28 43
 
29
-![Telegram Instant View screenshot](/images/instant-view-fs8.png "Example Telegram Instant View for After Dark")
44
+![Telegram Instant View screenshot](/images/feature-instant-view-fs8.png "Example Telegram Instant View for After Dark")
30 45
 
31 46
 Additionally, if your site has a telegram channel, you can specify it by setting the following in your site config:
32 47
 

BIN
docs/static/images/feature-instant-view-fs8.png View File


BIN
docs/static/images/instant-view-fs8.png View File


Loading…
Cancel
Save