diff --git a/.agent/working-memory/plan-awesome-list.md b/.agent/working-memory/plan-awesome-list.md index 219c321d..2385a807 100644 --- a/.agent/working-memory/plan-awesome-list.md +++ b/.agent/working-memory/plan-awesome-list.md @@ -2,7 +2,7 @@ **Date:** 2026-03-28 **Source repo:** https://github.com/openmodelingfoundation/awesome-modeling-practices -**Target page:** `/resources/awesome-modeling-practices/` (new section, or under `/standards/`) +**Target page:** `/resources/awesome-modeling-practices/` --- diff --git a/.agent/working-memory/plan-navigation-resources-refactor.md b/.agent/working-memory/plan-navigation-resources-refactor.md new file mode 100644 index 00000000..3ac3a484 --- /dev/null +++ b/.agent/working-memory/plan-navigation-resources-refactor.md @@ -0,0 +1,38 @@ +# Promote Working Groups to Top-Level Navigation and Add a Resources Index + +## Summary + +Move Working Groups out of About and make it a top-level section. Add a new top-level Resources page that acts as an index of OMF outputs. Keep `/standards/` as the canonical home for standards content; `/resources/` should link to it rather than duplicating it. + +## Proposed changes + +- Move `content/en/about/working-groups/` to `content/en/working-groups/`. +- Add Hugo aliases for every moved Working Groups page so existing `/about/working-groups/...` URLs keep working. +- Create `content/en/resources/_index.md` plus minimal child pages for publications, best practices, and repositories. +- Add a featured Standards link on `/resources/` that points to `/standards/`. +- Make the top nav order explicit: About, Governance, Working Groups, Standards, Resources, Contribute. +- Update internal links that still point to `/about/working-groups/`. + +## Constraints + +- Navigation is currently driven by section front matter `menu.main`, not a centralized `menus.main` block in `hugo.yaml`. +- Avoid a duplicate top-level menu definition unless existing section `menu.main` entries are removed. +- Keep this as a content/front matter refactor; do not rewrite templates unless the move exposes a real theme limitation. +- Validate with the containerized build path: `make render`. + +## Acceptance criteria + +- Working Groups appears in the top-level nav and is no longer nested under About. +- Resources appears in the top-level nav. +- `/working-groups/` is canonical. +- Old Working Groups URLs under `/about/working-groups/...` resolve via aliases. +- `/resources/` exists as an outputs index. +- `/resources/` includes a Standards block linking to `/standards/`. +- `/resources/` includes links for publications, best practices, and repositories, including `openmodelingfoundation/awesome-modeling-practices`. +- The site builds successfully with `make render`. + +## Implementation notes + +- Add aliases to every moved Working Groups page, not just the section landing page. +- Known internal links to update include `content/en/_index.html` and `content/en/about/history-events-and-activities.md`. +- Do not add a `standards-documents` subsection under Resources. \ No newline at end of file diff --git a/.agent/working-memory/session.md b/.agent/working-memory/session.md index ca8d447e..80959dc7 100644 --- a/.agent/working-memory/session.md +++ b/.agent/working-memory/session.md @@ -3,6 +3,7 @@ ## Active task - awesome-modeling-practices embed plan is ready: `.agent/working-memory/plan-awesome-list.md`. +- navigation/resources refactor issue plan is ready: `.agent/working-memory/plan-navigation-resources-refactor.md`. - Next step on request: implement the planned integration. ## Notes by date (newest first) diff --git a/.env b/.env index 6fb88ff0..d4c2da7d 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ -HUGO_VERSION="v0.159.1" +HUGO_VERSION="v0.160.1" DOCSY_VERSION="v0.14.3" diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 32163e57..31bffa9c 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -49,12 +49,14 @@ jobs: env: BASE_URL: ${{ steps.pages.outputs.base_url }} run: | + BUILD_TIMESTAMP_UTC="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" docker compose build --pull hugo docker compose run --rm --no-deps \ --entrypoint sh \ --user "$(id -u):$(id -g)" \ -e HUGO_CACHEDIR="${HUGO_CACHE_CONTAINER_DIR}" \ -e BASE_URL="${BASE_URL}" \ + -e BUILD_TIMESTAMP_UTC="${BUILD_TIMESTAMP_UTC}" \ hugo -c '.github/scripts/build-site.sh' - name: Save build cache diff --git a/AGENTS.md b/AGENTS.md index 7cbdb2fb..6bd8b159 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -45,7 +45,7 @@ Agent-generated artifacts must be written under `.agent/`. ## Important dependency versions -- Hugo (Docker build arg): `0.159.1` (`Dockerfile`) +- Hugo (Docker build arg): `0.160.1` (`Dockerfile`) - Docsy module: `v0.14.3` (`go.mod` and `Dockerfile`) - Go toolchain declaration: `1.18` (`go.mod`) - npm package manifest version: `1.0.0` (`package.json`) diff --git a/Dockerfile b/Dockerfile index e89d3150..7f47d158 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG HUGO_VERSION=v0.159.1 +ARG HUGO_VERSION=v0.160.1 FROM ghcr.io/gohugoio/hugo:${HUGO_VERSION} ARG DOCSY_VERSION=v0.14.3 diff --git a/assets/scss/_styles_project.scss b/assets/scss/_styles_project.scss index ab6c50be..1df27fc9 100644 --- a/assets/scss/_styles_project.scss +++ b/assets/scss/_styles_project.scss @@ -135,3 +135,105 @@ footer { visibility: hidden; } } + +.awesome-list-content { + max-width: 78ch; + + .awesome-list-intro { + color: $gray-700; + font-size: 1.05rem; + margin-bottom: 1.25rem; + } + + .awesome-list-meta { + border-left: 4px solid $secondary; + background: rgba($secondary, 0.06); + } + + .awesome-list-rendered { + h2 { + margin-top: 2.25rem; + margin-bottom: 0.75rem; + padding-bottom: 0.35rem; + border-bottom: 2px solid rgba($primary, 0.2); + letter-spacing: 0.01em; + } + + h3 { + margin-top: 1.5rem; + margin-bottom: 0.35rem; + font-size: 1.15rem; + } + + p, + li { + line-height: 1.7; + } + + > ul:first-of-type { + display: flex; + flex-wrap: wrap; + list-style: none; + gap: 0.5rem; + padding-left: 0; + margin: 1rem 0 1.5rem; + + li { + margin: 0; + } + + a { + display: inline-block; + font-size: 0.85rem; + line-height: 1.25; + text-decoration: none; + color: $primary; + background: rgba($secondary, 0.14); + border: 1px solid rgba($secondary, 0.35); + border-radius: 999px; + padding: 0.35rem 0.7rem; + transition: all 0.2s ease; + } + + a:hover, + a:focus-visible { + background: rgba($secondary, 0.22); + border-color: rgba($secondary, 0.55); + outline: none; + } + } + + ul { + padding-left: 1.25rem; + } + + ul li { + margin-bottom: 0.55rem; + } + + ul li::marker { + color: $secondary; + } + + a { + text-underline-offset: 0.14em; + } + + a:focus-visible { + outline: 2px solid rgba($secondary, 0.8); + outline-offset: 2px; + border-radius: 2px; + } + } + + @include media-breakpoint-down(md) { + .awesome-list-rendered > ul:first-of-type { + gap: 0.4rem; + + a { + font-size: 0.8rem; + padding: 0.3rem 0.58rem; + } + } + } +} diff --git a/content/en/_index.html b/content/en/_index.html index de8b3211..444f791e 100644 --- a/content/en/_index.html +++ b/content/en/_index.html @@ -42,7 +42,7 @@

{{< blocks/section color="light" type="row" >}} {{% blocks/feature icon="fas fa-project-diagram" title="How to Participate" url="/contribute" url_text="How to contribute" %}} You can [contribute to OMF activities]({{< relref "contribute" >}}) as a representative of a member organization or - as an individual in a [Working Group]({{< relref "working-groups" >}}). + as an individual in a [Working Group]({{< relref "/working-groups" >}}). {{% /blocks/feature %}} {{% blocks/feature icon="fas fa-users" title="Community" url="/about/community" %}} diff --git a/content/en/about/_index.md b/content/en/about/_index.md index df986463..1df92dd4 100644 --- a/content/en/about/_index.md +++ b/content/en/about/_index.md @@ -5,7 +5,7 @@ cascade: - type: "docs" menu: main: - weight: 20 + weight: 10 --- The Open Modeling Foundation (OMF) is an international open science community that works to enable the next generation modeling of human and natural systems. It is an alliance of modeling organizations that coordinates and administers a common, community developed body of standards and best practices among diverse communities of modeling scientists. The OMF also provides informational, data, and technological resources to facilitate the implementation of common standards and best practices among the scientific communities it serves. diff --git a/content/en/about/history-events-and-activities.md b/content/en/about/history-events-and-activities.md index 68c6c1ef..8b7975ff 100644 --- a/content/en/about/history-events-and-activities.md +++ b/content/en/about/history-events-and-activities.md @@ -7,7 +7,7 @@ weight: 101 ## Upcoming Activities -Information on activities or projects of individual OMF Working Groups can be found within their individual pages accessed via the [Working Groups page]({{< ref "/about/working-groups#working-groups" >}}). +Information on activities or projects of individual OMF Working Groups can be found within their individual pages accessed via the [Working Groups page]({{< ref "/working-groups#working-groups" >}}). **December 2024 Virtual Members Council Meeting** diff --git a/content/en/contribute/_index.md b/content/en/contribute/_index.md index 89c70782..dcdf21e5 100644 --- a/content/en/contribute/_index.md +++ b/content/en/contribute/_index.md @@ -7,7 +7,7 @@ cascade: - github_issue_filter: label:"OMF site info" menu: main: - weight: 20 + weight: 60 --- The Open Modeling Foundation is using GitHub as a platform for members to contribute and modify content. With this platform, we hope to encourage collaboration and accessibility. diff --git a/content/en/resources/_index.md b/content/en/resources/_index.md new file mode 100644 index 00000000..d1247f8e --- /dev/null +++ b/content/en/resources/_index.md @@ -0,0 +1,50 @@ +--- +title: "Resources" +linkTitle: "Resources" +cascade: + - type: "docs" +menu: + main: + weight: 50 +--- + +The Resources section highlights concrete Open Modeling Foundation outputs and related materials. Use it to find standards, publications, practical guidance, and repository-based resources without duplicating the main standards section. + +
+
+
+
+

Standards

+

View OMF standards and guidance in the dedicated standards section.

+ View OMF standards +
+
+
+
+
+
+

Publications

+

Browse publications, manuscripts, and reports related to OMF activities.

+ }}">Browse publications +
+
+
+
+
+
+

Awesome Modeling Practices

+

Useful modeling resources curated by the OMF Early Career Scholars Working Group.

+ }}">Open awesome list +
+
+
+
+
+
+

Repositories

+

Explore OMF's GitHub repositories.

+ }}">Browse repositories +
+
+
+
\ No newline at end of file diff --git a/content/en/resources/awesome-modeling-practices/_index.md b/content/en/resources/awesome-modeling-practices/_index.md new file mode 100644 index 00000000..d62250b9 --- /dev/null +++ b/content/en/resources/awesome-modeling-practices/_index.md @@ -0,0 +1,9 @@ +--- +title: "Awesome Modeling Practices" +linkTitle: "Awesome Modeling Practices" +description: "✨Awesome modeling practices✨ curated by the OMF Early Career Scholars Working Group." +layout: "awesome-list" +weight: 10 +--- + +This page auto-imports the latest curated list from the OMF community repository. \ No newline at end of file diff --git a/content/en/resources/publications.md b/content/en/resources/publications.md new file mode 100644 index 00000000..098b926d --- /dev/null +++ b/content/en/resources/publications.md @@ -0,0 +1,10 @@ +--- +title: "Publications" +linkTitle: "Publications" +weight: 20 +--- + +Publications and documents resulting from Open Modeling Foundation Working Group activities. + +- [Ten simple rules for good model-sharing practices](https://doi.org/10.1371/journal.pcbi.1012702) +- Standards-related manuscripts and reports developed by OMF working groups will be added here as they are published. \ No newline at end of file diff --git a/content/en/resources/repositories.md b/content/en/resources/repositories.md new file mode 100644 index 00000000..70ecdab8 --- /dev/null +++ b/content/en/resources/repositories.md @@ -0,0 +1,12 @@ +--- +title: "Repositories" +linkTitle: "Repositories" +type: "docs" +weight: 30 +--- + +The following OMF repositories and open infrastructure welcome community contributions and oversight. + +- This website's source: [openmodelingfoundation/openmodelingfoundation.github.io](https://github.com/openmodelingfoundation/openmodelingfoundation.github.io) +- [Awesome Modeling Practices](/resources/awesome-modeling-practices/) (source: [openmodelingfoundation/awesome-modeling-practices](https://github.com/openmodelingfoundation/awesome-modeling-practices)) +- [OMF Agent Skills](https://github.com/openmodelingfoundation/skills) **coming soon** \ No newline at end of file diff --git a/content/en/standards/_index.md b/content/en/standards/_index.md index c2f4b80d..c12952a7 100644 --- a/content/en/standards/_index.md +++ b/content/en/standards/_index.md @@ -5,7 +5,7 @@ cascade: - type: docs menu: main: - weight: 20 + weight: 40 --- These pages present current standards in development or adopted by the Open Modeling Foundation. Select a topic to see standards documents relevant to that topic. See the "How to Contribute" pages for details on how to participate in the development of community modeling standards. diff --git a/content/en/about/working-groups/_index.md b/content/en/working-groups/_index.md similarity index 98% rename from content/en/about/working-groups/_index.md rename to content/en/working-groups/_index.md index 0fba9af1..37655f9d 100644 --- a/content/en/about/working-groups/_index.md +++ b/content/en/working-groups/_index.md @@ -1,6 +1,13 @@ --- title: "Working Groups" linkTitle: "Working Groups" +cascade: + - type: "docs" +aliases: + - /about/working-groups/ +menu: + main: + weight: 30 weight: 100 --- diff --git a/content/en/about/working-groups/certification.md b/content/en/working-groups/certification.md similarity index 97% rename from content/en/about/working-groups/certification.md rename to content/en/working-groups/certification.md index 54f8a808..a77b3629 100644 --- a/content/en/about/working-groups/certification.md +++ b/content/en/working-groups/certification.md @@ -1,6 +1,8 @@ --- title: "Certification Working Group" linkTitle: "Certification" +aliases: + - /about/working-groups/certification/ --- The Certification Working Group (CWG) develops and administers programs to certify model code that meets OMF standards for modeling best practices, and officially recognize model developers who apply these standards. CWG activities include developing and administering a community-wide program for model code peer review, establishing metrics for standards compliance, creating and assigning digital certification badges that follow guidelines being developed by the National Information Standards Organization (NISO). The CWG helps OMF member (and other) code repositories to ensure that models meeting OMF standards are clearly identified and developers who create standards-based models are publicly recognized. The CWG coordinates collaborative efforts with journals, funding agencies, societies, institutions/labs, other software/modeling consortia, and professional bodies to disseminate and administer OMF standards across the community of modeling science, and to promote recognition of OMF standards. diff --git a/content/en/about/working-groups/cyberinfrastructure.md b/content/en/working-groups/cyberinfrastructure.md similarity index 98% rename from content/en/about/working-groups/cyberinfrastructure.md rename to content/en/working-groups/cyberinfrastructure.md index d106c9d3..a5940bfa 100644 --- a/content/en/about/working-groups/cyberinfrastructure.md +++ b/content/en/working-groups/cyberinfrastructure.md @@ -1,6 +1,8 @@ --- title: "Cyberinfrastructure Working Group" linkTitle: "Cyberinfrastructure" +aliases: + - /about/working-groups/cyberinfrastructure/ --- The Cyberinfrastructure Working Group (CYWG) coordinates development and management of the OMF Science Gateway, an online platform for collaborative governance and standards. CYWG works to to identify, develop, and enhance tools and processes that lower the technical barriers towards adoption of OMF standards and facilitate their use by modeling scientists. CYWG staff assist the EOWG in developing online training modules and making them available on the OMF Science Gateway. diff --git a/content/en/about/working-groups/early-career-scholars/_index.md b/content/en/working-groups/early-career-scholars/_index.md similarity index 96% rename from content/en/about/working-groups/early-career-scholars/_index.md rename to content/en/working-groups/early-career-scholars/_index.md index 58defbff..19eb9b18 100644 --- a/content/en/about/working-groups/early-career-scholars/_index.md +++ b/content/en/working-groups/early-career-scholars/_index.md @@ -1,6 +1,8 @@ --- title: "Early Career Scholars Working Group" linkTitle: "Early Career Scholars" +aliases: + - /about/working-groups/early-career-scholars/ --- The Early Career Scholars (ECSWG) helps the Open Modeling Foundation to support student and early career development. The ECSWG is open to any student enrolled in an institution of higher learning (e.g., college or university) or early career scholar (recent graduate). diff --git a/content/en/about/working-groups/early-career-scholars/meeting-minutes.md b/content/en/working-groups/early-career-scholars/meeting-minutes.md similarity index 98% rename from content/en/about/working-groups/early-career-scholars/meeting-minutes.md rename to content/en/working-groups/early-career-scholars/meeting-minutes.md index b446dd50..71792316 100644 --- a/content/en/about/working-groups/early-career-scholars/meeting-minutes.md +++ b/content/en/working-groups/early-career-scholars/meeting-minutes.md @@ -1,6 +1,8 @@ --- title: "Early Career Scholars WG Meeting Minutes" linkTitle: "Meeting Minutes" +aliases: + - /about/working-groups/early-career-scholars/meeting-minutes/ --- ## Dec 10, 2025 8:00 AM GMT+1 diff --git a/content/en/about/working-groups/education-and-outreach.md b/content/en/working-groups/education-and-outreach.md similarity index 98% rename from content/en/about/working-groups/education-and-outreach.md rename to content/en/working-groups/education-and-outreach.md index a434364b..1515e97d 100644 --- a/content/en/about/working-groups/education-and-outreach.md +++ b/content/en/working-groups/education-and-outreach.md @@ -1,6 +1,8 @@ --- title: "Education and Outreach Working Group" linkTitle: "Education and Outreach" +aliases: + - /about/working-groups/education-and-outreach/ --- The Education and Outreach Working Group (EOWG) helps OMF member organizations reach and train next generation scholars and ensure proactive outreach to groups and nationalities that are underrepresented in modeling science. Depending on available resources, it may develop and deploy educational and training materials, organize workshops, symposia, clinics, and other promotional or engagement events to disseminate OMF standards and help modeling scientists meet those standards. The EOWG coordinates with the SWG to ensure that standards adopted by the OMF are supported by appropriate training and educational programs, and accessible via the OMF Science Gateway. The EOWG coordinates with the OMF Early Career Scholars to develop programs to support early-career scientists. Depending on available resources, such programs may include scholarships to attend trainings in standards-based modeling or presenting standards-based modeling research at professional meetings. diff --git a/content/en/about/working-groups/standards.md b/content/en/working-groups/standards.md similarity index 98% rename from content/en/about/working-groups/standards.md rename to content/en/working-groups/standards.md index 6a1f50b7..ed326854 100644 --- a/content/en/about/working-groups/standards.md +++ b/content/en/working-groups/standards.md @@ -1,6 +1,8 @@ --- title: "Standards Working Group" linkTitle: "Standards" +aliases: + - /about/working-groups/standards/ --- ## **Overview** diff --git a/hugo.yaml b/hugo.yaml index eac15bdd..36a4b774 100644 --- a/hugo.yaml +++ b/hugo.yaml @@ -24,21 +24,12 @@ enableMissingTranslationPlaceholders: true disableKinds: - taxonomy -# Highlighting config -pygmentsCodeFences: true -pygmentsUseClasses: false -# Use the new Chroma Go highlighter in Hugo. -pygmentsUseClassic: false -# pygmentsOptions: "linenos=table" -# See https://help.farbox.com/pygments.html -pygmentsStyle: "tango" - # module settings module: proxy: "direct" hugoVersion: extended: true - min: "0.110.0" + min: "0.160.1" imports: - path: "github.com/google/docsy" disable: false @@ -55,13 +46,6 @@ module: permalinks: blog: "/:section/:year/:month/:day/:slug/" -## Configuration for BlackFriday markdown parser: https://github.com/russross/blackfriday -blackfriday: - plainIDAnchors: true - hrefTargetBlank: true - angledQuotes: false - latexDashes: true - # Image processing configuration. imaging: resampleFilter: "CatmullRom" @@ -86,6 +70,10 @@ languages: time_format_blog: "02.01.2006" markup: + highlight: + codeFences: true + noClasses: true + style: "tango" goldmark: renderer: unsafe: true @@ -96,6 +84,13 @@ outputs: - "HTML" - "RSS" +security: + funcs: + getenv: + - '^HUGO_' + - '^CI$' + - '^BUILD_TIMESTAMP_UTC$' + params: working_group_request_form: "https://asu.questionpro.com/omf-wg-joinrequest" copyright: "Open Modeling Foundation" @@ -112,7 +107,7 @@ params: # The version number for the version of the docs represented in this doc set. # Used in the "version-banner" partial to display a version number for the # current doc set. - version: "0.4" + version: "0.5" # A link to latest version of the docs. Used in the "version-banner" partial to # point people to the main doc site. url_latest_version: "https://www.openmodelingfoundation.org" diff --git a/layouts/docs/awesome-list.html b/layouts/docs/awesome-list.html new file mode 100644 index 00000000..8cda4274 --- /dev/null +++ b/layouts/docs/awesome-list.html @@ -0,0 +1,106 @@ +{{ define "main" }} + {{ $sourceRepo := "https://github.com/openmodelingfoundation/awesome-modeling-practices" }} + {{ $rawURL := "https://raw.githubusercontent.com/openmodelingfoundation/awesome-modeling-practices/main/README.md" }} + {{ $blobRoot := "https://github.com/openmodelingfoundation/awesome-modeling-practices/blob/main/" }} + {{ $rawRoot := "https://raw.githubusercontent.com/openmodelingfoundation/awesome-modeling-practices/main/" }} + {{ $opts := dict "headers" (dict "User-Agent" "OMF-Hugo") }} + {{ $buildTimestampRaw := getenv "BUILD_TIMESTAMP_UTC" }} + {{ $buildTimestamp := now.UTC }} + {{ with $buildTimestampRaw }} + {{ $buildTimestamp = time . }} + {{ end }} + +
+

{{ .Title }}

+
+
+ {{ with .Description }} +

{{ . }}

+ {{ end }} +

+ This page is generated from + openmodelingfoundation/awesome-modeling-practices +
+ Last updated: {{ $buildTimestamp.Format "January 2, 2006 15:04 MST" }} +

+
+
+ + {{ with try (resources.GetRemote $rawURL $opts) }} + {{ with .Err }} + + {{ else with .Value }} + {{ $content := string .Content }} + {{ $content = replaceRE `(?m)^#\s+[^\n]+\n` "" $content }} + {{ $content = replaceRE `\]\((/openmodelingfoundation/awesome-modeling-practices[^)]*)\)` "](https://github.com$1)" $content }} + + {{ $html := $content | markdownify }} + + {{/* + Content handling policy (intentional lightweight processing): + + Rewritten: + - Repo-root href values like /openmodelingfoundation/awesome-modeling-practices... + to full github.com links. + - Relative href values (/, ./, ../, and bare relative paths) to $blobRoot. + - Relative src values (/, ./, ../, and bare relative paths) to $rawRoot. + - javascript: href/src URLs to safe no-op (#). + + Sanitized: + - Removes high-risk tag blocks: script, iframe, object, embed, form, style. + - Removes standalone interactive/metadata tags: input, button, textarea, + select, meta, link. + - Removes inline event handlers (onclick, onload, etc.). + + Left untouched: + - Absolute links (http:, https:, mailto:, tel:). + - Fragment-only links (#...). + - Markdown semantics/content structure not related to URL rewriting. + - Advanced HTML sanitization beyond these patterns (this is intentionally + trust-based because OMF controls the upstream repository). + */}} + {{/* Lightweight sanitization for remote HTML blocks and URL protocols. */}} + {{ $html = replaceRE `(?is)]*)?>.*?` "" $html }} + {{ $html = replaceRE `(?is)]*)?>.*?` "" $html }} + {{ $html = replaceRE `(?is)]*)?>.*?` "" $html }} + {{ $html = replaceRE `(?is)]*)?>.*?` "" $html }} + {{ $html = replaceRE `(?is)]*)?>.*?` "" $html }} + {{ $html = replaceRE `(?is)]*)?>.*?` "" $html }} + {{ $html = replaceRE `(?is)<(?:input|button|textarea|select|meta|link)(?:\s[^>]*)?/?>` "" $html }} + {{ $html = replaceRE `(?i)\s+on[a-z]+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)` "" $html }} + {{ $html = replaceRE `(?i)\s+style\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)` "" $html }} + {{ $html = replaceRE `(?i)(href|src|xlink:href|formaction|poster)\s*=\s*"\s*(?:javascript|vbscript|data)\s*:[^"]*"` `$1="#"` $html }} + {{ $html = replaceRE `(?i)(href|src|xlink:href|formaction|poster)\s*=\s*'\s*(?:javascript|vbscript|data)\s*:[^']*'` `$1='#'` $html }} + {{ $html = replaceRE `(?i)(href|src|xlink:href|formaction|poster)\s*=\s*(?:javascript|vbscript|data)\s*:[^\s>]+` `$1="#"` $html }} + + {{/* Rewrite relative links after Markdown rendering for better GitHub parity. */}} + {{ $html = replaceRE `href="/openmodelingfoundation/awesome-modeling-practices([^"]*)"` `href="https://github.com/openmodelingfoundation/awesome-modeling-practices$1"` $html }} + {{ $html = replaceRE `href="/([^"][^"]*)"` `href="https://github.com/openmodelingfoundation/awesome-modeling-practices/blob/main/$1"` $html }} + {{ $html = replaceRE `href="\./([^"]+)"` (printf `href="%s$1"` $blobRoot) $html }} + {{ $html = replaceRE `href="\.\./([^"]+)"` (printf `href="%s../$1"` $blobRoot) $html }} + {{ $html = replaceRE `href="([A-Za-z0-9][^":#]*)"` (printf `href="%s$1"` $blobRoot) $html }} + {{ $html = replaceRE `src="/([^"]+)"` `src="https://raw.githubusercontent.com/openmodelingfoundation/awesome-modeling-practices/main/$1"` $html }} + {{ $html = replaceRE `src="\./([^"]+)"` (printf `src="%s$1"` $rawRoot) $html }} + {{ $html = replaceRE `src="\.\./([^"]+)"` (printf `src="%s../$1"` $rawRoot) $html }} + {{ $html = replaceRE `src="([A-Za-z0-9][^":#]*)"` (printf `src="%s$1"` $rawRoot) $html }} + +
+ {{ $html | safeHTML }} +
+ {{ else }} + + {{ end }} + {{ else }} + + {{ end }} +
+{{ end }} \ No newline at end of file