This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require("path"); | |
const dotenv = require("dotenv"); | |
// Register envars for dev, test, live or local if available | |
switch(process.env.BACKEND_ENV) { | |
case 'dev': | |
dotenv.config({ path: path.resolve(process.cwd(), '.env.dev') }) | |
case 'test': | |
dotenv.config({ path: path.resolve(process.cwd(), '.env.test') }) | |
case 'live': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The require statement and the block within module.exports should be added to | |
// ./storybook/webpack.config.js | |
// Written for Gatsby v2 Storybook v5 | |
const path = require("path"); | |
module.exports = ({ config }) => { | |
// Update for SASS / CSS Modules support - minor adjustments to snippet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { storiesOf } from '@storybook/react'; | |
import { action } from '@storybook/addon-actions'; | |
import { text } from '@storybook/addon-knobs'; | |
import template from './TestTwig.twig'; | |
import chip from '~../../../twig-assets/e-chip.twig'; | |
const templateTwig = ( | |
chip({ | |
description: 'Description', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section class="m-facet-checkboxes block-facet--checkbox"> | |
<h2 class="block-title">{{ facet_checkboxes.block_title }}</h2> | |
<ul class="js-facets-checkbox-links"> | |
{% for item in facet_checkboxes.checkboxes %} | |
{% set counter = ( counter | default(0) ) + 1 %} | |
<li class="facet-item"> | |
<input type="checkbox" class="facets-checkbox" tabindex="{{ counter }}" id="{{ item.id }}"> | |
<label for="{{ item.id }}"> | |
<span class="facet-item__value">{{ item.label }}</span> | |
{% if item.count %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
card: | |
label: Card | |
description: Display content in a card format | |
fields: | |
image: | |
type: text | |
label: Image | |
description: Image field. | |
preview: <img src="https://raw.githubusercontent.com/thoughtbot/refills/master/source/images/mountains.png" alt="Card Image"> | |
header: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# Force caching for entities we’re not rendering #} | |
{% set catch_cache = content.field_season|render %} | |
{% set season = content.field_season|field_target_entity %} | |
{# Can now access fields on the referenced practice entity like… #} | |
{% include "@molecules/card/card.twig" | |
with { | |
"img_src": file_url(content.field_image|field_target_entity.uri.value), | |
"img_alt": content.field_image|field_raw('alt'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% set catch_cache = content.field_image|render %} | |
{% include "@molecules/card/card.twig" | |
with { | |
"img_src": file_url(content.field_image|field_target_entity.uri.value), | |
"img_alt": content.field_image|field_raw('alt'), | |
"header": label|field_value, | |
"copy": content.body|field_value | |
} | |
%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.card { | |
$base-border-color: gainsboro !default; | |
$base-border-radius: 3px !default; | |
$base-background-color: white !default; | |
$base-spacing: 1.5em !default; | |
$action-color: #477DCA !default; | |
$dark-gray: #333 !default; | |
$base-font-color: $dark-gray !default; | |
$card-border-color: $base-border-color; | |
$card-border: 1px solid $card-border-color; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@include breakpoint(large) { | |
.background { | |
padding-top: 1rem; | |
background: url('../images/centura/background.svg'); | |
background-size: 60%; | |
background-repeat: no-repeat; | |
} | |
.o-icon-grid { | |
border: 0; | |
background-color: transparent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# Prep specialties for display #} | |
{# TODO - Convert to field_target_entity_join custom twig filter #} | |
{# Get the render array for specialty taxonomy terms - this may be a single | |
object, or may be an array of objects #} | |
{% set entity = content.field_physician_specialty|field_target_entity %} | |
{# If we only have one value, set it #} | |
{% if entity.name.value is defined %} | |
{% set specialties = entity.name.value %} | |
{# If we have multiple values, iterate through and delimit #} | |
{% else %} |
NewerOlder