Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
250 commits
Select commit Hold shift + click to select a range
57efa2b
✨ Dynamically render blog posts on homepage
matthiasrohmer Nov 5, 2021
f3906ed
🐛 Link blog posts from home to detail pages
matthiasrohmer Nov 5, 2021
69ebc51
Merge pull request #57 from ampproject/bug/documentation-layout
matthiasrohmer Nov 5, 2021
2799c71
🎨 Make blog navigation usable
matthiasrohmer Nov 5, 2021
ce3010b
Merge pull request #59 from ampproject/fix/blog-navigation
sebastianbenz Nov 5, 2021
5f26e64
Merge pull request #58 from ampproject/feature/render-blog-posts
sebastianbenz Nov 5, 2021
60ff086
Fix accessibility and best practices issues
MarcoABCorrea Nov 5, 2021
56889a9
Post banner change
MarcoABCorrea Nov 5, 2021
8643e67
Code review
MarcoABCorrea Nov 5, 2021
b84f175
Merge pull request #60 from ampproject/bug/lighthouse
MarcoABCorrea Nov 5, 2021
413a4aa
Merge pull request #61 from ampproject/bug/post-banner
MarcoABCorrea Nov 5, 2021
c4ba872
add copy to clipboard button
sebastianbenz Nov 5, 2021
228dda6
Fix demos on homepage
sebastianbenz Nov 5, 2021
8470b17
avoid clipboard css being purged
sebastianbenz Nov 5, 2021
df8a251
Update dependency eslint to v8.2.0
renovate[bot] Nov 6, 2021
f0b3d98
Merge pull request #62 from ampproject/clipboard
matthiasrohmer Nov 8, 2021
7a08b83
Merge pull request #63 from ampproject/fix-demos
matthiasrohmer Nov 8, 2021
53296c1
Add page not found
MarcoABCorrea Nov 8, 2021
e4ab16c
add meta description
sebastianbenz Nov 8, 2021
2bb2d4a
Code review
MarcoABCorrea Nov 8, 2021
352f8ee
Fixing path
MarcoABCorrea Nov 8, 2021
86f4a84
Merge pull request #65 from ampproject/feature/page-not-found
sebastianbenz Nov 8, 2021
4db21d8
update docs
sebastianbenz Nov 8, 2021
0bb8c70
ignore all js flags
sebastianbenz Nov 8, 2021
d9f27e8
Merge pull request #69 from ampproject/fix-menu
sebastianbenz Nov 8, 2021
fa22903
Get Started | Image first on mobile
MarcoABCorrea Nov 8, 2021
eab7467
Components | Spacing & Links
MarcoABCorrea Nov 8, 2021
b450f6f
Documentation | Card styles & Spacings
MarcoABCorrea Nov 8, 2021
6d42a97
vue.js bento-accordion example
dmanek Nov 8, 2021
cf9fc57
Home | Breakpoints & style fix
MarcoABCorrea Nov 9, 2021
d53cf37
Merge pull request #71 from ampproject/bug/general-layout
sebastianbenz Nov 9, 2021
5f4ba2c
Merge pull request #67 from ampproject/desc
matthiasrohmer Nov 9, 2021
f010d5b
small getting started fixes
sebastianbenz Nov 9, 2021
568ab5e
✨ Add guide section and first guide
matthiasrohmer Nov 9, 2021
96a8492
Merge pull request #72 from ampproject/get-started
matthiasrohmer Nov 9, 2021
54029d6
Merge pull request #73 from ampproject/feat/add-guides
matthiasrohmer Nov 9, 2021
a7367bc
add link to stylesheet
dmanek Nov 10, 2021
14a53ee
update readme.md
dmanek Nov 10, 2021
c34d466
Merge pull request #70 from ampproject/vue-js-example
dmanek Nov 10, 2021
1fd8494
update docs
sebastianbenz Nov 11, 2021
b311244
Fix breakpoints on large displays for Home & Start
MarcoABCorrea Nov 11, 2021
2c9ebf5
Fix accessibility issues
MarcoABCorrea Nov 11, 2021
f47ddbc
Documentation breakpoints
MarcoABCorrea Nov 11, 2021
2fd8d61
support new example syntax
sebastianbenz Nov 11, 2021
750a31a
Merge pull request #76 from ampproject/bug/breakpoints
sebastianbenz Nov 11, 2021
4bf4c7b
Merge pull request #77 from ampproject/example-iomport
sebastianbenz Nov 11, 2021
310b1ef
fix example formatting
sebastianbenz Nov 11, 2021
33d7f8c
Fix card styles
MarcoABCorrea Nov 11, 2021
1d6f03c
Fix transitions and shadows
MarcoABCorrea Nov 11, 2021
305b63f
Blog post image display
MarcoABCorrea Nov 12, 2021
284b9ea
Merge pull request #78 from ampproject/bug/card-layout
sebastianbenz Nov 12, 2021
bb76a13
✨ Add tasks to import hero examples
matthiasrohmer Nov 12, 2021
a1ef7a2
Merge branch 'main' into feat/hero-examples
matthiasrohmer Nov 12, 2021
5a1ff27
re-enable doc home toc
sebastianbenz Nov 12, 2021
20295bc
import docs
sebastianbenz Nov 12, 2021
a17fbc7
hide TOC on doc home
sebastianbenz Nov 12, 2021
e8d3f50
Don't use Bento prefix for component listings
sebastianbenz Nov 12, 2021
3e4b013
🎨 Inject hero examples in docs
matthiasrohmer Nov 12, 2021
b59f59d
✨ Render hero examples in component docs
matthiasrohmer Nov 12, 2021
cd4c3cb
Merge branch 'main' into feat/hero-examples
matthiasrohmer Nov 12, 2021
4ed6b01
🎨 Update imported docs
matthiasrohmer Nov 12, 2021
c74fe6a
Merge pull request #80 from ampproject/feat/hero-examples
sebastianbenz Nov 12, 2021
6e5fa61
clean up
sebastianbenz Nov 12, 2021
dbe818b
rename base carousel component
sebastianbenz Nov 12, 2021
793e7a5
import all hero example files
sebastianbenz Nov 12, 2021
1d72f7e
Hero examples: show preview first
sebastianbenz Nov 12, 2021
59081c0
Merge pull request #81 from ampproject/hero
sebastianbenz Nov 12, 2021
02764fa
add correct images
sebastianbenz Nov 12, 2021
fb4d753
Merge pull request #82 from ampproject/guide-images
sebastianbenz Nov 12, 2021
7754f87
add import task
sebastianbenz Nov 12, 2021
ab89f3c
import as part of deploy
sebastianbenz Nov 12, 2021
ba1fb0b
Fix demo layouts
MarcoABCorrea Nov 15, 2021
7b60887
Merge pull request #83 from ampproject/bug/demo-layout
sebastianbenz Nov 15, 2021
4c3754a
fix preview hiding on double tap
sebastianbenz Nov 15, 2021
a026e1a
add next.js guide
sebastianbenz Nov 15, 2021
9bf31e1
fix formatting issues
sebastianbenz Nov 15, 2021
ab98ecf
Merge pull request #84 from ampproject/next-guide
sebastianbenz Nov 15, 2021
2cfa84b
add importall script
sebastianbenz Nov 15, 2021
19ffc2d
add getting started nextjs example
dethstrobe Nov 15, 2021
0c7c3a7
Merge pull request #64 from ampproject/renovate/eslint-8.x
sebastianbenz Nov 15, 2021
9d3e5db
Update web-component.njk
alanorozco Nov 16, 2021
4ff9aa3
Merge pull request #85 from ampproject/importall
matthiasrohmer Nov 16, 2021
679d96c
Merge pull request #87 from alanorozco/patch-2
sebastianbenz Nov 16, 2021
df61fc5
♻️ Do not use bento-sidebar toolbar-target feature
matthiasrohmer Nov 16, 2021
be372c4
Merge pull request #88 from ampproject/perf/sidebars
sebastianbenz Nov 16, 2021
5b46c51
import docs
sebastianbenz Nov 16, 2021
3c04e78
add layout guide
sebastianbenz Nov 16, 2021
9064486
Merge pull request #86 from dethstrobe/nextjs
sebastianbenz Nov 16, 2021
9d88f61
rename next.js dir
sebastianbenz Nov 16, 2021
1dc29d0
Fix copy
sebastianbenz Nov 16, 2021
f6bf65f
clean up animations
sebastianbenz Nov 16, 2021
87a7f9d
Add usage section to docs
MarcoABCorrea Nov 17, 2021
96b93de
Adding title for iframes and copy buttons
MarcoABCorrea Nov 17, 2021
22aebd0
Merge pull request #100 from ampproject/bug/accessibility-fix
sebastianbenz Nov 17, 2021
1f2787d
Merge pull request #91 from ampproject/get-started
sebastianbenz Nov 17, 2021
ea1b259
Merge pull request #90 from ampproject/layout-guide
sebastianbenz Nov 17, 2021
af8d8be
Style fix for documentation table
MarcoABCorrea Nov 18, 2021
66909fe
Adding script to auto inject usage buttons
MarcoABCorrea Nov 18, 2021
7f5bf6f
Merge pull request #101 from ampproject/bug/doc-table
sebastianbenz Nov 18, 2021
e36c638
update imports
sebastianbenz Nov 17, 2021
78c0215
update imports
sebastianbenz Nov 18, 2021
4c8284f
Fix regex for usage
MarcoABCorrea Nov 18, 2021
35fcd66
Merge pull request #98 from ampproject/feature/usage-section
sebastianbenz Nov 18, 2021
9c77fb4
better whitespace formatting
sebastianbenz Nov 18, 2021
ec18e0a
Revert "rename next.js dir"
sebastianbenz Nov 18, 2021
09fec57
rename next.js sample (for real)
sebastianbenz Nov 18, 2021
83fe835
Merge pull request #102 from ampproject/next.js-sample
sebastianbenz Nov 18, 2021
a009427
update hero examples
sebastianbenz Nov 18, 2021
18c5de7
add vue guide
sebastianbenz Nov 18, 2021
01038f3
Merge pull request #103 from ampproject/vue-guide
sebastianbenz Nov 18, 2021
77f0581
add Eleventy guide
sebastianbenz Nov 19, 2021
4229437
update imports
sebastianbenz Nov 19, 2021
a92a9b5
add eleventy sample
sebastianbenz Nov 19, 2021
85d19c6
removing selector outline | Safari bug
MarcoABCorrea Nov 19, 2021
4bbee8e
remove gitignore from example
sebastianbenz Nov 19, 2021
81f8aa4
improved wording
sebastianbenz Nov 19, 2021
4dee988
ignore eleventy generated files
sebastianbenz Nov 19, 2021
989ed5d
Merge pull request #105 from ampproject/eleventy-guide
sebastianbenz Nov 19, 2021
106da23
fix syntax highlighting
sebastianbenz Nov 19, 2021
ddf33f3
Merge pull request #106 from ampproject/fix-vue
sebastianbenz Nov 19, 2021
c2024f2
Various fixes
sebastianbenz Nov 19, 2021
e9f99ea
import docs
sebastianbenz Nov 19, 2021
75f3291
Nomalizing content sizing in all pages
MarcoABCorrea Nov 19, 2021
74a57e6
Prepare blog
sebastianbenz Nov 19, 2021
2d5931b
minify html
sebastianbenz Nov 19, 2021
282a609
add analytics
sebastianbenz Nov 19, 2021
7edf3b0
Add analytics and cookie consent
sebastianbenz Nov 19, 2021
e4bcd22
🚧 Start working on a collapsible head for code snippets
matthiasrohmer Nov 22, 2021
63263f5
✨ Add who-am-i endpoint
matthiasrohmer Nov 22, 2021
e8d9b79
pin versions
sebastianbenz Nov 22, 2021
1884a63
Merge pull request #110 from ampproject/consent
matthiasrohmer Nov 22, 2021
dcc0fc6
Merge pull request #109 from ampproject/minify-html
sebastianbenz Nov 22, 2021
edc86c7
Merge pull request #113 from ampproject/feature/who-am-i
matthiasrohmer Nov 22, 2021
558e842
remove localhost link
sebastianbenz Nov 22, 2021
f1b1139
update remote
sebastianbenz Nov 22, 2021
bc9f005
Merge pull request #108 from ampproject/blo
sebastianbenz Nov 22, 2021
2488180
update package-lock
sebastianbenz Nov 22, 2021
f62a3d7
ignore banner rules
sebastianbenz Nov 22, 2021
82c653f
Adressed lighthouse issues
sebastianbenz Nov 22, 2021
b3b65cd
align ok button right
sebastianbenz Nov 22, 2021
206debd
Merge branch 'main' into feat/collapsible-head
matthiasrohmer Nov 23, 2021
7cf78de
✨ Make head and body collapsible in standalone examples
matthiasrohmer Nov 23, 2021
f4a47eb
🔇 Remove debug logs
matthiasrohmer Nov 23, 2021
7c03799
🎨 Adapt hero example to new scheme
matthiasrohmer Nov 23, 2021
a5f05d0
Fix toc display on documentation page
MarcoABCorrea Nov 23, 2021
8770703
Merge pull request #107 from ampproject/bug/layout-fix
sebastianbenz Nov 23, 2021
433df59
Merge pull request #116 from ampproject/feat/collapsible-head
sebastianbenz Nov 24, 2021
c50487d
Updating styles
MarcoABCorrea Nov 23, 2021
f5c920d
Fix colors contrast
MarcoABCorrea Nov 23, 2021
76a6470
More lighthouse fixes
MarcoABCorrea Nov 23, 2021
0d2961c
Fix overflow logic
MarcoABCorrea Nov 24, 2021
177e9bb
Merge pull request #115 from ampproject/bug/more-layout
sebastianbenz Nov 24, 2021
677aef7
update remote
sebastianbenz Nov 24, 2021
16b2958
fix contrast for 3p image
sebastianbenz Nov 24, 2021
569d486
fix css for banner close
sebastianbenz Nov 24, 2021
0396d2c
Add sitemap and robots.txt
sebastianbenz Nov 24, 2021
9be9988
Merge pull request #122 from ampproject/seo
sebastianbenz Nov 24, 2021
6e20bdd
disallow all on staging
sebastianbenz Nov 24, 2021
efec01a
correctly set env on build
sebastianbenz Nov 24, 2021
490aeb7
add origin to sitemap
sebastianbenz Nov 24, 2021
6e9234d
update docs
sebastianbenz Nov 24, 2021
17ddcad
Improving styling on doc page
MarcoABCorrea Nov 26, 2021
7c81416
Merge pull request #125 from ampproject/bug/doc-styling
sebastianbenz Nov 26, 2021
61bcef3
Let guide URLs end on slash
sebastianbenz Nov 26, 2021
543b2e7
Ignore 404 page and hello world blog post
sebastianbenz Nov 29, 2021
bb5dee7
Fix nomodule import
sebastianbenz Nov 29, 2021
57b5657
Merge pull request #129 from ampproject/fix-nomodule
matthiasrohmer Nov 29, 2021
65a4e07
Merge pull request #128 from ampproject/noindex
sebastianbenz Nov 29, 2021
95a4cb3
update docs to use @bentoproject
dethstrobe Nov 29, 2021
eab88fb
Merge pull request #130 from dethstrobe/fix/ampprojectToBentoProject
kristoferbaxter Nov 29, 2021
d9b8dbb
Add hidden attribute to bento-sidebar instances
westonruter Nov 29, 2021
97e92e5
Add hidden attribute to bento-lightbox examples
westonruter Nov 29, 2021
f02eeab
Merge pull request #131 from westonruter/add/hidden-for-nodisplay
sebastianbenz Nov 29, 2021
35cc95a
import docs
sebastianbenz Nov 29, 2021
8b3acfa
Remove lorem ipsum
sebastianbenz Nov 30, 2021
e27dc9f
Fix safari spacings
MarcoABCorrea Dec 2, 2021
1ea9666
Merge pull request #133 from ampproject/bug/safari-spacings
sebastianbenz Dec 2, 2021
ee667ab
New layout for Documentation Overview Page
MarcoABCorrea Dec 2, 2021
4f6bb2d
Code review: Changing namings
MarcoABCorrea Dec 3, 2021
161c396
Merge pull request #134 from ampproject/feature/doc-overview-layout
sebastianbenz Dec 3, 2021
f6d2d06
Fix link in README
rileyajones Dec 3, 2021
29cc7f5
Merge pull request #136 from rileyajones/patch-1
sebastianbenz Dec 4, 2021
525fd41
import docs
sebastianbenz Dec 6, 2021
8a7bc4c
Link to bento project
sebastianbenz Dec 6, 2021
63a0e70
🍱 Updating docs.
matthiasrohmer Dec 6, 2021
11a4502
Rename to bentojs.dev
kristoferbaxter Dec 6, 2021
b0d93ee
Merge pull request #138 from ampproject/kristoferbaxter-patch-1
sebastianbenz Dec 6, 2021
b94fe7b
Bentojs.dev rename
kristoferbaxter Dec 6, 2021
f8ae208
Bentojs.dev rename
kristoferbaxter Dec 6, 2021
a0dab78
Bentojs.dev Rename
kristoferbaxter Dec 6, 2021
2c7b78f
Bentojs.dev Rename
kristoferbaxter Dec 6, 2021
e546913
Bentojs.dev Rename
kristoferbaxter Dec 6, 2021
a691a84
Merge pull request #139 from ampproject/kristoferbaxter-patch-2
sebastianbenz Dec 6, 2021
8c5f8b8
Merge pull request #141 from ampproject/kristoferbaxter-patch-4
kristoferbaxter Dec 6, 2021
63aa20b
Merge pull request #140 from ampproject/kristoferbaxter-patch-3
kristoferbaxter Dec 6, 2021
99fd19f
Merge pull request #142 from ampproject/kristoferbaxter-patch-5
kristoferbaxter Dec 6, 2021
41953ee
Merge pull request #143 from ampproject/kristoferbaxter-patch-6
kristoferbaxter Dec 6, 2021
400f82f
add blog post
sebastianbenz Dec 3, 2021
309fc5f
fix sample layout
sebastianbenz Dec 3, 2021
9bdd7ce
render all hero examples
sebastianbenz Dec 4, 2021
1da1184
remove intro hero sample
sebastianbenz Dec 4, 2021
69f0efb
v2
sebastianbenz Dec 6, 2021
bede594
use correct npm org
sebastianbenz Dec 7, 2021
f9e218c
Merge pull request #146 from ampproject/npm
kristoferbaxter Dec 7, 2021
ed02ccb
Adding copy button to get started page
MarcoABCorrea Dec 7, 2021
cbfca3e
Merge pull request #135 from ampproject/blog
sebastianbenz Dec 7, 2021
dc95185
import docs
sebastianbenz Dec 7, 2021
569e20c
migrate yaml load
sebastianbenz Dec 7, 2021
c4c6677
add high res social image
sebastianbenz Dec 7, 2021
e102287
add blog post hero image
sebastianbenz Dec 7, 2021
229aa4b
fix date
sebastianbenz Dec 7, 2021
63f7565
add link to AMP blog
sebastianbenz Dec 7, 2021
6cfd32c
Refactoting copy logic to a more generic approach
MarcoABCorrea Dec 8, 2021
93cb197
Merge pull request #147 from ampproject/feature/get-started-copy
sebastianbenz Dec 8, 2021
e9d8b2a
update blog post
sebastianbenz Dec 8, 2021
e9b0dc0
Fix markdown
sebastianbenz Dec 8, 2021
fa3b160
Fix broken link for GitHub discussions
dmanek Dec 8, 2021
7b19b01
Merge pull request #152 from ampproject/dmanek-patch-1
sebastianbenz Dec 8, 2021
bcef31a
don't mix title and non-title case
sebastianbenz Dec 8, 2021
c4e3451
fix markdown formatting error
sebastianbenz Dec 8, 2021
ec5f81d
redirect bento-base-carousel
sebastianbenz Dec 8, 2021
51189cf
fix sitemap links
sebastianbenz Dec 9, 2021
a9a9c63
✨ Set up parallel next.js project to render component samples
matthiasrohmer Dec 9, 2021
8cc1c9a
➕ Add espree, next.js and bento components as dependencies
matthiasrohmer Dec 9, 2021
b2237c8
🙈 Add next.js build artifacts
matthiasrohmer Dec 9, 2021
746451e
👽 Adapt to new template structure
matthiasrohmer Dec 9, 2021
62c72a6
💥 Rewrite Example shortcode using class based approach
matthiasrohmer Dec 9, 2021
22694d7
💩 Add markdown-it-container to work around random p elements being added
matthiasrohmer Dec 9, 2021
ee50b6b
🎨 Update templates for example partials
matthiasrohmer Dec 9, 2021
6e947ff
✨ Add demo JS example to bento-accordion doc
matthiasrohmer Dec 9, 2021
8be21a3
🍱 Update imported component docs
matthiasrohmer Dec 9, 2021
fbf8f35
Merge branch 'main' into feat/react-examples
matthiasrohmer Dec 9, 2021
cf81626
👌 Implement requested changes
matthiasrohmer Dec 10, 2021
ba9c5cc
Merge pull request #153 from ampproject/feat/react-examples
sebastianbenz Dec 13, 2021
bda4045
update docs
sebastianbenz Dec 13, 2021
bc3bc2b
use jsx prefix for react
sebastianbenz Dec 13, 2021
88fec5b
run prettier
sebastianbenz Dec 13, 2021
38288b1
Separate {% endexample %} from code blocks
isalconost Jan 5, 2022
f7da1eb
Add support for explicit id attributes of headings
isalconost Jan 8, 2022
7764e3c
Merge pull request #162 from alconost-l10n/anchor-i18n
sebastianbenz Jan 10, 2022
9c8bc39
Merge branch 'ampproject:main' into endexample
ilyaspiridonov Jan 12, 2022
9f4ee18
Separate {% endexample %} tags from code blocks in the docs import sc…
isalconost Jan 12, 2022
0b59e78
Merge pull request #161 from alconost-l10n/endexample
sebastianbenz Jan 12, 2022
4a8b89f
update reference docs
sebastianbenz Jan 17, 2022
bad3297
Remove HTML Tag from post title
samouri Feb 1, 2022
b103c52
Update introducing-bento-component.md
samouri Feb 1, 2022
b90853e
Merge pull request #172 from samouri/samouri-patch-1
sebastianbenz Feb 1, 2022
d3ca1a7
update docs and dependencies
sebastianbenz Feb 2, 2022
f4d22ad
update build paths to include src/bento/components
rileyajones Feb 7, 2022
64ea200
Merge pull request #175 from rileyajones/add-bento-components-dir
sebastianbenz Feb 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 46 additions & 1 deletion .eleventy.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
const markdownIt = require('markdown-it');
const markdownItAnchor = require('markdown-it-anchor');
const markdownItContainer = require('./third-party/@gerhobbelt/markdown-it-container');
const pluginRss = require('@11ty/eleventy-plugin-rss');

const syntaxHighlight = require('@11ty/eleventy-plugin-syntaxhighlight');
const toc = require('eleventy-plugin-toc');

const imageShortcode = require('./site/_shortcodes/Image.js');
const iframeShortcode = require('./site/_shortcodes/Iframe.js');
const noOpShortCode = require('./site/_shortcodes/NoOp.js');
const {
exampleShortCode,
writeExamples,
} = require('./site/_shortcodes/Example.js');
const {heroExampleShortcode} = require('./site/_shortcodes/HeroExample.js');

const {i18n} = require('./site/_filters/i18n');
const md = require('./site/_filters/md');
const date = require('./site/_filters/date.js');

const insertStyles = require('./site/_transforms/insertStyles.js');
const minifyHtml = require('./site/_transforms/minifyHtml.js');

const components = require('./site/_collections/components.js');
const componentCategories = require('./site/_collections/componentCategories.js');
const highlights = require('./site/_collections/highlights.js');
const guides = require('./site/_collections/guides.js');

const notFound = require('./site/_config/404.js');

const isProduction = process.env.NODE_ENV === 'production';
global.__basedir = __dirname;
Expand All @@ -36,33 +44,70 @@ module.exports = (eleventyConfig) => {
'md',
markdownIt({
html: true,
breaks: true,
})
.use(markdownItAnchor)


// Let folks customize markdown output with attributes (id, class, data-*)
.use(require('markdown-it-attrs'), {
leftDelimiter: '{:',
rightDelimiter: '}',
allowedAttributes: ['id', 'class', /^data-.*$/],
})

// Automatically add anchors to headings
/*
.use(require('markdown-it-anchor'), {
level: 2,
permalink: true,
permalinkClass: 'w-headline-link',
permalinkSymbol: '#',
// @ts-ignore
slugify: (s) => slugify(s, {lower: true}),
})
*/

.use(markdownItContainer, 'raw', {
render: (tokens, idx) => {
return '\n';
},
content: (tokens, idx) => {
return tokens[idx].markup;
},
})
.disable('code')
);

eleventyConfig.addPlugin(pluginRss);
eleventyConfig.addPlugin(syntaxHighlight);
eleventyConfig.addPlugin(toc);

eleventyConfig.addNunjucksAsyncShortcode('image', imageShortcode);
eleventyConfig.addShortcode('iframe', iframeShortcode);
eleventyConfig.addJavaScriptFunction('image', imageShortcode);
eleventyConfig.addPairedShortcode('tip', noOpShortCode);
eleventyConfig.addNunjucksTag('examples', exampleShortCode);
eleventyConfig.addNunjucksTag('heroexample', heroExampleShortcode);

eleventyConfig.addFilter('date', date);
eleventyConfig.addFilter('i18n', i18n);
eleventyConfig.addFilter('md', md);

eleventyConfig.addTransform('insert-styles', insertStyles);
eleventyConfig.addTransform('minify-html', minifyHtml);

eleventyConfig.addCollection('components', components);
eleventyConfig.addCollection('componentCategories', componentCategories);
eleventyConfig.addCollection('highlights', highlights);
eleventyConfig.addCollection('guides', guides);

eleventyConfig.on('afterBuild', writeExamples);

eleventyConfig.setBrowserSyncConfig(notFound);

return {
templateFormats: ['njk', 'md'],
templateFormats: ['njk', 'md', '11ty.js'],
htmlTemplateEngine: 'njk',
markdownTemplateEngine: 'njk',
dir: {
Expand Down
1 change: 1 addition & 0 deletions .eleventyignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
site/de
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": ["prettier"],
"plugins": ["prettier", "plugin:@next/next/recommended"],
"rules": {
"max-len": [
2,
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,12 @@ temp
/assets/js/
.DS_Store
.vscode

/examples/next.js/.next
/examples/next.js/out

/examples/react/.next
/examples/react/out
/examples/react/pages/**/*
!/examples/react/pages/_app.js

7 changes: 4 additions & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
amphtml/**/*
site/*/components/**
dist/
node_modules/
amphtml/
site/*/components/**
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# bento.dev
# bentojs.dev

The official homepage of the Bento.

## Contributing

We welcome contributions to bento.dev.

- **Bug reports and feature requests:** something missing or not working on [bento.dev](https://bento.dev)? Please file an issue [here](https://github.com/ampproject/bento.dev/issues/new).
- **Bug reports and feature requests:** something missing or not working on [bentojs.dev](https://bentojs.dev)? Please file an issue [here](https://github.com/ampproject/bento.dev/issues/new).

## Setup

Expand All @@ -20,15 +20,15 @@ We welcome contributions to bento.dev.

### Fork & clone the repository

To get started with contributing to bento.dev, you first need to [fork the repository](https://help.github.com/en/articles/fork-a-repo). Once you've done that you can clone the repository:
To get started with contributing to bentojs.dev, you first need to [fork the repository](https://help.github.com/en/articles/fork-a-repo). Once you've done that you can clone the repository:

```sh
$ git clone --recurse-submodules git@github.com:YOUR-USERNAME/bento.dev.git
$ git clone --recurse-submodules git@github.com:YOUR-USERNAME/bentojs.dev.git
```

... and then install the dependencies via NPM:

```sh
$ cd bento.dev
$ cd bentojs.dev
$ npm install
```
2 changes: 1 addition & 1 deletion amphtml
Submodule amphtml updated 1852 files
6 changes: 6 additions & 0 deletions app/bundles/all.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import '../components/AnnouncementBanner';
import CopyToClipboard from '../components/CopyToClipboard';
import Header from '../components/Header';

window.addEventListener('load', () => {
new Header(document.querySelector('.bd-header'));

for (codeSnippet of document.querySelectorAll('.bd-copy-pasteable > pre')) {
new CopyToClipboard(codeSnippet);
}
});
4 changes: 2 additions & 2 deletions app/bundles/documentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ window.addEventListener('load', () => {
document.getElementById('bd-button-toc')
);

for ($example of document.querySelectorAll('.bd-example')) {
new Example($example);
for (example of document.querySelectorAll('.bd-example')) {
new Example(example);
}
});
2 changes: 1 addition & 1 deletion app/bundles/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import HomeDemo from '../components/HomeDemo';
window.addEventListener('load', () => {
new HomeDemo(
document.getElementById('bd-demo-selector'),
document.querySelectorAll('.bd-demo-code-sample'),
document.getElementById('bd-demo-source-selector'),
document.getElementById('bd-demo-iframe')
);
});
42 changes: 42 additions & 0 deletions app/components/AnnouncementBanner.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Based on https://github.com/zachleat/herald-of-the-dog/blob/main/herald.js with modifications
*/
class Banner extends HTMLElement {
connectedCallback() {
// No matter when this runs, the close button will not be visible
// until after this class is added—prevents ghost clicks on the button
// before the event listener is added.
this.classList.add('banner--show-close');

this.addEventListener('click', (e) => {
if (e.target.closest('[data-banner-close]')) {
this.savePreference();
this.close();
}
});
}

getButton() {
return this.querySelector('[data-banner-close]');
}

savePreference() {
let storageKey = this.getAttribute('data-banner-key');
if (!storageKey) {
const cta = this.querySelector('a[href]');
if (cta) {
storageKey = cta.getAttribute('href');
}
}

if (storageKey) {
localStorage.setItem('banner--cta-url', storageKey);
}
}

close() {
this.classList.add('--hidden');
}
}

window.customElements.define('announcement-banner', Banner);
29 changes: 29 additions & 0 deletions app/components/CopyToClipboard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
class CopyToClipboard {
constructor(element, textToCopy) {
this.element = element;
this.textToCopy = textToCopy;

this.animationDuration = 1000;
window.requestAnimationFrame(() => {
const button = document.createElement('button');
button.classList.add('bd-copy');
button.ariaLabel = 'Copy code';
button.innerHTML = `<svg class="bd-copy-icon-default" xmlns="http://www.w3.org/2000/svg" height="24px" width="24px" fill="#ffffff"><path d="M0 0h24v24H0z" fill="none"/><path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"/></svg>
<svg class="bd-copy-icon-success" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#FFFFFF"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"/></svg>`;
this.element.appendChild(button);
button.addEventListener('click', this.onClick.bind(this));
});
}

async onClick() {
const textToCopy =
this.textToCopy || this.element.querySelector('code').innerText;
await navigator.clipboard.writeText(textToCopy);
this.element.classList.add('--success');
setTimeout(() => {
this.element.classList.remove('--success');
}, this.animationDuration);
}
}

export default CopyToClipboard;
11 changes: 5 additions & 6 deletions app/components/DocumentationSidebar.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
class DocumentationSidebar {
constructor($sidebar, $button) {
this.$sidebar = $sidebar;
this.$button = $button;

constructor(sidebar, button) {
this.sidebar = sidebar;
this.button = button;
this.init();
}

async init() {
await customElements.whenDefined('bento-sidebar');
const api = await this.$sidebar.getApi();
this.$button.addEventListener('click', () => {
const api = await this.sidebar.getApi();
this.button.addEventListener('click', () => {
api.toggle();
});
}
Expand Down
9 changes: 9 additions & 0 deletions app/components/Example.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import CopyToClipboard from '../components/CopyToClipboard';

class Example {
constructor($example) {
this.$example = $example;
Expand All @@ -15,6 +17,13 @@ class Example {
this.$button.preview.addEventListener('click', (e) => {
this.toggle(e, true);
});

let code = '';
for (const codeElement of this.$example.querySelectorAll('pre')) {
code = code + codeElement.innerText;
}

new CopyToClipboard(this.$code, code);
}

toggle(e, force) {
Expand Down
1 change: 1 addition & 0 deletions app/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class Header {
toggle(e, force) {
e.preventDefault();
this.$header.classList.toggle('--mainmenuopen', force);
document.documentElement.classList.toggle('--main-overflow', force);
}
}

Expand Down
47 changes: 15 additions & 32 deletions app/components/HomeDemo.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,24 @@
class HomeDemo {
constructor($selector, $code, $previewEl) {
this.$selector = $selector;
this.$code = Array.from($code);
this.$previewEl = $previewEl;

this.$selector.addEventListener('select', this.toggleDemo.bind(this));
constructor(buttonSelector, sourceSelector, previewEl) {
this.buttonSelector = buttonSelector;
this.sourceSelector = sourceSelector;
this.preview = previewEl;
this.init();
}

toggleDemo(e) {
e.preventDefault();
const previewId = e.data.targetOption;
const button = this.$selector.querySelector(
`button[option='${previewId}']`
);
this.selectButton(button);
this.changePreview(previewId);
async init() {
await customElements.whenDefined('bento-selector');
this.buttonSelector.addEventListener('select', this.toggleDemo.bind(this));
}

selectButton(button) {
const invertedClass = '--inverted';
const buttons = Array.from(this.$selector.querySelectorAll('button'));
buttons.map((btn) => {
btn.classList.add(invertedClass);
});
button.classList.remove(invertedClass);
}
async toggleDemo(event) {
const previewId = event.data.targetOption;

changePreview(previewId) {
const hideClass = '--hide';
const iframeSrc = `assets/iframes/homepage-examples/${previewId}.html`;
this.$previewEl.setAttribute('src', iframeSrc);

this.$code.map((code) => {
code.classList.add(hideClass);
});
const currentCode = document.getElementById(previewId);
currentCode.classList.remove(hideClass);
(await this.sourceSelector.getApi()).toggle(previewId, true);
this.preview.setAttribute(
'src',
`assets/iframes/homepage-examples/${previewId}.html`
);
}
}

Expand Down
Loading