小编Nat*_*ams的帖子

如何将 font-awesome 与 mjml 一起使用?

我正在尝试实现一个使用带有 mjml 的超棒字体的电子邮件模板,我不知道该怎么做。我尝试使用 cdn 如下:

  <mj-head>
    <mj-title>Thank you!</mj-title>
    <mj-style>
      <mj-include path="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"/>

    </mj-style>
    <mj-attributes>
      ...
    </mj-attributes>
  </mj-head>

...
  <mj-text align="center">
        <h3>              
                 Share <i class="fab fa-facebook-f"></i> 
        </h3>
  </mj-text>
...
Run Code Online (Sandbox Code Playgroud)

但是,这不起作用。任何人都可以建议我如何最好地做到这一点?

html email templates mjml

11
推荐指数
1
解决办法
1612
查看次数

Golang:如何解析/解组/解码json数组API响应?

我试图解析来自维基百科的API的响应https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/en.wikipedia.org/all-access/all-agents/Smithsonian_Institution/daily/20160101/20170101到一个结构数组,我将继续打印视图计数

但是,为了实现这一点,我试图实现的代码在构建和运行时终端中没有返回任何内容?

我未能成功的代码如下.

   type Post struct {
    Project string `json:"project"`
    Article string `json:"article"`
    Granularity string `json:"granularity"`
    Timestamp string `json:"timestamp"`
    Access string `json:"access"`
    Agent string `json:"agent"`
    Views int `json:"views"`
}

func main(){
    //The name of the wikipedia post
    postName := "Smithsonian_Institution"

    //The frequency of
    period := "daily"

    //When to start the selection
    startDate := "20160101"

    //When to end the selection
    endDate := "20170101"

    url := fmt.Sprintf("https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/en.wikipedia.org/all-access/all-agents/%s/%s/%s/%s", postName, period, startDate, endDate)

    //Get from URL
    req, err := http.Get(url)
    if err …
Run Code Online (Sandbox Code Playgroud)

arrays json decoding go unmarshalling

8
推荐指数
2
解决办法
3286
查看次数

标签 统计

arrays ×1

decoding ×1

email ×1

go ×1

html ×1

json ×1

mjml ×1

templates ×1

unmarshalling ×1