我正在尝试实现一个使用带有 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)
但是,这不起作用。任何人都可以建议我如何最好地做到这一点?
我试图解析来自维基百科的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)