Skip to content

Commit

Permalink
fix: 🐛 verify if values not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikael-R committed Oct 30, 2021
1 parent ca76892 commit f34c493
Showing 1 changed file with 28 additions and 18 deletions.
46 changes: 28 additions & 18 deletions src/templates/README.md.ejs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<% if (props.badges.exists) { %>
<% if (props.badges.exists('gitpod')) {%><%= `[![Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#${props.githubRepository.url})`%><% } %>
<% if (props.badges.exists('heroku')) {%><%= `[![Heroku](https://img.shields.io/badge/CI-%E2%9C%93-green.svg?logo=heroku&colorA=79589f&logoColor=white&style=flat-square)](${props.herokuUrl})` %><% } %> <% if (props.badges.exists('repl.it')) {%><%= `[![Repl.it](https://repl.it/badge/github/${props.githubRepository.author}/${props.githubRepository.name})](${props.replitUrl})` %><% } %>
Expand All @@ -9,7 +10,7 @@
<% if (props.badges.exists('repositorysocialstatus')) {%><%= `[![Forks](https://img.shields.io/github/forks/${props.githubRepository.author}/${props.githubRepository.name}?style=social)](${props.githubRepository.url}/network/members) [![Stars](https://img.shields.io/github/stars/${props.githubRepository.author}/${props.githubRepository.name}?style=social)](${props.githubRepository.url}/stargazers) [![Watches](https://img.shields.io/github/watchers/${props.githubRepository.author}/${props.githubRepository.name}?style=social)](${props.githubRepository.url}/watchers)` %><% } %>
<% if (props.badges.exists('authortwitter')) {%><%= `[![Author Twitter](https://img.shields.io/twitter/follow/${props.author.twitter}.svg?style=social)](https://twitter.com/${props.author.twitter})`%><% } %>

<% } %>
<h1 id="title" align="center">Welcome to <%= props.projectName %> 👋</h1>

<%- props.status ? `<h4 align="center">🚧 ${props.projectName} in ${props.status}... 🚧</h4>` : '' %>
Expand All @@ -18,37 +19,41 @@

<%- `> ${props.description}`%>

<%= props.githubRepository.api.index.homepage ? `🏡 Home: ${props.githubRepository.api.index.homepage}` : '' %>
<% if (props.githubRepository.api?.index?.homepage) { %>
🏡 Home: <%= props.githubRepository.api.index.homepage %>
<% } %>
<% if (props.images.screenshots.length) {%><%- '<details>\n<summary>Screenshots</summary>\n\n'%><% } %>
<% if (props.images.screenshots?.length) { %>
<details><summary>Screenshots</summary>
<% for (index in props.images.screenshots) {%><%- `<img src="${props.images.screenshots[index]}" alt="screenshot${index}">\n`%><% } %>
<% if (props.images.screenshots.length) {%><%- '</details>'%><% } %>
</details>
<% } %>
### 🔖 Table Of Contents
<%= props.about ? '\n- 📃 [About](#about)' : '' %><%= '\n- 🤔 [How To Use](#how-to-use)' %><%= props.technologies.length ? '\n- 🚀 [Technologies](#technologies)' : '' %><%= props.requirements.length ? '\n- 🌱 [Minimal Requirements](#minimal-requirements)' : '' %><%= props.features.exists ? '\n- 🎊 [Features](#features)' : ''%><%= props.features.finished.length ? '\n¨¨- 🎇 [Finished](#features-finished)' : '' %><%= props.features.pendent.length ? '\n¨¨- 🎆 [Pendent](#features-pendent)' : '' %><%= props.contribute.tutor.show ? '\n- 💡 [How To Contribute](#how-to-contribute)' : '' %><%= props.contribute.contributors.show ? '\n - 🤗 [Contributors](#contributors)' : '' %><%= props.author.exists ? '\n- 👤 [Author](#author)' : '' %><%= props.license.name ? '\n- 🔏 [License](#license)' : '' %>
<%= props.about ? '\n- 📃 [About](#about)' : '' %><%= '\n- 🤔 [How To Use](#how-to-use)' %><%= props.technologies?.length ? '\n- 🚀 [Technologies](#technologies)' : '' %><%= props.requirements?.length ? '\n- 🌱 [Minimal Requirements](#minimal-requirements)' : '' %><%= props.features.exists ? '\n- 🎊 [Features](#features)' : ''%><%= props.features.finished?.length ? '\n¨¨- 🎇 [Finished](#features-finished)' : '' %><%= props.features.pendent?.length ? '\n¨¨- 🎆 [Pendent](#features-pendent)' : '' %><%= props.contribute.tutor?.show ? '\n- 💡 [How To Contribute](#how-to-contribute)' : '' %><%= props.contribute.contributors?.show ? '\n - 🤗 [Contributors](#contributors)' : '' %><%= props.author.exists ? '\n- 👤 [Author](#author)' : '' %><%= props.license.name ? '\n- 🔏 [License](#license)' : '' %>
---
<%- props.about ? `<h2 id="about">📃 About</h2>\n\n${props.about}\n\n[Back To The Top](#title)\n\n---\n` : '' %>
<%- `<h2 id="how-to-use">🤔 How To Use</h2>\n\n${props.howToUse}\n\n[Back To The Top](#title)\n\n---\n`%>
<% if (props.technologies.length) {%><%- '<h2 id="technologies">🚀 Technologies</h2>\n\n'%><% } %>
<% if (props.technologies?.length) {%><%- '<h2 id="technologies">🚀 Technologies</h2>\n\n'%><% } %>
<% for (tech of props.technologies) {%><%= `- ${tech}\n`%><% } %>
<% if (props.technologies.length) {%><%= '\n\n[Back To The Top](#title)\n\n---\n'%><% } %>
<% if (props.technologies?.length) {%><%= '\n\n[Back To The Top](#title)\n\n---\n'%><% } %>
<% if (props.requirements.length) {%><%- '<h2 id="minimal-requirements">🌱 Minimal Requirements</h2>\n\n'%><% } %>
<% if (props.requirements?.length) {%><%- '<h2 id="minimal-requirements">🌱 Minimal Requirements</h2>\n\n'%><% } %>
<% for (requirement of props.requirements) {%><%= `- ${requirement}\n`%><% } %>
<% if (props.requirements.length) {%><%= '\n\n[Back To The Top](#title)\n\n---\n'%><% } %>
<% if (props.requirements?.length) {%><%= '\n\n[Back To The Top](#title)\n\n---\n'%><% } %>
<% if (props.features.finished.length || props.features.pendent.length) {%><%- '<h2 id="features">🎊 Features</h2>\n\n'%><% } %>
<% if (props.features.finished.length) {%><%- '\n<h4 id="features-finished">🎇 Finished</h4>\n'%><% } %>
<% for (featureFinished of props.features.finished) {%><%= `\n- [x] ${featureFinished}`%><% } %>
<% if (props.features.pendent.length) {%><%- '\n<h4 id="features-pendent">🎆 Pendent</h4>\n'%><% } %>
<% for (featurePendent of props.features.pendent) {%><%= `\n- [ ] ${featurePendent}`%><% } %>
<% if (props.features.finished.length || props.features.pendent.length) {%><%- '\n\n[Back To The Top](#title)\n\n---\n'%><% } %>
<% if (props.features.finished?.length || props.features.pendent?.length) {%><%- '<h2 id="features">🎊 Features</h2>\n\n'%><% } %>
<% if (props.features.finished?.length) {%><%- '\n<h4 id="features-finished">🎇 Finished</h4>\n'%><% } %>
<% for (featureFinished of props.features.finished || []) {%><%= `\n- [x] ${featureFinished}`%><% } %>
<% if (props.features.pendent?.length) {%><%- '\n<h4 id="features-pendent">🎆 Pendent</h4>\n'%><% } %>
<% for (featurePendent of props.features.pendent || []) {%><%= `\n- [ ] ${featurePendent}`%><% } %>
<% if (props.features.finished?.length || props.features.pendent?.length) {%><%- '\n\n[Back To The Top](#title)\n\n---\n'%><% } %>
<% if (props.contribute.tutor.show) {%><%- `<h2 id="how-to-contribute">💡 How To Contribute</h2>\n\n
<% if (props.contribute.tutor?.show) {%><%- `<h2 id="how-to-contribute">💡 How To Contribute</h2>\n\n
- Make a fork of this repository
- Clone to you machine and entry on respective paste
- Create a branch with your resource: \`git checkout -b my-feature\`
Expand All @@ -64,10 +69,15 @@
</p>
\n\n[Back To The Top](#title)\n\n---`%><% } %>
<% if (props.contribute.contributors.show) {%><%- `<h2 id="contributors">🤗 Contributors</h2>\n\n\n<p>`%><% } %>
<% if (props.contribute.contributors?.show) { %>
<h2 id="contributors">🤗 Contributors</h2>
<p>
<% for (contributor of props.contribute.contributors.users) {%>
<%- `<a href="${contributor.html_url}"><img width="60px" src="${contributor.avatar_url}" alt="${contributor.login}"/></a>`%><% } %>
<% if (props.contribute.contributors.show) {%><%- `\n\n</p>\n\n\n[Back To The Top](#title)\n\n---`%><% } %>
</p>
[Back To The Top](#title)
<% } %>
<% if (props.author.exists) {%><%- '<h2 id="author">👤 Author</h2>\n\n'%><% } %>
<% if (props.author.name) {%><%- `🤓 **${props.author.name}**\n`%><% } %>
Expand Down

0 comments on commit f34c493

Please sign in to comment.