目前我在为gatsby-starter-blog生成sitemap.xml时遇到问题。 http://localhost:8000/sitemap.xml仍未找到。
我现在在做什么:
<div class="form-group"> @Html.LabelFor(model => model.Gender, htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.DropDownList("Gender", new List<SelectListItem> { new SelectListItem { Text="Male", Value="Male" }, new SelectListItem { Text="Female", Value="Female"} }, "Select Gender") @* new { htmlAttributes = new { @class = "form-control" } })*@ @Html.ValidationMessageFor(model => model.Gender, "", new { @class = "text-danger" }) </div> </div> <div class="form-group"> @Html.LabelFor(model => model.City, htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.EditorFor(model => model.City, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.City, "", new { @class = "text-danger" }) </div> </div>
siteMetadata: { siteUrl: 'http://www.localhost:8000', }, plugins: [ { resolve: 'gatsby-plugin-sitemap', }, ]
答案 0 :(得分:1)
onPostBuild
仅在构建过程中被调用,而不是开发,看起来你还没有运行。尝试运行gatsby build
,然后运行onPostBuild
实施。