MKDOCS素材主题搜索功能不起作用 [英] MKDOCS Material theme Search capability not working

查看:47
本文介绍了MKDOCS素材主题搜索功能不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立了一个以材料"为主题的MKDOCS网站,并使用Azure Web App对其进行托管.该网站可以在本地主机上完美运行,但是在Azure Web应用程序上,搜索栏不起作用.当您将光标放在搜索字段中时,它将显示正在初始化搜索".我尝试将其添加到.yaml文件中,但未能解决问题:

I set up an MKDOCS site with the 'material' theme and am hosting it using an Azure Web App. The site works perfectly on the local host, but on Azure web app, the search bar doesn't work. It shows 'Initializing search' when you put the cursor in the search field. I tried adding this to the .yaml file, and it did not fix the issue:

plugins:
    - search:
        lang: en

我正在使用MKDOCS 1.1.2和材料6.2.8

I am using MKDOCS 1.1.2 and material 6.2.8

推荐答案

我在Github上找到了解决方法: https://github.com/mkdocs/mkdocs/issues/1468

I found the fix on Github: https://github.com/mkdocs/mkdocs/issues/1468

创建一个web.config文件并将其发布到服务器上的WWW根目录.

Create a web.config file and post it to the WWW root on the server.

<?xml version="1.0" encoding="UTF-8"?>
  <configuration>
    <system.webServer>
      <staticContent>
        <mimeMap fileExtension=".json" mimeType="application/json" />
      </staticContent>
    </system.webServer>
  </configuration>

这篇关于MKDOCS素材主题搜索功能不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆