Skip to content

Commit

Permalink
Merge pull request #465 from GovTechSG/layouts-page
Browse files Browse the repository at this point in the history
Create layouts page
  • Loading branch information
clukhei authored Jan 9, 2024
2 parents eedc9e6 + 77f5afc commit 7a1b3f6
Show file tree
Hide file tree
Showing 324 changed files with 7,128 additions and 2,628 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.8.0
File renamed without changes.
File renamed without changes.
23 changes: 11 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "1.0.0",
"description": "",
"repository": {
"type": "git",
"url": "https://github.com/govtechsg/sgds.git"
"type": "git",
"url": "https://github.com/govtechsg/sgds.git"
},
"license": "MIT",
"author": "Tey Liang Tai",
Expand All @@ -23,16 +23,15 @@
"react-select:dev": "cd lib/sgds-x-family && npm run react-select:dev"
},
"devDependencies": {
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"concurrently": "^7.0.0",
"cz-conventional-changelog": "^3.3.0",
"husky": "^8.0.1"
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"concurrently": "^7.0.0",
"cz-conventional-changelog": "^3.3.0",
"husky": "^8.0.1"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
}

}
13 changes: 13 additions & 0 deletions portal/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SGDS Portal powered with Jekyll

This is a static site build with jekyll

## Image compression

Image compression helps to reduce the bundle size of the images with lossless in quality.
Imagemin library plugins are used to generate this. This process will take some time, so it is only recommended to run in production builds.

When you are adding new images to the portal
- Add new images to `assets/uncompressed-image` folder
- Run `npm run build`. Webpack in production mode will run imagemin plugins to generate compressed images into `img` folder
- `npm run dev` to start your development work
17 changes: 17 additions & 0 deletions portal/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ plugins:

collections_dir: collections
collections:
layouts:
permalink: /:collection/:name
output: true
category: layouts
order:
- template-grid.html
- side-navigation-area.html
- content-area.html
- table-of-content-area.html
components:
permalink: /:collection/:name
output: true
Expand Down Expand Up @@ -78,6 +87,14 @@ collections:

# set all patterns collection to use certain layouts
defaults:
-
scope:
type: "layouts"
values:
layout: "layout-sidenav"
pageCategory: "layouts"
source-grid: false
toc: true
-
scope:
type: "patterns"
Expand Down
3 changes: 3 additions & 0 deletions portal/_data/navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
- title: patterns
url: /patterns/
has-collection: true
- title: layouts
url: /layouts/
has-collection: true
- title: templates
url: /templates/
has-collection: true
Expand Down
20 changes: 20 additions & 0 deletions portal/_includes/layouts/layout-code-snippet.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<div class="sgds-example">
{{include.display}}
</div>
<div class="sgds accordion code-snippet no-toc-section" id="example-{{include.name}}">
<div class="accordion-item">
<h2 class="accordion-header" id="heading-{{include.name}}">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
data-bs-target="#collapse-{{include.name}}" aria-expanded="false"
aria-controls="collapse-{{include.name}}">
See Code
</button>
</h2>
<div id="collapse-{{include.name}}" class="accordion-collapse collapse"
aria-labelledby="heading-{{include.name}}" data-bs-parent="#example-{{include.name}}">
<div class="accordion-body accordion-body-codesnippet">
{%- highlight html -%}{{include.code}}{%- endhighlight -%}
</div>
</div>
</div>
</div>
1 change: 1 addition & 0 deletions portal/_includes/page-overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{% include breadcrumb.html %}
<h1 class="title">{{page.title}}</h1>
<p>{{page.description}}</p>
{{include.description}}

<div class="sgds form-control-group mt-4">
<input
Expand Down
3 changes: 2 additions & 1 deletion portal/assets/custom-css/utilities/_all.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import "sticky";
@import "sgds-example";
@import "highlight";
@import "highlight";
@import "code-font";
8 changes: 8 additions & 0 deletions portal/assets/custom-css/utilities/_code-font.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.sgds-code-font {
font-family: 'Courier New', Courier, monospace;
font-weight: 400;
border: 1px solid var(--sgds-gray-300);
background-color: var(--sgds-gray-100);
border-radius: 8px;
padding: 6px 8px 6px 8px;
}
11 changes: 6 additions & 5 deletions portal/assets/custom-css/utilities/_sgds-example.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.sgds-example {
overflow-x: auto;
border: 1px solid var(--sgds-gray-400);
border-top-left-radius: 5px;
border-top-right-radius: 5px;
Expand Down Expand Up @@ -73,12 +74,12 @@
border-radius: $border-radius;
}
&-grid {
display: grid;
// display: grid;
// grid-template-columns: repeat(2, 1fr);
grid-auto-flow: column;
grid-auto-columns: max-content;
gap: 1rem;
place-items: center;
// grid-auto-flow: column;
// grid-auto-columns: max-content;
// gap: 1rem;
// place-items: center;
img,
svg {
max-width: 100%;
Expand Down
13 changes: 1 addition & 12 deletions portal/assets/img/component/accordion/anatomy-accordion-1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 1 addition & 16 deletions portal/assets/img/component/accordion/anatomy-accordion-2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 1 addition & 36 deletions portal/assets/img/component/accordion/spacing-accordion-1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 1 addition & 32 deletions portal/assets/img/component/accordion/spacing-accordion-2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 1 addition & 20 deletions portal/assets/img/component/alert/anatomy-alert-1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 1 addition & 33 deletions portal/assets/img/component/alert/spacing-alert-1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 1 addition & 20 deletions portal/assets/img/component/badge/anatomy-badge-1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 1 addition & 18 deletions portal/assets/img/component/badge/spacing-badge-1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 7a1b3f6

Please sign in to comment.