小编edo*_*las的帖子

Jekyll 有没有办法为图像设置基本路径?

我正在使用 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\n
Run Code Online (Sandbox Code Playgroud)\n

似乎 page.name 变量由于某种原因不存在(我已经用 检查过{{page | inspect}}),所以我使用这一行来获取帖子的名称:

\n
{{ page.path | replace: ".md","" | split: "/" | slice: -1 | }}\n
Run Code Online (Sandbox Code Playgroud)\n

这意味着如果我想显示一个名为的图像test.jpg我会写:

\n
![]({{ site.baseurl }}/assets/img/{{ page.path | replace: ".md","" | split: "/" | slice: -1 | …
Run Code Online (Sandbox Code Playgroud)

html blogs jekyll

5
推荐指数
1
解决办法
1868
查看次数

使用 python 在 Deck.gl 中制作 TripsLayer 动画

我在 Deck.gl 网站(这个)中看到了 TripsLayer 示例,它看起来真的很酷。我想完成同样的任务,但使用 pydeck,deck.gl 的 python 绑定。pydeck 网页中的示例(这个)没有动画,我不知道应该如何做才能获得平滑的动画,如 javascript 示例所示。我已经尝试了多种方法(传递列表、函数、具有变化值的变量等),但它们都不起作用,而且我找不到 pydeck 的任何示例。

谢谢!

python gis deck.gl

2
推荐指数
1
解决办法
1970
查看次数

尝试使用谷歌云文本转语音 API 时 JWT 无效

我遵循了这个非常简单的指南: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)

python google-cloud-platform

2
推荐指数
1
解决办法
3256
查看次数

标签 统计

python ×2

blogs ×1

deck.gl ×1

gis ×1

google-cloud-platform ×1

html ×1

jekyll ×1