Commit 192482e6 authored by Eric Poirier's avatar Eric Poirier Committed by Christopher Guindon
Browse files

Create projects shortcode

parent 12d05cc8
......@@ -165,6 +165,12 @@
weight = 3
parent = "solstice"
[[main]]
name = "EclipseFdn Projects page"
url = "/components/eclipsefdn_projects_page/"
weight = 3
parent = "solstice"
[[main]]
name = "HTML Tables"
url = "/components/tables/"
......
---
Title: Eclipse Foundation Projects Page
hide_sidebar: true
---
Using the **eclipsefdn_projects** shortcode in order to generate a list of projects that is pulled from the projects.eclipse.org API.
## Parameters:
- **templateId:** string | The mustache template to use
- **url:** string | Url of the PMI endpoint to be using
- **classes:** string | Classes for the block
- **display_categories:** bool | true or false
- **categories:** string | Path to the json file containing the projects categories
## Examples:
Following list of projects has been filtered to display "Cloud Development Tools" projects:
{{< eclipsefdn_projects
templateId="tpl-projects-item"
url="https://projects.eclipse.org/api/projects?working_group=cloud-development-tools"
classes="margin-top-30"
display_categories="true"
categories="/js/featured-projects-categories.json"
>}}
{{< grid/div isMarkdown="false" >}}
<script type="text/javascript" src="/js/eclipsefdn.projects.js"></script>
{{</ grid/div >}}
\ No newline at end of file
<!--
Copyright (c) 2020 Eclipse Foundation, Inc.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0 which is available at
http://www.eclipse.org/legal/epl-2.0.
Contributors:
Eric Poirier <eric.poirier@eclipse-foundation.org>
Yi Liu <yi.liu@eclipse-foundation.org>
SPDX-License-Identifier: EPL-2.0
-->
{{ $id := .Get "id" | default "featured-story-container" }}
{{ $templateId := .Get "templateId" }}
{{ $projectIds := .Get "projectIds" }}
{{ $url := .Get "url" }}
{{ $classes := .Get "classes" }}
{{ $display_categories := .Get "display_categories" | default "false" }}
{{ $categories := .Get "categories" | default "" }}
<section id="wg-projects" class="container featured-section featured-section-projects" data-filter-wg="{{ $.Site.Params.projects_working_group }}">
<div class="row">
<div id="projects-list" class="col-md-18 col-md-offset-3">
<input aria-label="Search for a project" type="text" class="form-control search center-block" placeholder="Start typing to filter projects…">
{{ if eq $display_categories "true" }}
<p class="margin-bottom-0 margin-top-20 text-center">Filter by categories:</p>
<div id="projects-categories" class="eclipsefdn-project-list-filters text-center" data-categories="{{ $categories }}"></div>
{{ end }}
<ul class="featured-projects list-inline list {{ $classes }}"
id="{{ $id }}"
data-project-ids="{{ $projectIds }}"
data-template-id="{{ $templateId }}"
data-url="{{ $url }}"></ul>
</div>
</div>
<p class="text-center margin-top-30">
<a href="/projects" class="btn btn-primary">View All Projects</a>
</p>
</section>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -26,4 +26,6 @@ mix.less(
mix.js(
['./node_modules/eclipsefdn-solstice-assets/js/main.js'],
'./static/js/solstice.js'
);
\ No newline at end of file
);
mix.js(['./node_modules/eclipsefdn-solstice-assets/js/solstice/eclipsefdn.projects.js'], './static/js/eclipsefdn.projects.js');
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment