Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 45 additions & 29 deletions _includes/home_page/articles/articles.html
Original file line number Diff line number Diff line change
@@ -1,34 +1,50 @@
<!-- Research Section -->
<section class="articles-section">
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h2 class="section-heading">近期公众号热门</br>Articles</h2>
</div>
</div>
{% for article in site.data.articles %}
<div class="row">
<div class="container-sm card-item">
<div class="row">
<div class="col-md-4 col-sm-6">
<!-- <a href="#portfolioModal{{ post.modal-id }}" class="portfolio-link" data-toggle="modal"> -->
<img src="img/articles/{{ article.thumbnail }}" class="img-responsive img-centered img-border-radius" alt="">
<!-- </a> -->
</div>
<div class="col-md-8 col-sm-10">
<div class="portfolio-caption">
<a href="{{ article.link }}" target="_blank">
<h3 class="title">{{ article.title }}</h3>
</a>
<h5 class="text-muted">{{ article.description | markdownify }}</h5>
</h5>

<body>
<script>
fetch('https://script.google.com/macros/s/AKfycbxAAClnGBbo_rxRU2jUwmP4WvEadh_IKV9col_FTjpd0vgWX3KldgQMmJEnejzgyf2cQQ/exec')
.then(res => res.json())
.then(data => {
console.log(data);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's remove all logs before deployment

document.getElementById('article-card').innerHTML = data.map(article =>
`<div class="row">
<div class="col-md-4 col-sm-6">
<!-- <a href="#portfolioModal{{ post.modal-id }}" class="portfolio-link" data-toggle="modal"> -->

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's remove unused code as well

<img src=${article[1]} class="img-responsive img-centered img-border-radius" alt="">
<!-- </a> -->
</div>
<div class="col-md-8 col-sm-10">
<div class="portfolio-caption">
<a href=${article[2]} target="_blank">
<h3 class="title" >${article[0]}</h3>
</a>
<h5 class="text-muted">${article[3]}
</h5>
</h5>
</div>
</div>
</div>
</div>`
).join('')

})
</script>

<section class="articles-section">
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h2 class="section-heading">近期公众号热门</br>Articles</h2>
</div>
</div>

<div class="row">
<div class="container-sm card-item" id="article-card">

</div>
</div>
</br>

</div>
</br>
{% endfor %}
</div>
</br>
</section>
</br>
</section>
</body>