当前位置:网站首页>Detailed explanation of wechat applet page configuration and sitemap configuration parameters
Detailed explanation of wechat applet page configuration and sitemap configuration parameters
2022-07-24 08:10:00 【A snail riding a motorcycle】
Configuration page
app.json Some configurations in , It also supports the configuration of a single page , It can be found on the corresponding page .json File to configure the performance of this page .
The configuration items in the page will be overwritten on the current page app.json The same configuration item in .
The content of the document is a JSON object , It has the following properties :
Configuration item
| attribute | type | The default value is | describe | Minimum version |
|---|---|---|---|---|
| navigationBarBackgroundColor | HexColor | #000000 | Navigation bar background color , Such as #000000 | |
| navigationBarTextStyle | string | white | Navigation bar Title Color , Support only black / white | |
| navigationBarTitleText | string | Navigation bar title text content | ||
| navigationStyle | string | default | Navigation bar style , Only the following values are supported :default Default style custom Custom navigation bar , Just keep the capsule button in the upper right corner . | iOS/Android Wechat client 7.0.0,Windows Wechat client does not support |
| backgroundColor | HexColor | #ffffff | Background color of window | |
| backgroundTextStyle | string | dark | The drop-down loading The style of , Support only dark / light | |
| backgroundColorTop | string | #ffffff | The background color of the top window , only iOS Support | Wechat client 6.5.16 |
| backgroundColorBottom | string | #ffffff | The background color of the bottom window , only iOS Support | Wechat client 6.5.16 |
| enablePullDownRefresh | boolean | false | Whether to open the current page drop-down refresh . See Page.onPullDownRefresh | |
| onReachBottomDistance | number | 50 | Distance from the bottom of the page when the pull-up event is triggered , Unit is px. See Page.onReachBottom | |
| pageOrientation | string | portrait | Screen rotation settings , Support auto / portrait / landscapeSee Respond to changes in the display area | 2.4.0 (auto) / 2.5.0 (landscape) |
| disableScroll | boolean | false | Set to true The whole page cannot scroll up and down .Only valid in page configuration , Cannot be in app.json Set in | |
| usingComponents | Object | no | page Custom components To configure | 1.6.3 |
| initialRenderingCache | string | page Initial render cache To configure , Support static / dynamic | 2.11.1 | |
| style | string | default | Enable new component styles | 2.10.2 |
| singlePage | Object | no | Single page mode related configuration | 2.12.0 |
| restartStrategy | string | homePage | Restart policy configuration | 2.8.0 |
| handleWebviewPreload | string | static | control Time to preload the next page . Support static / manual / auto | 2.15.0 |
| visualEffectInBackground | string | no | When cutting into the background of the system , Hide page content , Protect user privacy . Support hidden / none, If the page is set separately, the global configuration will be overwritten , See Global configuration | 2.15.0 |
| enablePassiveEvent | Object or boolean | no | Whether the event listener is passive, If the page is set separately, the global configuration will be overwritten , See Global configuration | 2.24.1 |
- notes : Not all
app.jsonThe configurations in can be overwritten on the page or specified separately , Only options included in this document . - notes :iOS/Android client 7.0.0 The following versions ,
navigationStyleOnly inapp.jsonEnter into force .
Configuration example
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText": " Wechat interface function demonstration ",
"backgroundColor": "#eeeeee",
"backgroundTextStyle": "light"
}
sitemap To configure
Wechat has now opened the search in the applet , Developers can use sitemap.json To configure , Or manage the background page collection switch to configure whether wechat index is allowed for its applet page . When developers allow wechat indexing , Wechat will take the form of a crawler , Index the page content of the applet . When the user's search term triggers the index , The page of the applet will probably be displayed in the search results . When a crawler visits a page in an applet , Will carry specific user-agent:mpcrawler And Scene value :1129. It should be noted that , If the page data found by the app crawler is inconsistent with the real user's presentation , Then the page will not enter the index .
In the applet root directory sitemap.json This file is used to configure whether the applet and its page can be indexed by wechat , The content of the document is a JSON object , without sitemap.json , All pages are allowed to be indexed by default ;sitemap.json It has the following properties :
Configuration item
| attribute | type | Required | describe |
|---|---|---|---|
| rules | Object[] | yes | Index rule list |
rules
rules The configuration item specifies the index rule , Each rule is a JSON object , Properties are shown below :
| attribute | type | Required | The default value is | Value | Value description |
|---|---|---|---|---|---|
| action | string | no | "allow" | "allow"、"disallow" | Whether the pages that hit the rule can be indexed |
| page | string | yes | "*"、 The path of the page | * Represents all pages , Cannot be used as a wildcard | |
| params | string[] | no | [] | When page The list of page parameter names that may be used when the page specified by the field is matched by this rule ( Without parameter value ) | |
| matching | string | no | "inclusive" | Reference resources matching Value description | When page When the page specified in the field is matched by this rule , This parameter describes params How to match |
| priority | Number | no | priority , The larger the value, the earlier the rule is matched , Otherwise, it will match from top to bottom by default |
matching Value description
| value | explain |
|---|---|
| exact | When the parameter list of the applet page is equal to params when , Rules hit |
| inclusive | When the parameter list of the applet page contains params when , Rules hit |
| exclusive | When the parameter list of the applet page is different from params When the intersection is empty , Rules hit |
| partial | When the parameter list of the applet page is different from params When the intersection is not empty , Rules hit |
Configuration example
Example 1
{
"rules":[{
"action": "allow",
"page": "path/to/page",
"params": ["a", "b"],
"matching": "exact"
}, {
"action": "disallow",
"page": "path/to/page"
}]
}
path/to/page?a=1&b=2=> Priority indexpath/to/page=> Not indexedpath/to/page?a=1=> Not indexedpath/to/page?a=1&b=2&c=3=> Not indexed- Other pages will be indexed
Example 2
{
"rules":[{
"action": "allow",
"page": "path/to/page",
"params": ["a", "b"],
"matching": "inclusive"
}, {
"action": "disallow",
"page": "path/to/page"
}]
}
path/to/page?a=1&b=2=> Priority indexpath/to/page?a=1&b=2&c=3=> Priority indexpath/to/page=> Not indexedpath/to/page?a=1=> Not indexed- Other pages will be indexed
Example 3
{
"rules":[{
"action": "allow",
"page": "path/to/page",
"params": ["a", "b"],
"matching": "exclusive"
}, {
"action": "disallow",
"page": "path/to/page"
}]
}
path/to/page=> Priority indexpath/to/page?c=3=> Priority indexpath/to/page?a=1=> Not indexedpath/to/page?a=1&b=2=> Not indexed- Other pages will be indexed
Example 4
{
"rules":[{
"action": "allow",
"page": "path/to/page",
"params": ["a", "b"],
"matching": "partial"
}, {
"action": "disallow",
"page": "path/to/page"
}]
}
path/to/page?a=1=> Priority indexpath/to/page?a=1&b=2=> Priority indexpath/to/page=> Not indexedpath/to/page?c=3=> Not indexed- Other pages will be indexed
notes : No, sitemap.json All pages can be indexed by default
notes :{"action": "allow", "page": "*"} Is the default rule with the lowest priority , Not explicitly specified "disallow" Are indexed by default
边栏推荐
- Learn - use do... While loop according to the formula e=1+1/1+ 1/2!+ 1/3!+…+ 1/n! Calculate the value of E (accuracy is 1e-6)
- Generative model and discriminant model
- Jetson AgX Orin source change
- Perceptron and multilayer neural network, back propagation and computational graph
- Uva572 oil deposits problem solution
- mysql使用explain分析sql执行计划帮助查找性能瓶颈
- My six months at Microsoft
- Image feature SIFT (scale invariant feature transform)
- SVM linear separable linear support vector machine
- *Yolo5 learning * data experiment based on yolo5 face combined with attention model CBAM
猜你喜欢

Database system - Basic Concepts

*Yolo5 learning * data experiment based on yolo5 face combined with attention model se

Avoid pitfalls and stay away from PUA in the workplace. You need to know the common routines and scripts of PUA!

Thesis reading: geotransformer

Learning to track at 100 FPS with deep progression networks

Digital twin demonstration project -- Talking about simple pendulum (3) solid model exploration

我在微软的这六个月

FPGA综合项目——图像边缘检测系统

Super simple countdown code writing

nacos报错: ERROR Nacos failed to start, please see D:\nacos\logs\nacos.log for more details.
随机推荐
Markdown basic grammar learning
Thesis reading: geotransformer
Kubernetes:(一)基本概念
Default risk early warning preliminary competition scheme of bond issuing enterprises [AI competition]
how to add square on screenshot
[redis] how much do you know about bloom filter and cuckoo filter?
Talk about compilers based on vscode
MySQL update uses case when to update the value of another field according to the value of one field
The difference between online learning and offline learning
MySQL -- subquery scalar subquery
Project practice - document scanning OCR recognition
Devops essay
NFT是什么?一篇文章搞懂NFT的概念
P3916图的遍历 题解
P1135 strange elevator problem solution
Summary of study notes (I)
Learning dynamic Siamese network for visual object tracking full text translation
45. Jumping game II
Anaconda cannot shut down the method of forced shutdown
UVA572油田 Oil Deposits题解