File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
websites/code/studygolang/src/service Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -292,6 +292,11 @@ func ParseOneProject(projectUrl string) error {
292
292
return errors .New ("url" + projectUrl + "has exists!" )
293
293
}
294
294
295
+ logoSelection := doc .Find (".Project .PN img" )
296
+ if logoSelection .AttrOr ("title" , "" ) != "" {
297
+ project .Logo = logoSelection .AttrOr ("src" , "" )
298
+ }
299
+
295
300
// 获取项目相关链接
296
301
doc .Find ("#Body .urls li" ).Each (func (i int , liSelection * goquery.Selection ) {
297
302
aSelection := liSelection .Find ("a" )
@@ -343,8 +348,6 @@ func ParseOneProject(projectUrl string) error {
343
348
project .Author = "网友"
344
349
}
345
350
346
- // TODO: logo
347
-
348
351
if project .Doc == "" {
349
352
// TODO:暂时认为一定是 Go 语言
350
353
project .Doc = "https://godoc.org/" + project .Src [8 :]
You can’t perform that action at this time.
0 commit comments