Skip to content

New Portal Landing Page #115

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

Merged
merged 52 commits into from
Jun 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
161e051
Moving content directory out of way to make copy
Jun 16, 2021
7c85b78
Save copy of content directory
Jun 16, 2021
996b771
Merge commit '161e05151caed268a57c6f8261709fcfd75f621b' into new_portal
Jun 16, 2021
4e62264
Restoring original content directory
Jun 16, 2021
0630873
Add local theme to repo (much easier to dev)
Jun 16, 2021
7d0c18b
Change case of section titles
Jun 16, 2021
3dd46bb
Update extensions location and remove comm gallery
Jun 16, 2021
6152da7
Update and move out of pages
Jun 16, 2021
6e75793
Update ignores related to move
Jun 16, 2021
c29a6fc
Update ignores
Jun 16, 2021
7c89e0e
Update index
Jun 16, 2021
bccc2dd
Updated makefiles
Jun 16, 2021
74f5d27
Updating images for new theme
Jun 16, 2021
baba90a
Explicitly add pythia extension
Jun 16, 2021
8e769f2
Update pages and content for new theme
Jun 16, 2021
b5e874a
Update Sphinx config for new theme
Jun 16, 2021
7f84c99
Remove explicit custom.js load (done in extension)
Jun 16, 2021
76f3ec2
Add links to gallery
Jun 16, 2021
f293fb4
Formatting only
Jun 16, 2021
2a3b7e1
For model displays in new theme
Jun 16, 2021
2add6c7
Change name of gallery and affiliation link
Jun 16, 2021
4c501bc
Remove subtitle
Jun 16, 2021
e9685c9
Add HTML logo usage
Jun 16, 2021
8aaebfd
Add HTML logo setting and fix img locations
Jun 16, 2021
9560301
Fix references with pathto
Jun 16, 2021
e372d78
Logo and title
Jun 16, 2021
dc8f173
Fix dropdowns to use BS5
Jun 16, 2021
e9d6554
Hide gallery (and some tweaks)
Jun 16, 2021
70c1c02
Gallery formatting
Jun 16, 2021
fd760cf
Rename links to gallery
Jun 17, 2021
5fb4000
New images
Jun 17, 2021
f573b12
New landing page content
Jun 17, 2021
a8714b1
Match navbar items to new content
Jun 17, 2021
a23e5b5
Move custom styling/JS to pythia theme
Jun 17, 2021
5ca7b8f
Update names in CI
Jun 17, 2021
d8ab8a4
Point RTD to new portal
Jun 17, 2021
98e860e
Fix about link
Jun 17, 2021
9f4e940
Fix linting
Jun 17, 2021
edf689f
Replace divs with sections when appropriate
Jun 17, 2021
56284de
Return soup object
Jun 17, 2021
a5cae48
Support div.section and section
Jun 17, 2021
194ad20
Add extension to dropdown option urls
Jun 17, 2021
57bcc51
Add Code of Conduct button
Jun 20, 2021
4675c02
Fix link in COC
Jun 20, 2021
61d549f
Fix copyright flex issue in footer
Jun 20, 2021
0247555
Fix button layout
Jun 20, 2021
ea0626a
Add latest contributing to new portal
Jun 21, 2021
161de7f
Fix prettier ugliness that breaks pre tags
Jun 21, 2021
fdd9bb0
Admonition styling
Jun 21, 2021
b13e899
Add seealso admonition
Jun 21, 2021
8969f76
Move gallery styling/js to custom files
Jun 21, 2021
5ffbe09
Attempt a wide-card gallery style
Jun 21, 2021
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ jobs:
- name: Build
run: |
conda env list
cd content
cd portal
make -j4 html

- name: Deploy
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./content/_build/html
publish_dir: ./portal/_build/html
cname: projectpythia.org
12 changes: 6 additions & 6 deletions .github/workflows/update-external-links-gallery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,16 @@ jobs:

yaml = YAML()
submission_file = 'gallery-submission-input.json'
links_file = 'content/links.yaml'
gallery_file = 'portal/gallery.yaml'
with open(submission_file) as f:
data = json.load(f)

with open(links_file) as f:
links = yaml.load(f)
with open(gallery_file) as f:
gallery = yaml.load(f)

with open(links_file, 'w') as f:
links.append(data)
yaml.dump(links, f)
with open(gallery_file, 'w') as f:
gallery.append(data)
yaml.dump(gallery, f)

- name: Run pre-commit hooks
run: |
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,10 @@ dmypy.json
*.DS_Store
_build/
_thumbnails/
content/pages/communications.md
content/pages/code_of_conduct.md
content/pages/links.md
content/pages/links/*.md
content/notebooks_gallery/
portal/code_of_conduct.md
portal/gallery.md
portal/gallery/*.md
gallery-submission-input.json
20 changes: 10 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.3.0
rev: v4.0.1
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -10,17 +10,17 @@ repos:
- id: double-quote-string-fixer

- repo: https://github.com/ambv/black
rev: 20.8b1
rev: 21.6b0
hooks:
- id: black

- repo: https://github.com/keewis/blackdoc
rev: v0.3
rev: v0.3.3
hooks:
- id: blackdoc

- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
rev: 3.9.2
hooks:
- id: flake8

Expand All @@ -29,17 +29,17 @@ repos:
hooks:
- id: seed-isort-config
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.6.4
rev: v5.8.0
hooks:
- id: isort

- repo: https://github.com/prettier/pre-commit
rev: 57f39166b5a5a504d6808b87ab98d41ebf095b46
hooks:
- id: prettier
# - repo: https://github.com/prettier/pre-commit
# rev: 57f39166b5a5a504d6808b87ab98d41ebf095b46
# hooks:
# - id: prettier

- repo: https://github.com/nbQA-dev/nbQA
rev: 0.5.1
rev: 0.13.0
hooks:
- id: nbqa-black
additional_dependencies: [black==20.8b1]
Expand Down
1 change: 1 addition & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ conda:
environment: ci/environment.yml

sphinx:
configuration: portal/conf.py
fail_on_warning: false
18 changes: 9 additions & 9 deletions CODEOFCONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Code of Conduct

## OUR PLEDGE
## Our Pledge

We, as contributors, creators, stewards, and maintainers (participants), of Project Pythia pledge to make participation in our software, system or hardware project and community a safe, productive, welcoming and inclusive experience for everyone. All participants are required to abide by this Code of Conduct. This includes respectful treatment of everyone regardless of age, body size, disability, ethnicity, gender identity or expression, level of experience, nationality, political affiliation, veteran status, pregnancy, genetic information, physical appearance, race, religion, or sexual orientation, as well as any other characteristic protected under applicable US federal or state law.

## OUR STANDARDS
## Our Standards

Examples of behaviors that contribute to a positive environment include:

Expand All @@ -29,26 +29,26 @@ Examples of unacceptable behavior include, but are not limited to:
- Threatening or stalking anyone, including a participant
- Other conduct which could reasonably be considered inappropriate in a professional setting

## SCOPE
## Scope of this Code

This Code of Conduct applies to all spaces managed by the Project whether they be physical, online or face-to-face. This includes project code, code repository, associated web pages, documentation, mailing lists, project websites and wiki pages, issue tracker, meetings, telecons, events, project social media accounts, and any other forums created by the project team which the community uses for communication. In addition, violations of this Code of Conduct outside these spaces may affect a person's ability to participate within them. Representation of a project may be further defined and clarified by project maintainers.

## COMMUNITY RESPONSIBILITIES
## Community Responsibilities

Everyone in the community is empowered to respond to people who are showing unacceptable behavior. They can talk to them privately or publicly. Anyone requested to stop unacceptable behavior is expected to comply immediately. If the behavior continues concerns may be brought to the project administrators or to any other party listed in the Reporting section below.

## PROJECT ADMINISTRATOR RESPONSIBILITIES
## Project Administrator Responsibilities

Project administrators are responsible for clarifying the standards of acceptable behavior and are encouraged to model appropriate behavior and provide support when people in the community point out inappropriate behavior. Project administrator(s) are normally the ones that would be tasked to carry out the actions in the Consequences section below.

## REPORTING
## Reporting

Instances of unacceptable behavior can be brought to the attention of the project administrator(s) who may take any action as outlined in the Consequences section below.

## CONSEQUENCES
## Consequences

Upon receipt of a complaint, the project administrator(s) may take any action deemed necessary and appropriate under the circumstances. Such action can include things such as: removing, editing, or rejecting comments, commits, code, wiki edits, email, issues, and other contributions that are not aligned to this Code of Conduct, or banning temporarily or permanently any contributor for other behaviors that are deemed inappropriate, threatening, offensive, or harmful. Project administrators also have the right to report violations to UCAR HR and/or UCAR’s Office of Diversity, Equity and Inclusion (ODEI), as well as a participant’s home institution and/or law enforcement. In the event an incident is reported to UCAR, UCAR will follow its Harassment Reporting and Complaint Procedure.

## ATTRIBUTION
## Attribution

This Code of Conduct was originally adapted from the Contributor Covenant, version 1.4. We then aligned it with the UCAR Participant Code of Conduct, which also borrows from the American Geophysical Union (AGU) Code of Conduct. The UCAR Participant Code of Conduct applies to both UCAR employees as well as participants in activities run by UCAR. The original version of this for all software projects that have strong management from UCAR or UCAR staff is available on the UCAR website at https://doi.org/10.5065/6w2c-a132. The date that it was adopted by this project was 20 December 2020. When responding to complaints, UCAR HR and ODEI will do so based on the latest published version. Therefore, any project-specific changes should follow the Process for Changes section above.
This Code of Conduct was originally adapted from the Contributor Covenant, version 1.4. We then aligned it with the UCAR Participant Code of Conduct, which also borrows from the American Geophysical Union (AGU) Code of Conduct. The UCAR Participant Code of Conduct applies to both UCAR employees as well as participants in activities run by UCAR. The original version of this for all software projects that have strong management from UCAR or UCAR staff is available on the UCAR website at [https://doi.org/10.5065/6w2c-a132](https://doi.org/10.5065/6w2c-a132). The date that it was adopted by this project was 20 December 2020. When responding to complaints, UCAR HR and ODEI will do so based on the latest published version. Therefore, any project-specific changes should follow the Process for Changes section above.
20 changes: 20 additions & 0 deletions portal/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
51 changes: 51 additions & 0 deletions portal/_extensions/pythia.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
from bs4 import BeautifulSoup as bs
from sphinx.application import Sphinx


def add_functions_to_context(app, pagename, templatename, context, doctree):
def denest_sections(html):
soup = bs(html, 'html.parser')

sections = []
for h1 in soup.find_all(['h1']):
sections.append(h1.parent)
for child in h1.parent.children:
if (child.name == 'section') or (child.name == 'div' and 'section' in child['class']):
sections.append(child.extract())

return '\n'.join(str(s) for s in sections)

def bootstrapify(html):
soup = bs(html, 'html.parser')

for s in soup.select('section,div.section'):
h = s.find(['h1', 'h2', 'h3', 'h4', 'h5', 'h6'])
if not h:
continue

i = h.name[-1]

h['class'] = [f'display-{i}'] + h.get('class', [])

if h.name in ['h1', 'h2']:
s.wrap(soup.new_tag('div', **{'class': f'container-fluid sectionwrapper-{i}'}))
s.wrap(soup.new_tag('div', **{'class': f'container section-{i}'}))

if h.name == 'h2':
h.wrap(soup.new_tag('div', **{'class': 'section-title-wrapper'}))
h.wrap(soup.new_tag('div', **{'class': 'section-title'}))

return str(soup)

context['bootstrapify'] = bootstrapify
context['denest_sections'] = denest_sections


def setup(app: Sphinx):
app.require_sphinx('3.5')
app.connect('html-page-context', add_functions_to_context)

return {
'parallel_read_safe': True,
'parallel_write_safe': True,
}
Loading