Skip to content
Open
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
16 changes: 14 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@
# Check https://circleci.com/docs/2.0/language-python/ for more details
#
version: 2.1

jobs:
build-preview:
parameters:
themename:
type: string

docker:
- image: cimg/python:3.14

steps:
- checkout
- run:
Expand All @@ -17,7 +23,7 @@ jobs:
- run:
name: Build sphinx
command: |
sphinx-build --color -W --keep-going -b html docs/ docs/_build/html
sphinx-build --color -W --keep-going -b html docs/ docs/_build/html -D html_theme=<< parameters.themename >>

- store_artifacts:
path: /home/circleci/project/docs/_build/html
Expand All @@ -28,4 +34,10 @@ workflows:

theme-previews:
jobs:
- build-preview
- build-preview:
name: << matrix.themename >>
matrix:
parameters:
themename:
- "bootstrap-astropy"
- "astropy-unified"
4 changes: 2 additions & 2 deletions .github/workflows/circleci-artifacts-redirector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ permissions: read-all

jobs:
circleci_artifacts_redirector_job:
if: "${(github.repository == 'astropy/astropy-sphinx-theme') && (github.event.context == 'ci/circleci: build-preview')}"
if: "${(github.repository == 'astropy/astropy-sphinx-theme') && startswith(github.event.context, 'ci/circleci'))}"
runs-on: ubuntu-latest
permissions:
statuses: write
Expand All @@ -17,5 +17,5 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}
api-token: ${{ secrets.ASTROPY_SPHINX_CIRCLE_TOKEN }}
artifact-path: 0/docs/_build/html/index.html
circleci-jobs: build-docs
circleci-jobs: bootstrap-astropy,astropy-unified
job-title: "--> Rendering Preview <--"
19 changes: 8 additions & 11 deletions astropy_sphinx_theme/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
"""Astropy Sphinx Theme"""
import warnings

import os
from .bootstrap_astropy import get_html_theme_path as _old_theme_path


def get_html_theme_path():
"""Return list of HTML theme paths."""
cur_dir = os.path.abspath(os.path.dirname(__file__))
return [cur_dir]


def setup(app):
app.add_html_theme(
"bootstrap-astropy",
os.path.abspath(os.path.join(os.path.dirname(__file__), "bootstrap-astropy")),
warnings.warn(
"astropy_sphinx_theme.get_html_theme_path is deprecated, you shouldn't"
" need to manually specify the theme path as the theme is registered with sphinx",
DeprecationWarning,
stacklevel=2,
)
return _old_theme_path()
11 changes: 11 additions & 0 deletions astropy_sphinx_theme/astropy-unified/static/css/astropy.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
:root {
/* SunPy Theme Colors */
--sst-accent-color-bright: #ff5000;
--sst-accent-color-muted: #fc9468;
--sst-dark-color: #404040;
--sst-darker-color: #333333;
--sst-darkest-color: #222222;
--sst-light-color: rgb(206, 206, 206);
--sst-lighter-color: rgb(231, 231, 231);
--sst-lightest-color: rgb(251, 251, 251);
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
38 changes: 38 additions & 0 deletions astropy_sphinx_theme/astropy-unified/theme.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[theme]
inherit = "sunpy"

[options]
sst_project_name = "Astropy"
# We use the RTD build preview of the new website here so the top nav works
# sst_site_root = "https://astropy.org"
sst_site_root = "https://astropy-org-test.readthedocs.io"
navbar_links = [
["About",
[
["About Astropy", "about.html", 2],
["Code of Conduct", "code_of_conduct.html", 2],
["Acknowledging & Citing", "acknowledging.html", 2],
["History", "history.html", 2],
]
],
["Documentation",
[
Copy link
Member Author

Choose a reason for hiding this comment

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

At the moment I have just linked the coordinated packages here. We need to decide if we want to list all affiliated packages or not.

As you can see on https://sunpy.org it's possible to have collapsible sections here, so we could choose to put all the affiliated packages under a click to reveal list.

Copy link
Member Author

Choose a reason for hiding this comment

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

It should also be noted that by default if we list all the affiliated packages here they will also be included in the unified search results (as long as they are hosted on RTD).

["astropy", "https://docs.astropy.org", 3],
["asdf-astropy", "https://asdf-astropy.readthedocs.io", 3],
["astropy-healpix", "https://astropy-healpix.readthedocs.io", 3],
["astroquery", "https://astroquery.readthedocs.io", 3],
["ccdproc", "https://ccdproc.readthedocs.io", 3],
["photutils", "https://photutils.readthedocs.io", 3],
["regions", "https://astropy-regions.readthedocs.io", 3],
["reproject", "https://reproject.readthedocs.io", 3],
["specreduce", "https://specreduce.readthedocs.io", 3],
["specutils", "https://specutils.readthedocs.io", 3],
]
],
Copy link
Member Author

Choose a reason for hiding this comment

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

docs.astropy.org has a learn link in the header, would we like to add one here?

["Get Help", "help.html", 2],
["Contribute", "contribute.html", 2],
["Affiliated Packages", "affiliated/index.html", 2],
["Team", "team.html", 2],
]
rtd_extra_search_projects = [["astropy-org-test", "https://astropy-org-test.readthedocs.io"]]
footer_links = [["Code of Conduct", "code_of_conduct.html", 2]]
Loading
Loading