{"id":1221,"date":"2026-07-30T12:24:46","date_gmt":"2026-07-30T12:24:46","guid":{"rendered":"https:\/\/blog.nimail.cn\/?p=1221"},"modified":"2026-07-30T12:24:46","modified_gmt":"2026-07-30T12:24:46","slug":"%e5%91%8a%e5%88%ab%e7%bc%a9%e8%bf%9b%e5%b4%a9%e6%ba%83-%e9%ab%98%e6%95%88yaml%e5%9c%a8%e7%ba%bf%e6%a0%bc%e5%bc%8f%e5%8c%96%e4%b8%8e%e5%ae%9e%e6%97%b6%e9%aa%8c%e8%af%81%e6%8c%87%e5%8d%97","status":"publish","type":"post","link":"https:\/\/blog.nimail.cn\/best-articles\/%e5%91%8a%e5%88%ab%e7%bc%a9%e8%bf%9b%e5%b4%a9%e6%ba%83-%e9%ab%98%e6%95%88yaml%e5%9c%a8%e7%ba%bf%e6%a0%bc%e5%bc%8f%e5%8c%96%e4%b8%8e%e5%ae%9e%e6%97%b6%e9%aa%8c%e8%af%81%e6%8c%87%e5%8d%97\/","title":{"rendered":"\u544a\u522b\u7f29\u8fdb\u5d29\u6e83\uff01\u9ad8\u6548YAML\u5728\u7ebf\u683c\u5f0f\u5316\u4e0e\u5b9e\u65f6\u9a8c\u8bc1\u6307\u5357"},"content":{"rendered":"<h2 class=\"text-primary border-bottom pb-2\">\u65e5\u5e38\u5f00\u53d1\u91cc\u7684\u201c\u7a7a\u683c\u9677\u9631\u201d<\/h2>\n<p>\u5199\u914d\u7f6e\u6587\u4ef6\u6700\u6015\u4ec0\u4e48\uff1f\u7edd\u5bf9\u662f\u90a3\u4e2a\u8be5\u6b7b\u7684\u7f29\u8fdb\u3002\u6628\u5929\u6211\u8fd8\u5728\u4e3aK8s\u7684Deployment\u6587\u4ef6\u6293\u72c2\uff0c\u660e\u660e\u4e1a\u52a1\u903b\u8f91\u5b8c\u5168\u6ca1\u95ee\u9898\uff0c<strong>YAML\u89e3\u6790<\/strong>\u5f15\u64ce\u5374\u76f4\u63a5\u629b\u51fa\u7f29\u8fdb\u5f02\u5e38\u3002Tab\u548c\u7a7a\u683c\u7684\u6df7\u7528\uff0c\u6216\u8005\u5c42\u7ea7\u5dee\u4e86\u4e00\u4e2a\u5b57\u7b26\uff0c\u6574\u4e2a\u6587\u6863\u77ac\u95f4\u762b\u75ea\u3002\u8fd9\u65f6\u5019\u5982\u679c\u8fd8\u6307\u671b\u8089\u773c\u53bb\u9010\u884c\u6570\u7a7a\u683c\uff0c\u6548\u7387\u57fa\u672c\u53ef\u4ee5\u5f52\u96f6\uff0c\u751a\u81f3\u53ef\u80fd\u56e0\u4e3a\u8bef\u5220\u6ce8\u91ca\u5bfc\u81f4\u73af\u5883\u53d8\u91cf\u4e22\u5931\u3002<\/p>\n<div class=\"alert alert-warning w-100\"><strong>\u75db\u70b9\u76f4\u51fb\uff1a<\/strong>\u624b\u52a8\u8c03\u6574\u4e0d\u4ec5\u8017\u65f6\uff0c\u8fd8\u6781\u6613\u5f15\u5165\u9690\u853d\u7684\u65b0\u9519\u8bef\u3002\u6211\u4eec\u9700\u8981\u7684\u662f\u4e00\u4e2a\u80fd<strong>\u63d0\u4f9bYAML\u6570\u636e\u68c0\u6d4b<\/strong>\u3001\u77ac\u95f4\u7406\u6e05\u590d\u6742\u5c42\u7ea7\u5173\u7cfb\u7684<strong>YAML\u7f16\u8f91\u5668<\/strong>\u6216\u9ad8\u6548\u7684<strong>YAML\u5728\u7ebf\u5de5\u5177<\/strong>\u3002<\/div>\n<p>\u6700\u8fd1\u6211\u5728\u91cd\u6784\u5fae\u670d\u52a1\u90e8\u7f72\u811a\u672c\u65f6\uff0c\u53d1\u73b0\u4e86\u4e00\u6b3e\u975e\u5e38\u987a\u624b\u7684<span class=\"badge bg-success\">YAML\u5728\u7ebf\u683c\u5f0f\u5316<\/span>\u5e73\u53f0\uff1a<code>https:\/\/www.nimail.cn\/dev-tool\/yaml-format.html<\/code>\u3002\u5b83\u6ca1\u6709\u82b1\u91cc\u80e1\u54e8\u7684\u5e7f\u544a\u5f39\u7a97\uff0c\u6838\u5fc3\u529f\u80fd\u5168\u805a\u7126\u5728<strong>yaml\u683c\u5f0f\u5316<\/strong>\u548c<strong>YAML\u9a8c\u8bc1<\/strong>\u4e0a\u3002\u7c98\u8d34\u8fdb\u53bb\u7684\u4ee3\u7801\uff0c\u4e0d\u5230\u4e00\u79d2\u5c31\u80fd\u5b8c\u6210\u6392\u7248\uff0c\u5c42\u7ea7\u5173\u7cfb\u4e00\u76ee\u4e86\u7136\u3002\u5bf9\u4e8e\u7ecf\u5e38\u9700\u8981\u8de8\u5e73\u53f0\u534f\u4f5c\u7684\u56e2\u961f\u6765\u8bf4\uff0c\u8fd9\u79cd\u514d\u5b89\u88c5\u7684\u8f7b\u91cf\u7ea7\u65b9\u6848\u7b80\u76f4\u662f\u6551\u661f\u3002<\/p>\n<h3 class=\"mt-4 text-dark fw-bold\">\u81ea\u52a8\u5316\u6e05\u6d17\u4e0e\u7cbe\u51c6\u6392\u9519<\/h3>\n<p>\u5f88\u591a\u5f00\u53d1\u8005\u4e60\u60ef\u672c\u5730\u914d\u4e2aVS Code\u63d2\u4ef6\uff0c\u4f46\u4e34\u65f6\u6539\u4e2a\u811a\u672c\u53c2\u6570\u6216\u8005\u5728\u516c\u53f8\u516c\u7528\u7535\u8111\u64cd\u4f5c\u65f6\uff0c\u6d4f\u89c8\u5668\u7aef\u7684\u901f\u5ea6\u4f18\u52bf\u5c31\u51fa\u6765\u4e86\u3002\u8fd9\u4e2a<strong>YAML\u5728\u7ebf\u683c\u5f0f\u5316\u9a8c\u8bc1\u5de5\u5177<\/strong>\u6700\u8ba9\u6211\u60ca\u559c\u7684\u662f\u5b83\u7684<strong>\u8bed\u6cd5\u9519\u8bef\u5b9a\u4f4d<\/strong>\u80fd\u529b\u3002\u4ee5\u524d\u62a5\u9519\u53ea\u663e\u793a\u201cLine 45\u201d\uff0c\u73b0\u5728\u5b83\u4f1a\u76f4\u63a5\u7528\u9192\u76ee\u7684\u6807\u8bb0\u6807\u51fa\u5177\u4f53\u504f\u79fb\u91cf\uff0c\u751a\u81f3\u667a\u80fd\u63d0\u793a\u7f3a\u5931\u7684\u5192\u53f7\u3001\u9519\u8bef\u7684\u5e03\u5c14\u503c\u7c7b\u578b\u6216\u8005\u672a\u95ed\u5408\u7684\u5f15\u53f7\u3002\u8fd9\u79cd\u9897\u7c92\u5ea6\u7684\u53cd\u9988\uff0c\u76f4\u63a5\u628aDebug\u65f6\u95f4\u538b\u7f29\u4e86\u4e00\u534a\u3002<\/p>\n<table class=\"table table-striped table-bordered mt-3 w-100\" style=\"width:100%;max-width:100%;\">\n<thead class=\"table-light\">\n<tr>\n<th>\u4f20\u7edf\u624b\u5199\u6a21\u5f0f<\/th>\n<th>\u73b0\u4ee3\u5728\u7ebf\u8f85\u52a9\u6d41<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u4f9d\u8d56IDE\u9ad8\u4eae\uff0c\u65ad\u7f51\u5373\u76f2\u76d2<\/td>\n<td>\u4e91\u7aef\u5b9e\u65f6\u6e32\u67d3\uff0c\u968f\u65f6\u53ef\u7528<\/td>\n<\/tr>\n<tr>\n<td>\u9519\u8bef\u63d0\u793a\u6a21\u7cca\uff0c\u9760\u731c\u6392\u67e5<\/td>\n<td><strong>\u8bed\u6cd5\u9519\u8bef\u5b9a\u4f4d<\/strong>\u7cbe\u786e\u5230\u884c\u5217<\/td>\n<\/tr>\n<tr>\n<td>\u590d\u5236\u7c98\u8d34\u6613\u5e26\u9690\u85cf\u63a7\u5236\u7b26<\/td>\n<td>\u5185\u7f6e<strong>\u81ea\u52a8\u683c\u5f0f\u5316<\/strong>\u6df1\u5ea6\u6e05\u6d17<\/td>\n<\/tr>\n<tr>\n<td>\u5d4c\u5957\u7ed3\u6784\u6df7\u4e71\u96be\u8ffd\u8e2a<\/td>\n<td>\u6811\u72b6\u89c6\u56fe\u4e00\u952e\u5c55\u5f00\u6298\u53e0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u914d\u5408Python\u505a\u81ea\u52a8\u5316\u8fd0\u7ef4\u7684\u540c\u5b66\u5e94\u8be5\u5f88\u6e05\u695a\uff0c\u5e95\u5c42\u6570\u636e\u4ea4\u6362\u5168\u9760\u5b83\u3002\u4e0b\u9762\u8fd9\u6bb5\u4ee3\u7801\u6f14\u793a\u4e86\u5982\u4f55\u901a\u8fc7\u6807\u51c6\u5e93\u52a0\u8f7d\u5e76\u6821\u9a8c\u914d\u7f6e\uff0c\u5b9e\u9645\u751f\u4ea7\u73af\u5883\u4e2d\uff0c\u6211\u4eec\u901a\u5e38\u4f1a\u5148\u7ecf\u8fc7\u5728\u7ebf\u5de5\u5177\u6e05\u6d17\u518d\u5199\u5165\u78c1\u76d8\uff1a<\/p>\n<pre class=\"bg-light p-3 rounded w-100\" style=\"width:100%;overflow-x:auto;\"><code class=\"language-python\">import yaml\nimport os\n\ndef load_config(path):\n    try:\n        with open(path, 'r', encoding='utf-8') as f:\n            data = yaml.safe_load(f)\n            # \u9a8c\u8bc1\u5fc5\u586b\u5b57\u6bb5\u662f\u5426\u5b58\u5728\n            assert 'database' in data, \"\u7f3a\u5c11\u6838\u5fc3\u914d\u7f6e\u9879\"\n            return data\n    except yaml.YAMLError as err:\n        raise RuntimeError(f\"\u914d\u7f6e\u6587\u4ef6\u89e3\u6790\u5931\u8d25: {err}\")\n    except Exception as e:\n        raise RuntimeError(f\"\u8bfb\u53d6\u5f02\u5e38: {e}\")\n\nconfig = load_config('app.yaml')\nprint(\"\u73af\u5883\u521d\u59cb\u5316\u5b8c\u6210\")<\/code><\/pre>\n<p>\u5728\u5b9e\u9645\u6d41\u6c34\u7ebf\u91cc\uff0c\u6211\u4f1a\u628aCI\u751f\u6210\u7684\u539f\u59cb\u7247\u6bb5\u4e22\u8fdb\u90a3\u4e2a<strong>YAML\u5728\u7ebf\u5de5\u5177<\/strong>\u91cc\u5feb\u901f\u8fc7\u4e00\u904d\u3002\u5b83\u4e0d\u4ec5\u80fd\u5e2e\u4f60<strong>\u63d0\u4f9bYAML\u6570\u636e\u68c0\u6d4b<\/strong>\uff0c\u8fd8\u80fd\u4e00\u952e\u5bfc\u51fa\u6807\u51c6JSON\u6216\u6e05\u7406\u540e\u7684YAML\u5b57\u7b26\u4e32\u3002\u5bf9\u4e8eAnsible Playbook\u6216\u8005Helm Chart\u4e2d\u52a8\u8f84\u51e0\u767e\u884c\u7684\u5d4c\u5957\u7ed3\u6784\uff0c\u8fd9\u79cd\u79d2\u7ea7\u7684<strong>YAML\u9a8c\u8bc1<\/strong>\u6d41\u7a0b\u80fd\u7701\u4e0b\u5927\u91cf\u91cd\u542f\u670d\u52a1\u7684\u8bd5\u9519\u6210\u672c\u3002\u9047\u5230\u6570\u7ec4\u5bf9\u9f50\u6df7\u4e71\u65f6\uff0c\u70b9\u51fb\u4e00\u6b21\u5237\u65b0\uff0c\u6240\u6709\u952e\u503c\u5bf9\u90fd\u4f1a\u4e56\u4e56\u56de\u5230\u6b63\u786e\u4f4d\u7f6e\u3002\u7248\u672c\u63a7\u5236\u63d0\u4ea4\u8bb0\u5f55\u91cc\uff0c\u4e71\u7cdf\u7cdf\u7684\u7f29\u8fdb\u5dee\u5f02\u4f1a\u5236\u9020\u5927\u91cf\u65e0\u610f\u4e49\u7684Merge Conflict\u3002\u7edf\u4e00\u91c7\u7528\u6807\u51c6\u7684\u56db\u7a7a\u683c\u7f29\u8fdb\u89c4\u8303\uff0c\u914d\u5408\u5de5\u5177\u7684<strong>\u81ea\u52a8\u683c\u5f0f\u5316<\/strong>\u62e6\u622a\uff0c\u80fd\u8ba9Git Diff\u53d8\u5f97\u6781\u5176\u5e72\u51c0\u3002\u628a\u91cd\u590d\u6027\u7684\u6392\u7248\u5de5\u4f5c\u4ea4\u7ed9\u7f51\u9875\u7aef\uff0c\u5f00\u53d1\u8005\u624d\u80fd\u628a\u7cbe\u529b\u96c6\u4e2d\u5728\u67b6\u6784\u8bbe\u8ba1\u4e0a\u3002\u4fdd\u6301\u914d\u7f6e\u7684\u6574\u6d01\u5ea6\uff0c\u672c\u8d28\u4e0a\u5c31\u662f\u5728\u964d\u4f4e\u7cfb\u7edf\u7684\u7ef4\u62a4\u71b5\u589e\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6df1\u5165\u63a2\u8ba8YAML\u914d\u7f6e\u7ba1\u7406\u75db\u70b9\uff0c\u63ed\u79d8\u9ad8\u6548YAML\u5728\u7ebf\u683c\u5f0f\u5316\u4e0e\u9a8c\u8bc1\u6280\u5de7\u3002\u901a\u8fc7\u81ea\u52a8\u683c\u5f0f\u5316\u3001\u8bed\u6cd5\u9519\u8bef\u5b9a\u4f4d\u53caPython\u89e3\u6790\u6848\u4f8b\uff0c\u52a9\u60a8\u8f7b\u677e\u9a7e\u9a6dYAML\u5728\u7ebf\u5de5\u5177\uff0c\u544a\u522b\u7f29\u8fdb\u5669\u68a6\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[365,378,363],"class_list":["post-1221","post","type-post","status-publish","format-standard","hentry","category-best-articles","tag-yaml"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.3.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u544a\u522b\u7f29\u8fdb\u5d29\u6e83\uff01\u9ad8\u6548YAML\u5728\u7ebf\u683c\u5f0f\u5316\u4e0e\u5b9e\u65f6\u9a8c\u8bc1\u6307\u5357 - nimail blog<\/title>\n<meta name=\"description\" content=\"\u6df1\u5165\u63a2\u8ba8YAML\u914d\u7f6e\u7ba1\u7406\u75db\u70b9\uff0c\u63ed\u79d8\u9ad8\u6548YAML\u5728\u7ebf\u683c\u5f0f\u5316\u4e0e\u9a8c\u8bc1\u6280\u5de7\u3002\u901a\u8fc7\u81ea\u52a8\u683c\u5f0f\u5316\u3001\u8bed\u6cd5\u9519\u8bef\u5b9a\u4f4d\u53caPython\u89e3\u6790\u6848\u4f8b\uff0c\u52a9\u60a8\u8f7b\u677e\u9a7e\u9a6dYAML\u5728\u7ebf\u5de5\u5177\uff0c\u544a\u522b\u7f29\u8fdb\u5669\u68a6\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.nimail.cn\/best-articles\/\u544a\u522b\u7f29\u8fdb\u5d29\u6e83-\u9ad8\u6548yaml\u5728\u7ebf\u683c\u5f0f\u5316\u4e0e\u5b9e\u65f6\u9a8c\u8bc1\u6307\u5357\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u544a\u522b\u7f29\u8fdb\u5d29\u6e83\uff01\u9ad8\u6548YAML\u5728\u7ebf\u683c\u5f0f\u5316\u4e0e\u5b9e\u65f6\u9a8c\u8bc1\u6307\u5357 - nimail blog\" \/>\n<meta property=\"og:description\" content=\"\u6df1\u5165\u63a2\u8ba8YAML\u914d\u7f6e\u7ba1\u7406\u75db\u70b9\uff0c\u63ed\u79d8\u9ad8\u6548YAML\u5728\u7ebf\u683c\u5f0f\u5316\u4e0e\u9a8c\u8bc1\u6280\u5de7\u3002\u901a\u8fc7\u81ea\u52a8\u683c\u5f0f\u5316\u3001\u8bed\u6cd5\u9519\u8bef\u5b9a\u4f4d\u53caPython\u89e3\u6790\u6848\u4f8b\uff0c\u52a9\u60a8\u8f7b\u677e\u9a7e\u9a6dYAML\u5728\u7ebf\u5de5\u5177\uff0c\u544a\u522b\u7f29\u8fdb\u5669\u68a6\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.nimail.cn\/best-articles\/\u544a\u522b\u7f29\u8fdb\u5d29\u6e83-\u9ad8\u6548yaml\u5728\u7ebf\u683c\u5f0f\u5316\u4e0e\u5b9e\u65f6\u9a8c\u8bc1\u6307\u5357\/\" \/>\n<meta property=\"og:site_name\" content=\"nimail blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-30T12:24:46+00:00\" \/>\n<meta name=\"author\" content=\"\u4e00\u7ebf\u7801\u519c\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u4e00\u7ebf\u7801\u519c\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.nimail.cn\/best-articles\/%e5%91%8a%e5%88%ab%e7%bc%a9%e8%bf%9b%e5%b4%a9%e6%ba%83-%e9%ab%98%e6%95%88yaml%e5%9c%a8%e7%ba%bf%e6%a0%bc%e5%bc%8f%e5%8c%96%e4%b8%8e%e5%ae%9e%e6%97%b6%e9%aa%8c%e8%af%81%e6%8c%87%e5%8d%97\/\",\"url\":\"https:\/\/blog.nimail.cn\/best-articles\/%e5%91%8a%e5%88%ab%e7%bc%a9%e8%bf%9b%e5%b4%a9%e6%ba%83-%e9%ab%98%e6%95%88yaml%e5%9c%a8%e7%ba%bf%e6%a0%bc%e5%bc%8f%e5%8c%96%e4%b8%8e%e5%ae%9e%e6%97%b6%e9%aa%8c%e8%af%81%e6%8c%87%e5%8d%97\/\",\"name\":\"\u544a\u522b\u7f29\u8fdb\u5d29\u6e83\uff01\u9ad8\u6548YAML\u5728\u7ebf\u683c\u5f0f\u5316\u4e0e\u5b9e\u65f6\u9a8c\u8bc1\u6307\u5357 - nimail blog\",\"isPartOf\":{\"@id\":\"https:\/\/blog.nimail.cn\/#website\"},\"datePublished\":\"2026-07-30T12:24:46+00:00\",\"author\":{\"@id\":\"https:\/\/blog.nimail.cn\/#\/schema\/person\/0b0e15eb489135cbe0643e4f5e8839af\"},\"description\":\"\u6df1\u5165\u63a2\u8ba8YAML\u914d\u7f6e\u7ba1\u7406\u75db\u70b9\uff0c\u63ed\u79d8\u9ad8\u6548YAML\u5728\u7ebf\u683c\u5f0f\u5316\u4e0e\u9a8c\u8bc1\u6280\u5de7\u3002\u901a\u8fc7\u81ea\u52a8\u683c\u5f0f\u5316\u3001\u8bed\u6cd5\u9519\u8bef\u5b9a\u4f4d\u53caPython\u89e3\u6790\u6848\u4f8b\uff0c\u52a9\u60a8\u8f7b\u677e\u9a7e\u9a6dYAML\u5728\u7ebf\u5de5\u5177\uff0c\u544a\u522b\u7f29\u8fdb\u5669\u68a6\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/blog.nimail.cn\/best-articles\/%e5%91%8a%e5%88%ab%e7%bc%a9%e8%bf%9b%e5%b4%a9%e6%ba%83-%e9%ab%98%e6%95%88yaml%e5%9c%a8%e7%ba%bf%e6%a0%bc%e5%bc%8f%e5%8c%96%e4%b8%8e%e5%ae%9e%e6%97%b6%e9%aa%8c%e8%af%81%e6%8c%87%e5%8d%97\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.nimail.cn\/best-articles\/%e5%91%8a%e5%88%ab%e7%bc%a9%e8%bf%9b%e5%b4%a9%e6%ba%83-%e9%ab%98%e6%95%88yaml%e5%9c%a8%e7%ba%bf%e6%a0%bc%e5%bc%8f%e5%8c%96%e4%b8%8e%e5%ae%9e%e6%97%b6%e9%aa%8c%e8%af%81%e6%8c%87%e5%8d%97\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.nimail.cn\/best-articles\/%e5%91%8a%e5%88%ab%e7%bc%a9%e8%bf%9b%e5%b4%a9%e6%ba%83-%e9%ab%98%e6%95%88yaml%e5%9c%a8%e7%ba%bf%e6%a0%bc%e5%bc%8f%e5%8c%96%e4%b8%8e%e5%ae%9e%e6%97%b6%e9%aa%8c%e8%af%81%e6%8c%87%e5%8d%97\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/blog.nimail.cn\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u544a\u522b\u7f29\u8fdb\u5d29\u6e83\uff01\u9ad8\u6548YAML\u5728\u7ebf\u683c\u5f0f\u5316\u4e0e\u5b9e\u65f6\u9a8c\u8bc1\u6307\u5357\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.nimail.cn\/#website\",\"url\":\"https:\/\/blog.nimail.cn\/\",\"name\":\"nimail blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blog.nimail.cn\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/blog.nimail.cn\/#\/schema\/person\/0b0e15eb489135cbe0643e4f5e8839af\",\"name\":\"\u4e00\u7ebf\u7801\u519c\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/blog.nimail.cn\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9cabb5645eed3060ef0005d4a179e6422ed56568f78c1b5d2326a4976200739c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9cabb5645eed3060ef0005d4a179e6422ed56568f78c1b5d2326a4976200739c?s=96&d=mm&r=g\",\"caption\":\"\u4e00\u7ebf\u7801\u519c\"},\"sameAs\":[\"http:\/\/blog.nimail.cn\"],\"url\":\"https:\/\/blog.nimail.cn\/author\/longzg\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u544a\u522b\u7f29\u8fdb\u5d29\u6e83\uff01\u9ad8\u6548YAML\u5728\u7ebf\u683c\u5f0f\u5316\u4e0e\u5b9e\u65f6\u9a8c\u8bc1\u6307\u5357 - nimail blog","description":"\u6df1\u5165\u63a2\u8ba8YAML\u914d\u7f6e\u7ba1\u7406\u75db\u70b9\uff0c\u63ed\u79d8\u9ad8\u6548YAML\u5728\u7ebf\u683c\u5f0f\u5316\u4e0e\u9a8c\u8bc1\u6280\u5de7\u3002\u901a\u8fc7\u81ea\u52a8\u683c\u5f0f\u5316\u3001\u8bed\u6cd5\u9519\u8bef\u5b9a\u4f4d\u53caPython\u89e3\u6790\u6848\u4f8b\uff0c\u52a9\u60a8\u8f7b\u677e\u9a7e\u9a6dYAML\u5728\u7ebf\u5de5\u5177\uff0c\u544a\u522b\u7f29\u8fdb\u5669\u68a6\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.nimail.cn\/best-articles\/\u544a\u522b\u7f29\u8fdb\u5d29\u6e83-\u9ad8\u6548yaml\u5728\u7ebf\u683c\u5f0f\u5316\u4e0e\u5b9e\u65f6\u9a8c\u8bc1\u6307\u5357\/","og_locale":"zh_CN","og_type":"article","og_title":"\u544a\u522b\u7f29\u8fdb\u5d29\u6e83\uff01\u9ad8\u6548YAML\u5728\u7ebf\u683c\u5f0f\u5316\u4e0e\u5b9e\u65f6\u9a8c\u8bc1\u6307\u5357 - nimail blog","og_description":"\u6df1\u5165\u63a2\u8ba8YAML\u914d\u7f6e\u7ba1\u7406\u75db\u70b9\uff0c\u63ed\u79d8\u9ad8\u6548YAML\u5728\u7ebf\u683c\u5f0f\u5316\u4e0e\u9a8c\u8bc1\u6280\u5de7\u3002\u901a\u8fc7\u81ea\u52a8\u683c\u5f0f\u5316\u3001\u8bed\u6cd5\u9519\u8bef\u5b9a\u4f4d\u53caPython\u89e3\u6790\u6848\u4f8b\uff0c\u52a9\u60a8\u8f7b\u677e\u9a7e\u9a6dYAML\u5728\u7ebf\u5de5\u5177\uff0c\u544a\u522b\u7f29\u8fdb\u5669\u68a6\u3002","og_url":"https:\/\/blog.nimail.cn\/best-articles\/\u544a\u522b\u7f29\u8fdb\u5d29\u6e83-\u9ad8\u6548yaml\u5728\u7ebf\u683c\u5f0f\u5316\u4e0e\u5b9e\u65f6\u9a8c\u8bc1\u6307\u5357\/","og_site_name":"nimail blog","article_published_time":"2026-07-30T12:24:46+00:00","author":"\u4e00\u7ebf\u7801\u519c","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u4e00\u7ebf\u7801\u519c","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/blog.nimail.cn\/best-articles\/%e5%91%8a%e5%88%ab%e7%bc%a9%e8%bf%9b%e5%b4%a9%e6%ba%83-%e9%ab%98%e6%95%88yaml%e5%9c%a8%e7%ba%bf%e6%a0%bc%e5%bc%8f%e5%8c%96%e4%b8%8e%e5%ae%9e%e6%97%b6%e9%aa%8c%e8%af%81%e6%8c%87%e5%8d%97\/","url":"https:\/\/blog.nimail.cn\/best-articles\/%e5%91%8a%e5%88%ab%e7%bc%a9%e8%bf%9b%e5%b4%a9%e6%ba%83-%e9%ab%98%e6%95%88yaml%e5%9c%a8%e7%ba%bf%e6%a0%bc%e5%bc%8f%e5%8c%96%e4%b8%8e%e5%ae%9e%e6%97%b6%e9%aa%8c%e8%af%81%e6%8c%87%e5%8d%97\/","name":"\u544a\u522b\u7f29\u8fdb\u5d29\u6e83\uff01\u9ad8\u6548YAML\u5728\u7ebf\u683c\u5f0f\u5316\u4e0e\u5b9e\u65f6\u9a8c\u8bc1\u6307\u5357 - nimail blog","isPartOf":{"@id":"https:\/\/blog.nimail.cn\/#website"},"datePublished":"2026-07-30T12:24:46+00:00","author":{"@id":"https:\/\/blog.nimail.cn\/#\/schema\/person\/0b0e15eb489135cbe0643e4f5e8839af"},"description":"\u6df1\u5165\u63a2\u8ba8YAML\u914d\u7f6e\u7ba1\u7406\u75db\u70b9\uff0c\u63ed\u79d8\u9ad8\u6548YAML\u5728\u7ebf\u683c\u5f0f\u5316\u4e0e\u9a8c\u8bc1\u6280\u5de7\u3002\u901a\u8fc7\u81ea\u52a8\u683c\u5f0f\u5316\u3001\u8bed\u6cd5\u9519\u8bef\u5b9a\u4f4d\u53caPython\u89e3\u6790\u6848\u4f8b\uff0c\u52a9\u60a8\u8f7b\u677e\u9a7e\u9a6dYAML\u5728\u7ebf\u5de5\u5177\uff0c\u544a\u522b\u7f29\u8fdb\u5669\u68a6\u3002","breadcrumb":{"@id":"https:\/\/blog.nimail.cn\/best-articles\/%e5%91%8a%e5%88%ab%e7%bc%a9%e8%bf%9b%e5%b4%a9%e6%ba%83-%e9%ab%98%e6%95%88yaml%e5%9c%a8%e7%ba%bf%e6%a0%bc%e5%bc%8f%e5%8c%96%e4%b8%8e%e5%ae%9e%e6%97%b6%e9%aa%8c%e8%af%81%e6%8c%87%e5%8d%97\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.nimail.cn\/best-articles\/%e5%91%8a%e5%88%ab%e7%bc%a9%e8%bf%9b%e5%b4%a9%e6%ba%83-%e9%ab%98%e6%95%88yaml%e5%9c%a8%e7%ba%bf%e6%a0%bc%e5%bc%8f%e5%8c%96%e4%b8%8e%e5%ae%9e%e6%97%b6%e9%aa%8c%e8%af%81%e6%8c%87%e5%8d%97\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.nimail.cn\/best-articles\/%e5%91%8a%e5%88%ab%e7%bc%a9%e8%bf%9b%e5%b4%a9%e6%ba%83-%e9%ab%98%e6%95%88yaml%e5%9c%a8%e7%ba%bf%e6%a0%bc%e5%bc%8f%e5%8c%96%e4%b8%8e%e5%ae%9e%e6%97%b6%e9%aa%8c%e8%af%81%e6%8c%87%e5%8d%97\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/blog.nimail.cn\/"},{"@type":"ListItem","position":2,"name":"\u544a\u522b\u7f29\u8fdb\u5d29\u6e83\uff01\u9ad8\u6548YAML\u5728\u7ebf\u683c\u5f0f\u5316\u4e0e\u5b9e\u65f6\u9a8c\u8bc1\u6307\u5357"}]},{"@type":"WebSite","@id":"https:\/\/blog.nimail.cn\/#website","url":"https:\/\/blog.nimail.cn\/","name":"nimail blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.nimail.cn\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/blog.nimail.cn\/#\/schema\/person\/0b0e15eb489135cbe0643e4f5e8839af","name":"\u4e00\u7ebf\u7801\u519c","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/blog.nimail.cn\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9cabb5645eed3060ef0005d4a179e6422ed56568f78c1b5d2326a4976200739c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9cabb5645eed3060ef0005d4a179e6422ed56568f78c1b5d2326a4976200739c?s=96&d=mm&r=g","caption":"\u4e00\u7ebf\u7801\u519c"},"sameAs":["http:\/\/blog.nimail.cn"],"url":"https:\/\/blog.nimail.cn\/author\/longzg\/"}]}},"_links":{"self":[{"href":"https:\/\/blog.nimail.cn\/wp-json\/wp\/v2\/posts\/1221","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.nimail.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.nimail.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.nimail.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.nimail.cn\/wp-json\/wp\/v2\/comments?post=1221"}],"version-history":[{"count":0,"href":"https:\/\/blog.nimail.cn\/wp-json\/wp\/v2\/posts\/1221\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.nimail.cn\/wp-json\/wp\/v2\/media?parent=1221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.nimail.cn\/wp-json\/wp\/v2\/categories?post=1221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.nimail.cn\/wp-json\/wp\/v2\/tags?post=1221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}