当前位置:网站首页>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
边栏推荐
- 【golang从入门到实践】学生成绩管理系统
- 33 introduction to sparksql, dataframe and dataset
- What is the NFT concept.. Fully understand NFT market, technology and cases
- how to add square on screenshot
- Assembly | screen display numbers
- Talk about compilers based on vscode
- Shared lock, exclusive lock, mutex lock, pessimistic lock, optimistic lock, row lock, table lock, page lock, non repeatable read, lost modification, read dirty data
- Hegong sky team vision training Day2 - traditional vision, opencv basic operation
- 学习-用do…while循环按公式e=1+1/1!+1/2!+1/3!+…+1/n!计算 e 的值(精度为 1e-6)
- Case practice - panoramic image mosaic: feature matching method
猜你喜欢

MySQL 啥时候用表锁,啥时候用行锁?

Intelligent robots and intelligent systems (Professor Zheng Zheng of Dalian University of Technology) -- 1. robots and mobile robots
![[target detection] IOU (intersection and combination ratio)](/img/16/d1bd89582e0e04a627e7909eb4f31d.png)
[target detection] IOU (intersection and combination ratio)

Error reported by Nacos: error Nacos failed to start, please see d:\nacos\logs\nacos log for more details.

Function analysis of e-commerce website development and construction

Devops essay

Figure New Earth: how to import CAD files with modified elevation datum (ellipsoid)

My six months at Microsoft

13.Unity2D 横版 可上下左右移动的双向平台(双向行走+可移动+单独判定)+随机平台生成

Do you want to have a robot that can make cartoon avatars in three steps?
随机推荐
Talk about compilers based on vscode
Poj3278 catch the cow
*Yolo5 learning * data experiment based on yolo5 face combined with attention model se
生成模型与判别模型
Do you know the use of string?
Avoid pitfalls and stay away from PUA in the workplace. You need to know the common routines and scripts of PUA!
What is the NFT concept.. Fully understand NFT market, technology and cases
Jetson AgX Orin source change
Function analysis of e-commerce website development and construction
Intelligent robots and intelligent systems (Professor Zheng Zheng of Dalian University of Technology) -- 1. robots and mobile robots
NFT概念究竟是怎么回事。。全面了解NFT市场、技术和案例
News topic classification task -- tochtext library for text classification
Vertex buffer and shader (the cherno + leranopongl) notes
*Project recurrence * project implementation of thesis based on contextbasedemotionrecognitionusingematicdataset
Intelligent robots and intelligent systems (Professor Zheng Zheng of Dalian University of Technology) -- 2. Mobile Robot Perception
MySQL update uses case when to update the value of another field according to the value of one field
Markdown basic grammar learning
MS SQL Server 2019 learning
Learning to track at 100 FPS with deep progression networks
P1305新二叉树题解