Skip to content

Commit

Permalink
Merge pull request #133 from natcap/task/update-ug-for-trademark-and-…
Browse files Browse the repository at this point in the history
…branding

Update UG for trademark and NatCap branding
  • Loading branch information
davemfish authored Sep 22, 2023
2 parents 198184f + 2bddcca commit c31e453
Show file tree
Hide file tree
Showing 16 changed files with 150 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ clean:

# files in source/ reference tables from the invest-sample-data repo to avoid duplication
html: $(SOURCEDIR) prep_sampledata
for dir in $(SOURCEDIR)/*/; do \
for dir in $(SOURCEDIR)/[!_]*/; do \
$(SPHINXBUILD) -W \
-b html \
-c $(SOURCEDIR) \
Expand Down
10 changes: 10 additions & 0 deletions source/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% extends '!layout.html' %}

{% block extrahead %}
{{ super() }}
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Source+Serif+4:[email protected]&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,[email protected],700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz@1,8..60&display=swap" rel="stylesheet">
{% endblock %}
7 changes: 6 additions & 1 deletion source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
master_doc = 'index'

# General information about the project.
project = 'InVEST'
project = 'InVEST®'

# configure user-agent to avoid 403 errors on linkcheck
# https://github.com/sphinx-doc/sphinx/issues/7369
Expand Down Expand Up @@ -100,11 +100,14 @@
# Alabaster is the default theme
html_theme = 'alabaster'

html_logo = 'en/index/InVEST_logo_300x300.png'
html_theme_options = {
'analytics_id': 'UA-787904-8',
'fixed_sidebar': True,
'github_user': 'natcap',
'github_repo': 'invest.users-guide',
# Custom fonts are installed in the template file layout.html
'font_family': "'Source Serif 4', serif",
}

html_sidebars = {
Expand All @@ -126,6 +129,8 @@

html_static_path = ['custom.css']

templates_path = ["_templates"]

# -- Internationalization options ---------------------------------------------
locale_dirs = ['locales/']
gettext_compact = False
Expand Down
42 changes: 42 additions & 0 deletions source/custom.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
/* Hide the textual "InVEST" below the icon.
*
* We're supposed to be able to hide it by fiddling with configuration in
* conf.py, but that hasn't worked for me.
* */
div.sphinxsidebar h1.logo {
display: none;
}

/* Center the title on the homepage.
*
* There doesn't appear to be another theme-specific way to do this, so custom
* CSS it is!
* */
div.body section#invest-user-guide h1 {
text-align: center;
}

/* Dark Lagunita Blue, part of Stanford color pallette as of 2023. */
a {
color: #006B81;
}

/* Dark Lagunita Blue, part of Stanford color pallette as of 2023. */
a.reference {
border-bottom: 1px dotted #006B81;
}

/* Cardinal Red, part of Stanford color pallette as of 2023. */
a:hover {
color: #8C1515;
}

/* Process Black, part of Stanford color pallette as of 2023. */
div.sphinxsidebar {
color: #2e2d29;
}

div.body {
color: #2e2d29;
}

.hlist ul li {
list-style-type: none;
}
Expand Down
49 changes: 45 additions & 4 deletions source/en/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,45 @@
contain the root `toctree` directive.
InVEST User Guide
=================
InVEST® User Guide
==================

.. toctree::
:maxdepth: 3

.. figure:: index/header.png

.. figure:: index/main_image.png

.. image:: index/NatCap-Logo-2016-400px.png
:align: center
:scale: 50 %

.. hlist::
:columns: 3

* .. image:: index/Woods_logo_300w.png
:alt: Stanford Woods Institute for the Environment

* .. image:: index/SRC_logo_300w.png
:alt: Stockholm Resilience Centre, Stockholm University

* .. image:: index/TNC_logo_300w.png
:alt: The Nature Conservancy

* .. image:: index/SU_dept_bio_logo_300w.png
:alt: Stanford University Department of Biology

* .. image:: index/IonE_logo_300w.png
:alt: University of Minnesota Institute on the Environment

* .. image:: index/WWF_logo_300w.png
:alt: World Wildlife Fund

* .. image:: index/CAS_logo_300w.png
:alt: Chinese Academy of Sciences

* .. image:: index/RSA_Beijer_logo_300w.png
:alt: Beijer Institute of Ecological Economics, Royal Swedish Academy of Sciences

**Suggested citation**: Natural Capital Project, |commit_year|. InVEST |version|.
Stanford University, University of Minnesota, Chinese Academy
of Sciences, The Nature Conservancy, World Wildlife Fund, Stockholm
Expand Down Expand Up @@ -112,6 +141,18 @@ we may have inadvertently missed someone. If you do not see your name listed
above and think it should be, please contact
[email protected].

Attribution Guidelines
----------------------
When referring to analyses or data products that
were produced with InVEST, please cite the use of InVEST and include a
hyperlink (e.g., This analysis used InVEST :sup:`®` :
https://naturalcapitalproject.stanford.edu/software/invest). The trademark
symbol (:sup:`®`) should be used at the first mention of InVEST. The full citation for
papers, reports, etc. is available above. You are also welcome to use the
`InVEST logo <https://drive.google.com/drive/folders/1LrOIY2LOAwAIqG0uAJEReA6ndFEAGpc_>`_
in line with our
`Trademark and Logo Use Policy <https://naturalcapitalproject.stanford.edu/invest-trademark-and-logo-use-policy>`_ .



Introduction and Getting Started
Expand Down
Binary file added source/en/index/CAS_logo_300w.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/en/index/InVEST_logo_300x300.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/en/index/IonE_logo_300w.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/en/index/NatCap-Logo-2016-400px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/en/index/RSA_Beijer_logo_300w.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/en/index/SRC_logo_300w.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/en/index/SU_dept_bio_logo_300w.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/en/index/TNC_logo_300w.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/en/index/WWF_logo_300w.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/en/index/Woods_logo_300w.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions source/en/index/resample_partner_logo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
"""Resample partner logos to a consistent size, currently 300x300.
The grid of partner institutions on the main index page looks best when we can
guarantee that all of the images are in the partner grid are the same size.
Run this script before committing images and using them in the build.
"""
import math
import sys

from PIL import Image
from PIL import ImageOps

TARGET_WIDTH_PIXELS = 300
TARGET_HEIGHT_PIXELS = 150


def adjust(source_image_path, target_image_path,
target_image_size=(TARGET_WIDTH_PIXELS, TARGET_HEIGHT_PIXELS)):
print(f"Adjusting {source_image_path} --> {target_image_path}")
print(f"Using target image size {target_image_size}")
with Image.open(source_image_path) as im:
# Scale the image so that it's smaller than the target width and height
source_width, source_height = im.size
scale_factor_height = target_image_size[1] / source_height
scale_factor_width = target_image_size[0] / source_width
scaled_image = ImageOps.scale(im, min(scale_factor_height,
scale_factor_width))

# Expand borders with transparency until we get an image of the target
# dimensions.
scaled_width, scaled_height = scaled_image.size
bordered = ImageOps.expand(
scaled_image,
border=(int((target_image_size[0]-scaled_width)/2),
int((target_image_size[1]-scaled_height)/2)),
fill=(0, 0, 0, 0))
bordered.save(target_image_path)

print("Complete")


if __name__ == '__main__':
adjust(sys.argv[1], sys.argv[2])

0 comments on commit c31e453

Please sign in to comment.