Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

website: add sponsor section on homepage #1062

Merged
merged 1 commit into from
May 2, 2019
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ data/

website/public/
website/docs-pre-processed/
!website/data
18 changes: 16 additions & 2 deletions docs/contributing/how-to-contribute-to-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,26 @@ Keep `menu` the same as sub-directory the file is in. This will help to manage a

Show new menu section in main page by changing `website/layouts/_default/baseof.html` file.

## Logos
Copy link
Member

Choose a reason for hiding this comment

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

Isn't that too hidden? Just curious how we can make it more searchable. Maybe some hover over logos "Go there " etc?

Copy link
Member

Choose a reason for hiding this comment

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

Ok, let's ignore my comment. It's fine to this being there we can just redirect people if they will aks to be on page (:


If your company is using Thanos in production, we'd love to showcase your company's logo on our page. Add yourself in [`website/data/sponsors.yml`](/website/data/sponsors.yml) like so:

```yml
- name: My Awesome Company
url: https://wwww.company.com
logo: company.png
bwplotka marked this conversation as resolved.
Show resolved Hide resolved
```

Copy your company's logo in `website/static/logos`, and make sure it follows these rules:

* Rectangle shape
* Greyscale is prefered but color is fine
* Keep it under 50KB

## Testing

Every PR is building website and on success it shows the link to preview.

Alternatively you can run `make web-serve` to serve and preview the website locally.

## Deployment.

We use [Netlify](https://www.netlify.com/) for hosting. We are using Open Source license (PRO). Thanks Netlify for this!
Expand Down
3 changes: 3 additions & 0 deletions website/data/sponsors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---

sponsors: []
4 changes: 3 additions & 1 deletion website/layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
{{ template "_default/sidemenu.html" . }}
</div>
<div class="col-12 col-lg-9">
{{ replace .Content "<table>" "<table class='table table-striped'>" | safeHTML }}
{{ $content := replace .Content "<table>" "<table class='table table-striped'>" }}
{{ $content = $content | replaceRE "(<h[1-4] id=\"([^\"]+)\".+)(</h[1-9]+>)" `${1} <a href="#${2}" class="header-anchor" aria-label="Header Anchor">#</a> ${3}` }}
{{ $content | safeHTML}}
</div>
</div>
</div>
Expand Down
33 changes: 32 additions & 1 deletion website/layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,38 @@ <h4 class="font-weight-bold">Downsampling & Compaction</h4>
</div>
</div>
</div>
<div class="container-fluid">
<div class="container py-5">
<div class="row">
<div class="col-12"><h3 class="text-center">Founded by</h3></div>
</div>
<div class="row">
<div class="col-4 col-xl-2 offset-4 offset-xl-5 py-3">
<div class="img-sponsor">
<a href="https://improbable.io" rel="nofollow" target="_blank"><img src="{{ "/logos/improbable.png" | relURL }}" class="img-fluid" alt="Improbable"></a>
</div>
</div>
</div>
<div class="row">
<div class="col-12"><h3 class="text-center">Used by</h3></div>
</div>
<div class="row">
Copy link
Member

Choose a reason for hiding this comment

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

Wow you automated this <3

Can we add link to how-to-contribute-to-docs.md#Logos with message something like "Want to be added to list? Follow this"

Copy link
Member Author

Choose a reason for hiding this comment

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

How about
image ?

Copy link
Member

Choose a reason for hiding this comment

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

Yes! We can drop this when we have lot's of those ? And let's do it just very grey almost transparent?

{{ range $sponsor := $.Site.Data.sponsors.sponsors }}
{{ if $sponsor.logo }}
<div class="col-4 col-xl-2 py-3">
<div class="img-sponsor">
<a href="{{ $sponsor.url }}" rel="nofollow" target="_blank"><img src="{{ (printf "/logos/%s" $sponsor.logo) | relURL }}" alt="{{ $sponsor.name }}"></a>
Copy link
Contributor

Choose a reason for hiding this comment

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

what will happen if the logo is not present? Maybe have a default Thanos image to put there?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a check for the logo property !

</div>
</div>
{{ end }}
{{ end }}
<div class="col-4 col-xl-2 py-3">
<div class="img-sponsor">
<a class="text-muted" href="{{ "contributing/how-to-contribute-to-docs.md#logos" | relURL }}">Your Company</a>
</div>
</div>
</div>
</div>
<div class="container-fluid bg-light">
<div class="row py-5">
<div class="col text-center">
<h3 class="color-purple">Join the community !</h3>
Expand Down
Binary file added website/static/logos/improbable.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 19 additions & 1 deletion website/static/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,22 @@ pre {

.list-group-item-thanos:hover {
color: #6D41FF;
}
}

.img-sponsor {
padding: 1rem;
background-color: #fff;
border: 1px solid #dee2e6;
border-radius: .25rem;
height: 75px;
display: flex;
align-items: center;
justify-content: center;
}

.img-sponsor img {
width: 100%;
}

.header-anchor { font-size: 100%; visibility: hidden;}
h1:hover a, h2:hover a, h3:hover a, h4:hover a { visibility: visible}