Skip to content

Commit

Permalink
chore: update template
Browse files Browse the repository at this point in the history
  • Loading branch information
huantt committed Sep 14, 2023
1 parent 7b0112f commit 0adbdb0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,39 +62,49 @@ jobs:
<table>
<tr>
<td width="300px"><img src="data/images/default-thumbnail.png" alt="thumbnail"></td>
<td width="300px">
<a href="https://dev.to/jacktt/update-your-devto-articles-into-your-github-profile-4dpi"><img src="data/images/default-thumbnail.png" alt="thumbnail"></a>
</td>
<td>
<a href="https://dev.to/jacktt/update-your-devto-articles-into-your-github-profile-4dpi">Update your dev.to articles into your Github profile</a>
<div>In this article, I&#39;ll share you how to update your latest articles on dev.to into your Github...</div>
<div><i>14/09/2023</i></div>
</td>
</tr>
<tr>
<td width="300px"><img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9aLNv3pz--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/urlpgle748e1db4sw81v.png" alt="thumbnail"></td>
<td width="300px">
<a href="https://dev.to/jacktt/creating-dynamic-readmemd-file-388o"><img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9aLNv3pz--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/urlpgle748e1db4sw81v.png" alt="thumbnail"></a>
</td>
<td>
<a href="https://dev.to/jacktt/creating-dynamic-readmemd-file-388o">Creating Dynamic README.md File</a>
<div>This is my Github Profile. The specific thing here is that the weather is updated every 6 hours...</div>
<div><i>09/09/2023</i></div>
</td>
</tr>
<tr>
<td width="300px"><img src="data/images/default-thumbnail.png" alt="thumbnail"></td>
<td width="300px">
<a href="https://dev.to/jacktt/search-goole-like-a-pro-cheat-sheet-555g"><img src="data/images/default-thumbnail.png" alt="thumbnail"></a>
</td>
<td>
<a href="https://dev.to/jacktt/search-goole-like-a-pro-cheat-sheet-555g">Search Goole Like a Pro [Cheat sheet]</a>
<div>Before reading my article, let&#39;s try searching the following input: inurl:/jacktt/ site:dev.to ...</div>
<div><i>30/08/2023</i></div>
</td>
</tr>
<tr>
<td width="300px"><img src="data/images/default-thumbnail.png" alt="thumbnail"></td>
<td width="300px">
<a href="https://dev.to/jacktt/go-build-in-advance-4o8n"><img src="data/images/default-thumbnail.png" alt="thumbnail"></a>
</td>
<td>
<a href="https://dev.to/jacktt/go-build-in-advance-4o8n">Advanced Go Build Techniques</a>
<div>Table of contents Build options Which file will be included Build tags Build contraints ...</div>
<div><i>30/08/2023</i></div>
</td>
</tr>
<tr>
<td width="300px"><img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZviKv8F5--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b5m3kjdhd57zgk0xpcdr.png" alt="thumbnail"></td>
<td width="300px">
<a href="https://dev.to/jacktt/load-private-module-in-golang-project-122l"><img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZviKv8F5--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b5m3kjdhd57zgk0xpcdr.png" alt="thumbnail"></a>
</td>
<td>
<a href="https://dev.to/jacktt/load-private-module-in-golang-project-122l">Load Private Module in Golang Project</a>
<div>Load Private Module in Golang Project Table of Contents I. How Does go get Work? II. How...</div>
Expand All @@ -112,4 +122,4 @@ jobs:
- [Advanced Go Build Techniques](https://dev.to/jacktt/go-build-in-advance-4o8n) - 30/08/2023
- [Load Private Module in Golang Project](https://dev.to/jacktt/load-private-module-in-golang-project-122l) - 12/08/2023
*Updated at: 2023-09-14T06:28:08Z*
*Updated at: 2023-09-14T15:41:40&#43;07:00*
2 changes: 1 addition & 1 deletion cmd/weather.go → cmd/article.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"os"
)

func UpdateWeather(use string) *cobra.Command {
func UpdateArticles(use string) *cobra.Command {
var templateFilePath string
var outputFilePath string
var username string
Expand Down
4 changes: 3 additions & 1 deletion handler/collector/templates/table.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
<table>
{{- range $i, $article := .}}
<tr>
<td width="300px"><img src="{{- if ne $article.Thumbnail ""}}{{ $article.Thumbnail }}{{- else}}{{`data/images/default-thumbnail.png`}}{{- end}}" alt="thumbnail"></td>
<td width="300px">
<a href="{{$article.Url}}"><img src="{{- if ne $article.Thumbnail ""}}{{ $article.Thumbnail }}{{- else}}{{`data/images/default-thumbnail.png`}}{{- end}}" alt="thumbnail"></a>
</td>
<td>
<a href="{{ $article.Url }}">{{ truncateByWords $article.Title 10 }}</a>
<div>{{ $article.Description }}</div>
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func main() {
slog.SetDefault(logger)

root := &cobra.Command{}
root.AddCommand(cmd.UpdateWeather("update-articles"))
root.AddCommand(cmd.UpdateArticles("update-articles"))
err := root.Execute()
if err != nil {
slog.Error(err.Error())
Expand Down

0 comments on commit 0adbdb0

Please sign in to comment.