From 84f756b79d4706647b2b69e058fb7d4a1b71907b Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Wed, 4 Apr 2018 19:52:41 +0200 Subject: [PATCH 1/3] Improve SEO --- build_docs.php | 3 ++- src/danog/MadelineProto/DocsBuilder.php | 19 +++++++++++++++++++ .../DocsBuilder/Constructors.php | 2 ++ .../MadelineProto/DocsBuilder/Methods.php | 3 +++ 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/build_docs.php b/build_docs.php index a2a8e236..1fd109c0 100755 --- a/build_docs.php +++ b/build_docs.php @@ -19,7 +19,8 @@ set_error_handler(['\danog\MadelineProto\Exception', 'ExceptionErrorHandler']); file_put_contents('docs/docs/index.md', '--- title: MadelineProto documentation -description: PHP implementation of telegram\'s MTProto protocol +description: PHP client/server for the telegram MTProto protocol (a better tg-cli) +image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png --- '.str_replace('index, '--- title: '.$this->settings['title'].' description: '.$this->settings['description'].' +image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png --- # '.$this->settings['description'].' @@ -109,6 +110,7 @@ description: '.$this->settings['description'].' $header = '--- title: '.$type.' description: constructors and methods of type '.$type.' +image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png --- ## Type: '.str_replace('_', '\\_', $type).' [Back to types index](index.md) @@ -418,6 +420,7 @@ After modifying it, you must always parse the new configuration with a call to ` file_put_contents('types/'.$this->index, '--- title: Types description: List of types +image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png --- # Types [Back to API documentation index](..) @@ -428,6 +431,7 @@ description: List of types file_put_contents('types/string.md', '--- title: string description: A UTF8 string of variable length +image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png --- ## Type: string [Back to constructor index](index.md) @@ -437,6 +441,7 @@ A UTF8 string of variable length. The total length in bytes of the string must n file_put_contents('types/bytes.md', '--- title: bytes description: A string of variable length +image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png --- ## Type: bytes [Back to constructor index](index.md) @@ -446,6 +451,7 @@ A string of bytes of variable length, with length smaller than or equal to 16777 file_put_contents('types/int.md', '--- title: integer description: A 32 bit signed integer ranging from -2147483648 to 2147483647 +image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png --- ## Type: int [Back to constructor index](index.md) @@ -455,6 +461,7 @@ A 32 bit signed integer ranging from `-2147483648` to `2147483647`. file_put_contents('types/int53.md', '--- title: integer description: A 53 bit signed integer +image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png --- ## Type: int53 [Back to constructor index](index.md) @@ -464,6 +471,7 @@ A 53 bit signed integer. file_put_contents('types/long.md', '--- title: long description: A 32 bit signed integer ranging from -9223372036854775808 to 9223372036854775807 +image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png --- ## Type: long [Back to constructor index](index.md) @@ -473,6 +481,7 @@ A 64 bit signed integer ranging from `-9223372036854775808` to `9223372036854775 file_put_contents('types/int128.md', '--- title: int128 description: A 128 bit signed integer +image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png --- ## Type: int128 [Back to constructor index](index.md) @@ -482,6 +491,7 @@ A 128 bit signed integer represented in little-endian base256 (`string`) format. file_put_contents('types/int256.md', '--- title: int256 description: A 256 bit signed integer +image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png --- ## Type: int256 [Back to constructor index](index.md) @@ -491,6 +501,7 @@ A 256 bit signed integer represented in little-endian base256 (`string`) format. file_put_contents('types/int512.md', '--- title: int512 description: A 512 bit signed integer +image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png --- ## Type: int512 [Back to constructor index](index.md) @@ -500,6 +511,7 @@ A 512 bit signed integer represented in little-endian base256 (`string`) format. file_put_contents('types/double.md', '--- title: double description: A double precision floating point number +image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png --- ## Type: double [Back to constructor index](index.md) @@ -509,6 +521,7 @@ A double precision floating point number, single precision can also be used (flo file_put_contents('types/!X.md', '--- title: !X description: Represents a TL serialized payload +image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png --- ## Type: !X [Back to constructor index](index.md) @@ -518,6 +531,7 @@ Represents a TL serialized payload. file_put_contents('types/X.md', '--- title: X description: Represents a TL serialized payload +image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png --- ## Type: X [Back to constructor index](index.md) @@ -527,6 +541,7 @@ Represents a TL serialized payload. file_put_contents('constructors/boolFalse.md', '--- title: boolFalse description: Represents a boolean with value equal to false +image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png --- # boolFalse [Back to constructor index](index.md) @@ -536,6 +551,7 @@ description: Represents a boolean with value equal to false file_put_contents('constructors/boolTrue.md', '--- title: boolTrue description: Represents a boolean with value equal to true +image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png --- # boolTrue [Back to constructor index](index.md) @@ -545,6 +561,7 @@ Represents a boolean with value equal to `true`. file_put_contents('constructors/null.md', '--- title: null description: Represents a null value +image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png --- # null [Back to constructor index](index.md) @@ -554,6 +571,7 @@ Represents a `null` value. file_put_contents('types/Bool.md', '--- title: Bool description: Represents a boolean. +image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png --- # Bool [Back to types index](index.md) @@ -563,6 +581,7 @@ Represents a boolean. file_put_contents('types/DataJSON.md', '--- title: DataJSON description: Any json-encodable data +image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png --- ## Type: DataJSON [Back to constructor index](index.md) diff --git a/src/danog/MadelineProto/DocsBuilder/Constructors.php b/src/danog/MadelineProto/DocsBuilder/Constructors.php index 25976b5d..781d33e3 100644 --- a/src/danog/MadelineProto/DocsBuilder/Constructors.php +++ b/src/danog/MadelineProto/DocsBuilder/Constructors.php @@ -178,6 +178,7 @@ trait Constructors $header = '--- title: '.$data['predicate'].' description: '.$description.' +image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png --- ## Constructor: '.str_replace('_', '\\_', $data['predicate'].$layer).' [Back to constructors index](index.md) @@ -280,6 +281,7 @@ MadelineProto supports all html entities supported by [html_entity_decode](http: file_put_contents('constructors/'.$this->index, '--- title: Constructors description: List of constructors +image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png --- # Constructors [Back to API documentation index](..) diff --git a/src/danog/MadelineProto/DocsBuilder/Methods.php b/src/danog/MadelineProto/DocsBuilder/Methods.php index c3361318..af4b200d 100644 --- a/src/danog/MadelineProto/DocsBuilder/Methods.php +++ b/src/danog/MadelineProto/DocsBuilder/Methods.php @@ -171,6 +171,7 @@ trait Methods $header = '--- title: '.$data['method'].' description: '.$description.' +image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png --- ## Method: '.str_replace('_', '\\_', $data['method']).' [Back to methods index](index.md) @@ -324,6 +325,7 @@ MadelineProto supports all html entities supported by [html_entity_decode](http: file_put_contents('methods/api_'.$this->index, '--- title: Methods description: List of methods +image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png --- # Methods [Back to API documentation index](..) @@ -361,6 +363,7 @@ $MadelineProto->[request_secret_chat](https://docs.madelineproto.xyz/request_sec file_put_contents('methods/'.$this->index, '--- title: Methods description: What do you want to do? +image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png --- # What do you want to do? [Go back to API documentation index](..) From ba6aeafc4cde5ab24cd0f6ef18388c036666fd9c Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Wed, 4 Apr 2018 20:11:59 +0200 Subject: [PATCH 2/3] More SEO improvements --- src/danog/MadelineProto/DocsBuilder.php | 2 +- src/danog/MadelineProto/DocsBuilder/Constructors.php | 2 +- src/danog/MadelineProto/DocsBuilder/Methods.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/danog/MadelineProto/DocsBuilder.php b/src/danog/MadelineProto/DocsBuilder.php index c8ce146a..39cd2984 100644 --- a/src/danog/MadelineProto/DocsBuilder.php +++ b/src/danog/MadelineProto/DocsBuilder.php @@ -112,7 +112,7 @@ title: '.$type.' description: constructors and methods of type '.$type.' image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png --- -## Type: '.str_replace('_', '\\_', $type).' +# Type: '.str_replace('_', '\\_', $type).' [Back to types index](index.md) diff --git a/src/danog/MadelineProto/DocsBuilder/Constructors.php b/src/danog/MadelineProto/DocsBuilder/Constructors.php index 781d33e3..769c65f9 100644 --- a/src/danog/MadelineProto/DocsBuilder/Constructors.php +++ b/src/danog/MadelineProto/DocsBuilder/Constructors.php @@ -180,7 +180,7 @@ title: '.$data['predicate'].' description: '.$description.' image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png --- -## Constructor: '.str_replace('_', '\\_', $data['predicate'].$layer).' +# Constructor: '.str_replace('_', '\\_', $data['predicate'].$layer).' [Back to constructors index](index.md) diff --git a/src/danog/MadelineProto/DocsBuilder/Methods.php b/src/danog/MadelineProto/DocsBuilder/Methods.php index af4b200d..707f1021 100644 --- a/src/danog/MadelineProto/DocsBuilder/Methods.php +++ b/src/danog/MadelineProto/DocsBuilder/Methods.php @@ -173,7 +173,7 @@ title: '.$data['method'].' description: '.$description.' image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png --- -## Method: '.str_replace('_', '\\_', $data['method']).' +# Method: '.str_replace('_', '\\_', $data['method']).' [Back to methods index](index.md) From 3c49ff09e8a7a77728924a7ad01e91b4cc3112b1 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Wed, 4 Apr 2018 20:13:20 +0200 Subject: [PATCH 3/3] Update docs submodule --- docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs b/docs index 4f9438b1..91641122 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 4f9438b1c1b270d36a89862c398f932230d4b6a5 +Subproject commit 916411226dd921657305ee7c344c870f6800f479