我正在使用 Jekyll 创建博客,为了组织起见,我决定将图像放在文件夹下:“assets/img/[帖子名称]/”。这些文件夹看起来像这样:
\n.\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 assets\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 css\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 BMFW.css\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 vs.css\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 img\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 2021-05-23-Blog-presentation\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 test.jpg <--\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 _config.yml\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 Gemfile\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 Gemfile.lock\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 index.html\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 _layouts\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 layout.html\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 post.html\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 _posts\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 2021-05-23-Blog-presentation.md\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 README.md\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 script\n \xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 cibuild\nRun Code Online (Sandbox Code Playgroud)\n似乎 page.name 变量由于某种原因不存在(我已经用 检查过{{page | inspect}}),所以我使用这一行来获取帖子的名称:
{{ page.path | replace: ".md","" | split: "/" | slice: -1 | }}\nRun Code Online (Sandbox Code Playgroud)\n这意味着如果我想显示一个名为的图像test.jpg我会写:
 我遵循了这个非常简单的指南:https://cloud.google.com/text-to-speech/docs/quickstart-client-libraries ?hl=en
我发现按照 python 的步骤没有问题,但是当我执行示例代码时,出现此错误:
/usr/bin/env /usr/bin/python /home/edoelas/.vscode/extensions/ms-python.python-2021.1.502429796/pythonFiles/lib/python/debugpy/launcher 41413 -- /home/edoelas/git/gsdeck/scripts/generateaudio.py
Traceback (most recent call last):
File "/home/edoelas/.local/lib/python3.9/site-packages/google/api_core/grpc_helpers.py", line 73, in error_remapped_callable
return callable_(*args, **kwargs)
File "/home/edoelas/.local/lib/python3.9/site-packages/grpc/_channel.py", line 923, in __call__
return _end_unary_response_blocking(state, call, False, None)
File "/home/edoelas/.local/lib/python3.9/site-packages/grpc/_channel.py", line 826, in _end_unary_response_blocking
raise _InactiveRpcError(state)
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "Getting metadata from plugin failed with error: ('invalid_grant: Invalid JWT: Token must be a short-lived token (60 minutes) and in a reasonable timeframe. …Run Code Online (Sandbox Code Playgroud)