Add park, range and wilderness pages
This commit is contained in:
1 parent
f08c661c16
commit
16c5275c94
6 files changed
+359
-5
No files matched your search
+13
-1
@@ -31,11 +31,17 @@ import os
|
||||
import shutil
|
||||
|
||||
from .markup import esc
|
||||
from . import authors, browse, cards, datafiles, docs, facets, feed, home, layout, leftout, pagekit, placefacets, reference, regions, saved, seo, site as site_settings, sketch, standing, thumbs, trail, views
|
||||
from . import authors, browse, cards, datafiles, docs, facets, feed, home, layout, leftout, pagekit, placefacets, placepages, reference, regions, saved, seo, site as site_settings, sketch, standing, thumbs, trail, views
|
||||
|
||||
WEB_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
ASSETS_DIR = os.path.join(WEB_DIR, "assets")
|
||||
|
||||
# Builders of further place pages, run after the state and group pages. Each takes
|
||||
# (records, site, repo_root) and returns pages as (path, title, description, body,
|
||||
# needs_map, recs); each page is added like a state page and reaches the sitemap
|
||||
# through region_paths.
|
||||
EXTRA_PAGE_BUILDERS = (placepages.build,)
|
||||
|
||||
|
||||
def copy_assets(out_dir, assets_dir=ASSETS_DIR):
|
||||
"""Copy web/assets/ to <out>/assets/, replacing what was there. The fingerprinted files
|
||||
@@ -159,6 +165,12 @@ def render_site(records, out_dir, repo_root, site=None):
|
||||
path = regions.group_path(g)
|
||||
region_paths.append(path)
|
||||
add(path, t, d, b, maps=needs_map, recs=recs)
|
||||
# Further place pages (parks, ranges and wilderness areas, olt/placepages.py).
|
||||
for builder in EXTRA_PAGE_BUILDERS:
|
||||
for built in builder(records, site, repo_root):
|
||||
region_paths.append(built.path)
|
||||
add(built.path, built.title, built.description, built.body,
|
||||
maps=built.needs_map, recs=built.recs)
|
||||
# Pages for one kind of trail in one place (olt/placefacets.py).
|
||||
for p in facet_plan:
|
||||
t, d, b, needs_map = placefacets.page(p, records, site, facet_plan)
|
||||
|
||||
Reference in new issue
Block a user