Skip to content

Commit

Permalink
initial config from jupyterbook-template
Browse files Browse the repository at this point in the history
  • Loading branch information
scottyhq committed Sep 11, 2023
1 parent 862d35a commit de07aba
Show file tree
Hide file tree
Showing 26 changed files with 1,434 additions and 35 deletions.
2 changes: 2 additions & 0 deletions .codespellignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
hsa
slippy
36 changes: 36 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# https://EditorConfig.org

root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4

[*.ipynb]
# Content is json, but it seems to be minimally formatted
indent_size = unset

[*.js]
indent_size = 2

[*.json]
indent_size = 2

[*.md]
indent_size = unset

[*.py]
# yapf and black will use indents other than 4 spaces
indent_size = unset

[*.rst]
indent_size = unset

[*.{yml,yaml}]
indent_size = 2
max_line_length = 100
60 changes: 60 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Deploy Website to GitHub Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

jobs:
# Build JupyterBook Website
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
cache-environment: true

- name: Build JupyterBook
shell: bash -el {0}
run: |
./scripts/build_resources.sh
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: _build/html


# Publish Website to GitHub Pages if built successfully
deploy:
needs: build
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Setup Pages
uses: actions/configure-pages@v3

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
52 changes: 18 additions & 34 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
.DS_Store

# Jupyter Book things
.bash_history
*_build
.jupyter-server-log.txt
.config/
.jupyter/
.local/
.viminfo

# cookiecutter webpage things
cookiecutter.json
/book/_build/html/assets

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand All @@ -20,6 +35,7 @@ parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
Expand Down Expand Up @@ -49,7 +65,6 @@ coverage.xml
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
Expand All @@ -72,7 +87,6 @@ instance/
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
Expand All @@ -83,9 +97,7 @@ profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
Expand All @@ -94,22 +106,7 @@ ipython_config.py
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
Expand Down Expand Up @@ -145,16 +142,3 @@ dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,33 @@
# splashpage-template
Template repository for event splash page only
An event landing page built on a [Tech Conference Theme](https://themes.3rdwavemedia.com/demo/bs5/devconf/)

For linked splashpage and JupyterBook see https://github.com/uwhackweek/jupyterbook-template

## How to use this template

You can use this template for your own event!

1. Click the "Use this template" button at the top of the repo
1. Select the account where you'd like to use the template.
1. In your new repo, got to Settings --> Pages --> Source = GitHub Actions
1. There are a few files you'll need to edit to customize content for your event:
* `cookiecutter.yaml`: customize your landing page content
1. Any commits pushed to the main branch will be published to GitHub Pages!

## Build website locally

First create an environment with necessary python packages
```
cd [repository]
mamba env create
mamba activate splashpage
```

Then run the build script
```
./scripts/build_resources.sh
```

## Details

This template uses simple text YAML files to fill in key website details. [Cookiecutter](https://cookiecutter.readthedocs.io/en/stable/README.html) is then used to populate templated HTML for the final webpage.
49 changes: 49 additions & 0 deletions cookiecutter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
repo_directory: html
name: UW Hackweek
apply:
url: '#'
title: Application coming soon
hackweek_mission: https://uwhackweek.github.io/hackweeks-as-a-service/mission.html
banner:
description: An awesome learning event.
start_date: XX Month
end_date: XX Month
year: 2022
location: Seattle, WA
links:
- url: intro.html
title: Event Jupyter Book
new_window: false
image: https://geohackweek.github.io/assets/images/banner.jpg
# The opening session of the event with UTC offset
event_countdown: "2024-08-07T08:30:00-07:00"
about:
description: Hackweeks are participant-driven events that strive to create
welcoming spaces for participants to learn new things, build community and
gain hands-on experience with collaboration and team science
learn_more: https://escience.washington.edu/using-data-science/hackweeks
links:
- url: '#'
title: A sample link
new_window: True
applicant_info: UW Hackweek 2022 will take place in October 2022 (virtual or in-person
TBD). Applications have not yet opened, but should be anticipated in September 2022.
team:
!include team.yaml
schedule:
!include schedule.yaml
sponsors:
description: ''
organizations:
- name: eScience Institute
website: ''
logo_url: https://escience.washington.edu/wp-content/uploads/2015/10/Logo_eScience-stacked.png
footer:
social:
- icon: github
icon_pack: fab
link: https://github.com/uwhackweek/
_copy_without_render:
- assets
_extensions:
- jinja_markdown.MarkdownExtension
13 changes: 13 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: splashpage
channels:
- conda-forge
dependencies:
- pip
- python=3.11
- cookiecutter
# Dependencies of jinja-markdown:
- jinja2>=2.11
- pygments>=2.6.1
- pymdown-extensions>=7.1
- pip:
- jinja-markdown==1.210911

0 comments on commit de07aba

Please sign in to comment.